On 11 April 2013 00:27, Michael Beatty <Michael.Beatty at sherwin.com> wrote:
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.
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...
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.
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:
SERVERNAME=name.of.server
REPORT=backup_to_server $SERVERNAME # calls backup function, which
returns empty report if OK
report status
if [ "$REPORT" ]; then
printf "status $SERVERNAME.backup red date Backup to $SERVERNAME
failed\n$REPORT\n"
else
printf "status $SERVERNAME.backup green date Backup to $SERVERNAME OK\n"
fi | xymoncmd sh -c 'xymon $XYMSRV @'
report client data
CLIENTDATA=ssh $SERVERNAME 'echo "[uptime]"; uptime; echo "[df]"; df -Pl /home/usr; echo "[inode]"; df -Pil /home/usr'
printf "client $SERVERNAME.linux\n$CLIENTDATA\n" | xymoncmd sh -c 'xymon
$XYMSRV @'
J