Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
sudo chmod 777 /etc/openvpn/openvpn-status.log
sudo nano /usr/lib/xymon/client/ext/vpn.sh
#!/bin/sh

COLUMN=vpn									# THIS IS WHERE XYMON GETS COLUMN NAME
COLOR=green									# By default, everything is OK
MSG="service openvpn status | grep running" # The comamnd from var

#In this test, if var = empty = RED

var="$(service openvpn status | grep running)"
cmd="$(cat /etc/openvpn/openvpn-status.log)"

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
sudo chown xymon:xymon /usr/lib/xymon/client/ext/vpn.sh
sudo chmod 777 /usr/lib/xymon/client/ext/vpn.sh
sudo nano /etc/xymon/clientlaunch.d/vpn.cfg
[vpn]
	ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
	CMD $XYMONCLIENTHOME/ext/vpn.sh
	LOGFILE $XYMONCLIENTHOME/logs/vpn.log
	INTERVAL 5m
/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/vpn.sh

Restart Service :

sudo service xymon-client restart

On Server :

sudo service xymon restart && sudo service apache2 restart
  • No labels