Home Directory Plugins Telephony Asterisk check_asterisk_ami_v2.sh

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_asterisk_ami_v2.sh

Current Version
1.0.0.1
Last Release Date
2012-10-24
Compatible With
  • Nagios 2.x
  • Nagios 3.x
License
GPL
Hits
58890
Files:
FileDescription
check_asterisk_ami_v2.shcheck_asterisk_ami_v2.sh
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
check_asterisk_ami_v2.sh
Inspired By Jason's plugin
http://exchange.nagios.org/directory/Plugins/Telephony/Asterisk/check_asterisk_ami/details

2 news features :

- checkpeer
Know the state of a specific peer
(to see the state of a peer and not see all the peer trunks and phones ).

- g729
supervision of the use and the availability of channels with the g729 codec (Licences use).

Inspired By Jason's plugin

http://exchange.nagios.org/directory/Plugins/Telephony/Asterisk/check_asterisk_ami/details

Here is a adaptation of the check_asterisk_ami script with two new features

- checkpeer
Know the state of a specific peer
(to see the state of a peer and not see all the peer trunks and phones ).
The use of this functionality needs an additional argument which is "–n " Followed by the name of the peer you wan't to monitor. There is no use for the -w and the -c argument when using "checkpeer"

- g729
supervision of the use and the availability of channels with the g729 codec (Licences use).
The critical value of the number of channels is definied by the script who queries the Asterisk server to know the number of availible licences
If no value is defined for the –w argument the default value will be the number of availible licences – 1.

For both features , if the -u and the -p values are empty, it replaces the empty field by default Asterisk servers AMI access's (Admin amp111).
Reviews (1)
That's nice check, but I have issues with channel check and g729.

That's diff of fix if needed:
135c135
CHANNELS=`/bin/echo -e "Action: login\r\nUsername: ${AMIUSER}\r\nSecret: ${AMIPASS}\r\nEvents: off\r\n\r\nAction: Command\r\ncommand: Core Show Channels\r\n\r\nAction: Logoff\r\n\r\n" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/active channels/ {print $1}'|tr -d "\r"`
294c294
MAXLICTEST=`/bin/echo -e "Action: login\r\nUsername: ${AMIUSER}\r\nSecret: ${AMIPASS}\r\nEvents: off\r\n\r\nAction: Command\r\ncommand: show g729\r\n\r\nAction: Logoff\r\n\r\n" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/encoders/ {print $4}'`
302c302
ONUSE=`/bin/echo -e "Action: login\r\nUsername: ${AMIUSER}\r\nSecret: ${AMIPASS}\r\nEvents: off\r\n\r\nAction: Command\r\ncommand: show g729\r\n\r\nAction: Logoff\r\n\r\n" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/encoders/ {print substr($1, 1, match($1, "/") -1)}'`