Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
sudo visudo && sudo service sudo restart
xymon  ALL=(ALL)      NOPASSWD: /usr/bin/teamviewer
sudo nano /usr/lib/xymon/client/ext/teamviewer.sh
#!/bin/sh

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

#In this test, if var = empty = RED

var="$(teamviewer --info status | grep running)"
cmd="$(teamviewer --info 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
sudo chown xymon:xymon /usr/lib/xymon/client/ext/teamviewer.sh
sudo chmod 777 /usr/lib/xymon/client/ext/teamviewer.sh
sudo nano /etc/xymon/clientlaunch.d/teamviewer.cfg
[teamviewer]
	ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
	CMD $XYMONCLIENTHOME/ext/teamviewer.sh
	LOGFILE $XYMONCLIENTHOME/logs/teamviewer.log
	INTERVAL 5m
/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/teamviewer.sh

Restart Service :

sudo service xymon-client restart

On Server :

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