Zionetrix::Git
Repositories
Help
Report an Issue
check_asterisk
Code
Commits
Branches
Tags
Search
Tree:
07d7c29
Branches
Tags
master
check_asterisk
check_sip_latency
Initial commit
Benjamin Renard
commited
07d7c29
at 2012-10-09 11:25:13
check_sip_latency
Blame
History
Raw
#!/bin/bash # Verifie la latence d'une connexion SIP Asterisk PEER=$1 [ ! -n "$PEER" ] && echo "Usage : $0 [peer]" && exit 1 CRITICAL=100 WARNING=40 latency=`/usr/bin/sudo -u root /usr/sbin/rasterisk -rnx "sip show peer $PEER"|grep Status|sed 's/.*(\([0-9]*\) ms.*/\1/g'` if [ ! -n "$latency" ] then /bin/echo "SIP Latency UNKNOWN" exit 3 fi details="Latency : $latency ms" if [ $latency -gt $CRITICAL ] then nstatus="CRITICAL" exitcode=2 elif [ $latency -gt $WARNING ] then nstatus="WARNING" exitcode=1 else nstatus="OK" exitcode=0 fi /bin/echo "SIP Latency ${nstatus} : $details | latency=${latency}ms" exit $exitcode