User Tools

Site Tools


avaya:asm:zabbix

This is an old revision of the document!


Check Script for Zabbix

#!/bin/sh
smconsole="sudo /opt/Avaya/contrib/bin/sm console"
 
if [ $1 = "callcount" ];then
		callcountSM="${smconsole} GET AllCallCountSM"
		echo `$callcountSM` | sed -r "s/.*\=A\=([0-9]{1,3}).*/\1/g"
elif [ $1 = "health" ];then
		healthSM1="${smconsole} GET SMHealth 1"
		healthSM2="${smconsole} GET SMHealth 2"
		echo `$healthSM1` | sed -r "s/.*name=\"(.*)\".*status=(\w{1,10}),?.*smHealth=(.*)/\1:\2 Health:\3/g"
		echo `$healthSM2` | sed -r "s/.*name=\"(.*)\".*status=(\w{1,10}),?.*smHealth=(.*)/\1:\2 Health:\3/g"
elif [ $1 = "sipentities" ];then
		sipentities=`${smconsole} MONITOR Summary`
		#echo ${sipentities}
		status=`echo ${sipentities} | egrep 'INITIALIZING: \[\w.*\]|PARTIALLYUP: \[\w.*\]|DOWN: \[\w.*\]|DENY: \[\w.*\]'`
		if [ -z "$status" ];then
				echo "OK"
		else
				echo "Minor"
				echo ${sipentities} | egrep -o 'INITIALIZING: \[\w.*?\s?\] |PARTIALLYUP: \[\w.*?\s?\] |DOWN: \[\w.*?\s?\] |DENY: \[\w.*?\s?\]'
		fi
	elif [ $1 = "registeredp" ];then
		registeredSM=`${smconsole} GET RegistrationSummary`
		echo $registeredSM | sed -r "s/.*Primary: ([0-9]{1,5}).*Secondary: ([0-9]{1,5}).*/\1/g"
elif [ $1 = "registereds" ];then
		registeredSM=`${smconsole} GET RegistrationSummary`
		echo $registeredSM | sed -r "s/.*Primary: ([0-9]{1,5}).*Secondary: ([0-9]{1,5}).*/\2/g"
else
		echo "wrong or missing argument!"
fi

This topic does not exist yet

You've followed a link to a topic that doesn't exist yet. If permissions allow, you may create it by clicking on Create this page.

avaya/asm/zabbix.1709818872.txt.gz · Last modified: (external edit)