Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Asterisk PRI Status
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!
A Nagios plugin which queries Asterisk's manager interface and executes the pri show spans CLI command (this is Asterisk 1.4 by the way). The script then parses the output to ascertain whether a PRI is up or not, whether the expected number of PRIs were found, if there are enough to satisfy warning/critical levels, etc.
It will also check for and report connection issues, bad username/password and wrong permissions.
Written in PHP.
Download link: http://www.opensolutions.ie/misc/check_asterisk_pri.php.txt
It will also check for and report connection issues, bad username/password and wrong permissions.
Written in PHP.
Download link: http://www.opensolutions.ie/misc/check_asterisk_pri.php.txt
Reviews (4)
byiBrewBeer, May 27, 2014
Getting same thing as above commenter. It's not doing anything.
Works great! However, if you're using PHP5, you're likely going to run into a PHP Notice error message:
PHP Notice: Undefined variable: asttext in /check_asterisk_pri on line 181
To remedy this, just replace the following code:
while( !feof ( $astsock ))
{
$asttext .= fread( $astsock, 8192);
}
with the following:
$asttext = stream_get_contents($astsock);
Thanks for making this...we've been having odd problems with PRI syncing and this keeps us informed.
PHP Notice: Undefined variable: asttext in /check_asterisk_pri on line 181
To remedy this, just replace the following code:
while( !feof ( $astsock ))
{
$asttext .= fread( $astsock, 8192);
}
with the following:
$asttext = stream_get_contents($astsock);
Thanks for making this...we've been having odd problems with PRI syncing and this keeps us informed.
bysocain, March 14, 2012
If you send the right parameters and configure asterisk manager account it works great. It broke after an upgrade to asterisk 1.8.9 because they take out the word "Provisioned" in "pri show spans", so had to add the following code:
else if( strpos( $segment, "Up, Active" ) !== FALSE )
$lines[$count]['up'] = 1;
Just after the existing section/code:
if( strpos( $segment, "Provisioned, Up, Active" ) !== FALSE )
$lines[$count]['up'] = 1;
else if( strpos( $segment, "Up, Active" ) !== FALSE )
$lines[$count]['up'] = 1;
Just after the existing section/code:
if( strpos( $segment, "Provisioned, Up, Active" ) !== FALSE )
$lines[$count]['up'] = 1;
byjoak0, September 24, 2010
All parameter are specified but it does not attempt to connect:
# ./check_asterisk_pri -H pbxserver -u someuser -p somesecret
Host, Username and Password are required.
# ./check_asterisk_pri -H pbxserver -u someuser -p somesecret
Host, Username and Password are required.