<div dir="ltr">On 11 April 2013 00:27, Michael Beatty <span dir="ltr"><<a href="mailto:Michael.Beatty@sherwin.com" target="_blank">Michael.Beatty@sherwin.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">My initial thought was to write an extension script that does an 'rsh backup du /home/user/' and parsing the results and test against a threshold, but I would prefer to utilize what is built into xymon before recreating the wheel.<br>


</blockquote><div><br></div><div>There's nothing within Xymon that supports this, without a client installation.  As others have said, this might not be a bad idea anyway.  Just have the client run and report its details.  But if you don't want to do this...</div>

<div><br></div><div style>If you have snmp enabled on the server, you can get disk space using devmon, which is not part of Xymon, but a well-used add-on.</div>
<div><br></div><div>You have identified one risk: that the disk fills up.  But what about the risk that the backup copy process fails for another reason (account expires, rsh/ssh daemon stopped, out of inodes, etc).  So you probably want to build some tests into your copy script and have it report success to Xymon.  While you're at it, just get the "du" output and report that also.  If you use a client message, you can report as little or as much info as you like.  A status message would be required for the backup result:</div>


<div><br></div><div style><font face="courier new, monospace">SERVERNAME=name.of.server<br></font></div><div><font face="courier new, monospace">REPORT=`backup_to_server $SERVERNAME`  # calls backup function, which returns empty report if OK<br>

</font></div><div style><span style="font-family:'courier new',monospace"># report status</span><br></div><div><span style="font-family:'courier new',monospace">if [ "$REPORT" ]; then</span><br>
</div>
<div><font face="courier new, monospace">  printf "status $SERVERNAME.backup red `date` Backup to $SERVERNAME failed\n$REPORT\n"<br></font></div><div style><font face="courier new, monospace">else<br></font></div>

<div style><font face="courier new, monospace">  printf "status $SERVERNAME.backup green `date` Backup to $SERVERNAME OK\n"<br></font></div><div style><font face="courier new, monospace">fi  | xymoncmd sh -c 'xymon $XYMSRV @'</font></div>

<div style><font face="courier new, monospace"># report client data</font></div><div style><div><font face="courier new, monospace">CLIENTDATA=`ssh $SERVERNAME 'echo "[uptime]"; uptime; echo "[df]"; df -Pl /home/usr; echo "[inode]"; df -Pil /home/usr'`<br>

</font></div><div><font face="courier new, monospace">printf "client $SERVERNAME.linux\n$CLIENTDATA\n" | xymoncmd sh -c 'xymon $XYMSRV @'</font></div><div><font face="courier new, monospace"><br></font></div>

</div><div style><br></div><div style>J</div><div style><br></div></div></div></div>