asterisk: update xivo's script

This commit is contained in:
David Sabatié 2015-01-16 18:49:38 +01:00
parent eafb5b7e85
commit 676c10f6e0
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1 @@
<centreon asterisk user> <centreon asterisk secret>

View File

@ -33,6 +33,7 @@
#%# capabilities=autoconf
use strict;
use File::Basename;
my $ret = undef;
if (! eval "require Net::Telnet;")
@ -40,6 +41,9 @@ if (! eval "require Net::Telnet;")
$ret = "Net::Telnet not found";
}
my $DIRNAME=dirname($0);
my $conffile=$DIRNAME."/asterisk_centreon.conf";
my $command;
if ( (defined($ARGV[0])) && ($ARGV[0] ne '') )
{
@ -60,7 +64,7 @@ my $port = exists $ENV{'port'} ? $ENV{'port'} : "5038";
my ($username, $secret);
open FILE, "asterisk-centreon.conf" or die $!;
open FILE, $conffile or die $!;
while (my $confline = <FILE>)
{
($username, $secret) = split(' ', $confline);