2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

asterisk_channels plugin first added

This plugin monitors number of active asterisk channels
This commit is contained in:
Eugene Varnavsky 2012-06-28 23:26:07 +04:00
parent f4324f213d
commit ae9f97ea9e

View File

@ -0,0 +1,28 @@
#!/usr/bin/php
<?
// Munin plugin
// Gets number of active channels
// By Eugene Varnavsky
// June 2012
// Version 1.0
//
// LGPL License
if (isset($argv[1]) && $argv[1] == "autoconf") {
echo "yes\n";
exit(0);
}
if (isset($argv[1]) && $argv[1] == "config") {
echo "graph_title Asterisk Channels\n";
echo "graph_args --base 1000 -l 0\n";
echo "graph_vlabel Channels\n";
echo "graph_category asterisk\n";
echo "channels.label Channels\n";
exit (0);
}
$out = `asterisk -x "core show channels"`;
preg_match('/(\d{1,4}) active channels/i', $out, $channels);
echo "channels.value $channels[1]\n";
?>