PRTG giám sát dịch vụ asterisk up/down thông qua bash script – PRTG monitoring service asterisk up/down via bash script

on
  1. Monitoring on CentOS 6
    mkdir -p /home/scrips
    vim /home/scrips/monitor_serivce_asterisk.sh
    Add the script below into the monitor_serivce_asterisk.sh file


!/bin/bash
serviceIsRunning=false
var1=$(/etc/init.d/asterisk status | awk ‘{print $3}’)
if [ “$var1” == ‘running’ ]
then
serviceIsRunning=true
echo “0:200:Running”
fi
if [ $serviceIsRunning == false ]
then
echo “2:404:stop”
fi

Leave a Reply

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