Asterisk

check_asterisk_ami_v2.sh

Description:

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).

Current Version

1.0.0.1

Last Release Date

2012-10-24

Compatible With

  • Nagios 2.x
  • Nagios 3.x

Owner

License

GPL


Project Files
Project Photos
Project Notes
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) Add a Review
Nice plug-in but 2 issues in code
by artickl, October 31, 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: loginrnUsername: ${AMIUSER}rnSecret: ${AMIPASS}rnEvents: offrnrnAction: Commandrncommand: Core Show ChannelsrnrnAction: Logoffrnrn" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/active channels/ {print $1}'|tr -d "r"` 294c294 MAXLICTEST=`/bin/echo -e "Action: loginrnUsername: ${AMIUSER}rnSecret: ${AMIPASS}rnEvents: offrnrnAction: Commandrncommand: show g729rnrnAction: Logoffrnrn" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/encoders/ {print $4}'` 302c302 ONUSE=`/bin/echo -e "Action: loginrnUsername: ${AMIUSER}rnSecret: ${AMIPASS}rnEvents: offrnrnAction: Commandrncommand: show g729rnrnAction: Logoffrnrn" | /bin/netcat ${REMOTEHOST} ${AMIPORT} | awk '/encoders/ {print substr($1, 1, match($1, "/") -1)}'`



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4 (1)
Favorites
0
Views
58,795