How to monitor vos3000 services - VPSVOS COMMUNICATION

December 23, 2018by Didier Pirone0

How to monitor vos3000 services and start if vos3000 services stop

VOS3000
If you want to monitor vos3000 services and start if vos3000 services stop. VOS3000 version 2.1.2.0 is stopped after some time so you can monitor the vos3000 services and start it. Here I am using three shell scripts to monitor to vos3000 service and start it. I am checking vos3000 service every 5 seconds and if stops I am starting with a script and send an email alert.
1 – I have created watchdog script to check mbx3000d service and send an email alert
Linux# nano /etc/voscheck.sh
#!/bin/bash
#
# watchdog
NAME=mbx3000
START=/etc/mbx3000.sh
NOTIFY=your-email-address
NOTIFYCC=your-email-address
GREP=/bin/grep
PS=/bin/ps
NOP=/bin/true
DATE=/bin/date
MAIL=/bin/mail
RM=/bin/rm
$PS -ef|$GREP -v grep|$GREP $NAME >/dev/null 2>&1
case “$?” in
0)
# It is running in this case so we do nothing.
$NOP
;;
1)
echo “$NAME is NOT RUNNING. Starting $NAME and sending notices.”
$START 2>&1 >/dev/null &
NOTICE=/tmp/watchdog.txt
echo “$NAME was not running and was started on `$DATE`” > $NOTICE
$MAIL -n -s “watchdog notice” -c $NOTIFYCC $NOTIFY < $NOTICE
$RM -f $NOTICE
;;
esac
exit
2 – Create script for start mbx3000 service
Linux# nano /etc/mbx3000.sh
#!/bin/bash
service mbx3000d start
3 – Check service every 5 second
Linux# nano /etc/check5.sh
#!/bin/bash
while true
do
/etc/voscheck.sh
sleep 5
done
4 – Execute the script in the background
Linux# nohup /etc/check5.sh &

Didier Pirone

Leave a Reply

Your email address will not be published. Required fields are marked *

VPSVOS COMMUNICATIONHeadquarters
VPSVOS Communications is a registered company in the United States of America. Registered Office: 19854 Michigan Avenue Brekford, CA 599780 USA.
OUR LOCATIONSWhere to find us?
https://vpsvos.com/wp-content/uploads/2019/04/img-footer-map.png
FOLLOW USVPSVOS Social Connect
Stay up to date with the latest news about VPSVOS Communication, events, special offers and more by connecting with our social media.
VPSVOS COMMUNICATIONHeadquarters
VPSVOS Communications is a registered company in the United States of America. Registered Office: 19854 Michigan Avenue Brekford, CA 599780 USA.
OUR LOCATIONSWhere to find us?
https://vpsvos.com/wp-content/uploads/2019/04/img-footer-map.png
FOLLOW USVPSVOS Social Connect
Stay up to date with the latest news about VPSVOS Communication, events, special offers and more by connecting with our social media.

Copyright © 2005 – 2020 VPSVOS All Rights Reserved.

Copyright © 2011 – 2020 VPSVOS All Rights Reserved.