Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

This is for Ubuntu 16 as thats what I am using ATM.

cat << 'EOL' >/usr/lib/xymon/client/ext/git.sh
#!/bin/sh

COLUMN=git			
COLOR=green				
MSG="Git-Daemon Status Check" 

#In this test, if var = empty = RED
var="$(service git-daemon status | grep running)"
cmd="$(service git-daemon status)"


if [ -z "$var" ]

then

COLOR=red
MSG="${MSG}
FAILED
""
"${cmd}"
"
else

MSG="${MSG}
SUCCESS
""
"${cmd}"
"
fi

# Leave the rest of script alone
# Tell Xymon about it
$XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date`

${MSG}
"

exit 0

EOL

sudo chown xymon:xymon /usr/lib/xymon/client/ext/git.sh
sudo chmod 777 /usr/lib/xymon/client/ext/git.sh
cat << 'EOL' >/etc/xymon/clientlaunch.d/git.cfg
[git]
 ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
 CMD $XYMONCLIENTHOME/ext/git.sh
 LOGFILE $XYMONCLIENTHOME/logs/git.log
 INTERVAL 15m
EOL
sudo chmod 777 /etc/xymon/clientlaunch.d/*
sudo chown xymon:xymon /etc/xymon/clientlaunch.d/*
/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/git.sh
  • No labels