2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/asterisk/asterisk_14_fax_ffa/fax_test
2018-03-28 04:28:02 +02:00

40 lines
1.1 KiB
Perl
Executable File

#!/usr/bin/perl
use Carp;
use strict;
use Asterisk::AMI;
do './get_fax_stats.pl';
my $ret = undef;
if ( ! eval "require Asterisk::AMI;" ) {
$ret = "Asterisk::AMI not found";
};
if ( $ARGV[ 0 ] and $ARGV[ 0 ] eq "config" ) {
print "graph_title Asterisk active fax channels\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel channels\n";
print "graph_category voip\n";
print "channels.draw AREA\n";
print "channels.label channels\n";
exit 0;
};
#my $host = exists $ENV{ 'host' } ? $ENV{ 'host' } : "127.0.0.1";
#my $port = exists $ENV{ 'port' } ? $ENV{ 'port' } : "5038";
#my $username = $ENV{ 'username' };
#my $secret = $ENV{ 'secret' };
our $username = 'manager';
our $host = '127.0.0.1';
our $port = '5038';
our $secret = 'insecure';
our $timeout = '5';
my %faxstats = get_fax_stats();
my $channels = $faxstats{'Digium G.711'}{'Licensed Channels'};
print "channels.value $channels\n";
exit( 0 );