On the server, you can get the total amount of RAM from the "top" client data like so:<div><br></div><div>xymon localhost 'clientlog name.of.server section=top' | sed -n '/^Mem:/{s/ total.*$//;s/^.* //;p}'</div>

<div><br></div><div>A client-side script like this should check that the memory is as it should be:</div><div><br></div><div><div><font face="courier new, monospace">#!/bin/sh</font></div><div><font face="courier new, monospace">TEST=ram-check</font></div>

<div><font face="courier new, monospace">xymongrep "$TEST:*" | while read LINE; do</font></div><div><span style="font-family:'courier new',monospace">  set - ""$LINE; HN="$2"</span></div>

<div><font face="courier new, monospace">  [ "$HN" ] || continue</font></div><div><font face="courier new, monospace">  RAMREQUIRED=`echo "$LINE" | sed "s/^.*${TEST}://;s/ .*$//;s/k$//"`</font></div>

<div><font face="courier new, monospace">  HNCOMMAS=`echo "$HN" | sed 's/\./,/g'`</font></div><div><span style="font-family:'courier new',monospace">  RAMFOUND=`xymon $XYMSRV "clientlog $HN section=top" | sed -n '/^Mem:/{s/ total.*$//;s/^.* //;s/k$//p}'`</span></div>

<div><span style="font-family:'courier new',monospace">  if [ "$RAMFOUND" -lt "$RAMREQUIRED" ]; then</span></div><div><font face="courier new, monospace">    COL=red</font></div><div><font face="courier new, monospace">    MSG="RAM count ${RAMFOUND}kB is less than ${RAMREQUIRED}kB"</font></div>

<div><font face="courier new, monospace">  else</font></div><div><font face="courier new, monospace">    COL=green</font></div><div><font face="courier new, monospace">    MSG="RAM count ${RAMFOUND}kB is at least ${RAMREQUIRED}kB"</font></div>

<div><font face="courier new, monospace">  fi</font></div><div><span style="font-family:'courier new',monospace">  echo $XYMON $XYMSRV "status $HNCOMMAS.$TEST $COL `date` $MSG"</span></div><div><font face="courier new, monospace">done</font></div>

<div><br></div><div>This script checks any server tagged with "ram-check:NNN" where NNN is a number of kB" and creates a "ram-check" status page with the result.</div><div><br></div><div>J</div><div>

<br></div><br><div class="gmail_quote">On Mon, Jun 18, 2012 at 5:25 PM, Mark Wagner <span dir="ltr"><<a href="mailto:mark+xymon@carnildo.com" target="_blank">mark+xymon@carnildo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

One of my servers has a quirk where it will occasionally fail to detect<br>
two-thirds of its RAM on startup.  Is it possible to set things up to<br>
send an alert if *total* RAM is below a certain amount?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mark Wagner<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</font></span></blockquote></div><br></div>