mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
asterisk: Add configuration options to disable conference graphs
Since the MeetMe application is not available anymore on Debian, it makes no sense to keep the graph around. We do however want to keep code around for parsing stats from MeetMe. So we'll add two "binary" flags that'll let users which of these two graphs they want. The default values will favor getting information from ConfBridge which is the suggested replacement for MeetMe. An added bonus of this is that some users might decide to disable both graphs if they use neither applications, which was impossible before.
This commit is contained in:
parent
46b5f4bd13
commit
7492865044
1 changed files with 69 additions and 48 deletions
|
@ -37,6 +37,8 @@ The following configuration parameters are used by this plugin
|
|||
env.channels - The channel types to look for
|
||||
env.codecsx - List of codec IDs (hexadecimal values)
|
||||
env.codecs - List of codecs names, matching codecsx order
|
||||
env.meetme - Set to 1 to enable graphs for the MeetMe application
|
||||
env.confbridge - Set to 1 to enable graphs for the ConfBridge application
|
||||
|
||||
The "username" and "secret" parameters are mandatory, and have no
|
||||
defaults.
|
||||
|
@ -49,6 +51,8 @@ defaults.
|
|||
env.channels Zap IAX2 SIP
|
||||
env.codecsx 0x2 0x4 0x8
|
||||
env.codecs gsm ulaw alaw
|
||||
env.meetme 0
|
||||
env.confbridge 1
|
||||
|
||||
=head2 WILDCARD CONFIGURATION
|
||||
|
||||
|
@ -122,6 +126,9 @@ my @CHANNELS = exists $ENV{'channels'} ? split ' ',$ENV{'channels'} : qw(Zap IAX
|
|||
my @CODECS = exists $ENV{'codecs'} ? split ' ',$ENV{'codecs'} : qw(gsm ulaw alaw);
|
||||
my @CODECSX = exists $ENV{'codecsx'} ? split ' ',$ENV{'codecsx'} : qw(0x2 0x4 0x8);
|
||||
|
||||
my $meetme_enabled = $ENV{'meetme'} || '0';
|
||||
my $confbridge_enabled = $ENV{'confbridge'} || '1';
|
||||
|
||||
my $line, my $error;
|
||||
my $socket = new IO::Socket::INET(PeerAddr => $peeraddr,
|
||||
PeerPort => $peerport,
|
||||
|
@ -182,7 +189,8 @@ graph_category voip
|
|||
total.label Total messages
|
||||
END
|
||||
|
||||
print <<END;
|
||||
if ($meetme_enabled == '1') {
|
||||
print <<END;
|
||||
|
||||
multigraph asterisk_meetme
|
||||
graph_title Asterisk meetme statistics
|
||||
|
@ -191,8 +199,10 @@ graph_category voip
|
|||
users.label Connected users
|
||||
conferences.label Active conferences
|
||||
END
|
||||
}
|
||||
|
||||
print <<END;
|
||||
if ($confbridge_enabled == '1') {
|
||||
print <<END;
|
||||
|
||||
multigraph asterisk_confbridge
|
||||
graph_title Asterisk ConfBridge statistics
|
||||
|
@ -201,6 +211,7 @@ graph_category asterisk
|
|||
users.label Connected users
|
||||
conferences.label Active conferences
|
||||
END
|
||||
}
|
||||
|
||||
print <<END;
|
||||
|
||||
|
@ -246,15 +257,21 @@ my $voicemail_response = asterisk_command($socket, "voicemail show users");
|
|||
#other 1234 Company2 User 0
|
||||
#2 voicemail users configured.
|
||||
|
||||
my $meetme_response = asterisk_command($socket, "meetme list");
|
||||
#Conf Num Parties Marked Activity Creation
|
||||
#5500 0001 N/A 00:00:03 Static
|
||||
#* Total number of MeetMe users: 1
|
||||
my $meetme_response;
|
||||
if ($meetme_enabled == '1') {
|
||||
$meetme_response = asterisk_command($socket, "meetme list");
|
||||
#Conf Num Parties Marked Activity Creation
|
||||
#5500 0001 N/A 00:00:03 Static
|
||||
#* Total number of MeetMe users: 1
|
||||
}
|
||||
|
||||
my $confbridge_response = asterisk_command($socket, "confbridge list");
|
||||
#Conference Bridge Name Users Marked Locked Muted
|
||||
#================================ ====== ====== ====== =====
|
||||
#3 1 0 No No
|
||||
my $confbridge_response;
|
||||
if ($confbridge_enabled == '1') {
|
||||
$confbridge_response = asterisk_command($socket, "confbridge list");
|
||||
#Conference Bridge Name Users Marked Locked Muted
|
||||
#================================ ====== ====== ====== =====
|
||||
#3 1 0 No No
|
||||
}
|
||||
|
||||
my $sipchannels_response = asterisk_command($socket, "sip show channels");
|
||||
#Peer User/ANR Call ID Format Hold Last Message Expiry Peer
|
||||
|
@ -299,13 +316,14 @@ if ( !$voicemail_response or $voicemail_response =~ /no voicemail users/ ) {
|
|||
print "total.value $messages\n";
|
||||
}
|
||||
|
||||
print "\nmultigraph asterisk_meetme\n";
|
||||
if ( !$meetme_response ) {
|
||||
if ($meetme_enabled == '1') {
|
||||
print "\nmultigraph asterisk_meetme\n";
|
||||
if ( !$meetme_response ) {
|
||||
print <<END;
|
||||
users.value U
|
||||
conferences.value U
|
||||
END
|
||||
} else {
|
||||
} else {
|
||||
if ( $meetme_response =~ /No active/ ) {
|
||||
print <<END;
|
||||
users.value 0
|
||||
|
@ -320,15 +338,17 @@ END
|
|||
print "users.value $users\n";
|
||||
print "conferences.value " . (scalar(@meetme_list)-1) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\nmultigraph asterisk_confbridge\n";
|
||||
if ( !$confbridge_response ) {
|
||||
if ($confbridge_enabled == '1') {
|
||||
print "\nmultigraph asterisk_confbridge\n";
|
||||
if ( !$confbridge_response ) {
|
||||
print <<END;
|
||||
users.value U
|
||||
conferences.value U
|
||||
END
|
||||
} else {
|
||||
} else {
|
||||
my @confbridge_list = split(/\r?\n/, $confbridge_response);
|
||||
# Remove column headers, then line of =
|
||||
shift(@confbridge_list);
|
||||
|
@ -347,6 +367,7 @@ END
|
|||
|
||||
print "users.value $users\n";
|
||||
print "conferences.value " . (scalar(@confbridge_list)) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "\nmultigraph asterisk_codecs\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue