mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 23:54:18 +02:00
asterisk: update xivo's script
This commit is contained in:
parent
40d9aa6d5e
commit
92fe6a38af
@ -0,0 +1 @@
|
|||||||
|
<centreon asterisk user> <centreon asterisk secret>
|
@ -33,6 +33,7 @@
|
|||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
my $ret = undef;
|
my $ret = undef;
|
||||||
if (! eval "require Net::Telnet;")
|
if (! eval "require Net::Telnet;")
|
||||||
@ -40,6 +41,9 @@ if (! eval "require Net::Telnet;")
|
|||||||
$ret = "Net::Telnet not found";
|
$ret = "Net::Telnet not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $DIRNAME=dirname($0);
|
||||||
|
my $conffile=$DIRNAME."/asterisk_centreon.conf";
|
||||||
|
|
||||||
my $command;
|
my $command;
|
||||||
if ( (defined($ARGV[0])) && ($ARGV[0] ne '') )
|
if ( (defined($ARGV[0])) && ($ARGV[0] ne '') )
|
||||||
{
|
{
|
||||||
@ -60,7 +64,7 @@ my $port = exists $ENV{'port'} ? $ENV{'port'} : "5038";
|
|||||||
|
|
||||||
my ($username, $secret);
|
my ($username, $secret);
|
||||||
|
|
||||||
open FILE, "asterisk-centreon.conf" or die $!;
|
open FILE, $conffile or die $!;
|
||||||
while (my $confline = <FILE>)
|
while (my $confline = <FILE>)
|
||||||
{
|
{
|
||||||
($username, $secret) = split(' ', $confline);
|
($username, $secret) = split(' ', $confline);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user