Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_asterisk_ami_v2.sh
1.0.0.1
2012-10-24
- Nagios 2.x
- Nagios 3.x
GPL
58627
File | Description |
---|---|
check_asterisk_ami_v2.sh | check_asterisk_ami_v2.sh |
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)
byartickl, October 30, 2012
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)}'`
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)}'`