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:
parent
f4324f213d
commit
ae9f97ea9e
1 changed files with 28 additions and 0 deletions
28
plugins/asterisk/asterisk_channels
Normal file
28
plugins/asterisk/asterisk_channels
Normal 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";
|
||||||
|
?>
|
Loading…
Reference in a new issue