mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-02 22:28:24 +00:00
organize asterisk plugins
untar asterisk-fax and move asterisk-multigraph-munin-plugin
This commit is contained in:
parent
05ce4b8d87
commit
c33bbb90e5
53 changed files with 6292 additions and 0 deletions
41
plugins/asterisk/asterisk_14_fax_ffa/can-install.pl
Executable file
41
plugins/asterisk/asterisk_14_fax_ffa/can-install.pl
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#
|
||||
# can-install.pl - Can we install this set of Munin plugins?
|
||||
#
|
||||
|
||||
use Carp;
|
||||
use strict;
|
||||
|
||||
# Step(1) - Is Asterisk installed?
|
||||
my $system;
|
||||
my $asterisk = `$system which asterisk`;
|
||||
chomp( $asterisk );
|
||||
print "no - Cannot find program 'asterisk' \n" if !$asterisk;
|
||||
exit( 0 ) if !$asterisk;
|
||||
|
||||
# Step(2) - Are we running the correct version of Asterisk?
|
||||
my $command = 'core show version';
|
||||
my $string = `$asterisk -rx \"$command\"`;
|
||||
my @string = split( / /, "$string" );
|
||||
my $version = $string[ 1 ];
|
||||
my @vals = split( '\.', "$version" );
|
||||
my $short_version = $vals[ 0 ] . '.' . $vals[ 1 ];
|
||||
print "no - Running wrong version of Asterisk. Need 1.4\n" if $short_version ne '1.4';
|
||||
exit( 0 ) if $short_version ne '1.4';
|
||||
|
||||
# Are the Digium FFA modules installed?
|
||||
my $command = 'module show like res_fax_digium.so';
|
||||
my $string = `$asterisk -rx \"$command\"`;
|
||||
my @string = split( /\n/, "$string" );
|
||||
my @vals = split( / /, $string[ 2 ] );
|
||||
my $module = $vals[ 0 ];
|
||||
print "no - Digium FFA module not installed" if ! $module;
|
||||
exit( 0 ) if ! $module;
|
||||
|
||||
# Step(4) - Is Asterisk::AMI installed?
|
||||
eval "use Asterisk::AMI";
|
||||
print "PERL module Asterisk::AMI not found. Exiting...\n" if $@;
|
||||
exit( 0 ) if $@;
|
||||
|
||||
print "yes\n";
|
Loading…
Add table
Add a link
Reference in a new issue