My custom notification perl script doenst work..?


#1

Hello. I am new to this forum, It is already a week since I am trying to write a simple script that calls my cellphone in case a server runs down. If I run script from command line it works , From nagios it doesnt work neither writes any errors. What could be the matter. I can see that scripts is called by nagios in logs.

Here i put the script:
define command{
command_name notify-by-cellphone
command_line /usr/local/nagios/libexec/notify_by_cellphone.pl

            }

#################################3
#!/usr/bin/perl -w

use strict;
use Device::Modem;

use lib “/usr/local/nagios/libexec”;
use utils qw(%ERRORS $TIMEOUT);

my $number=“0,69783392”;

my $port = “/dev/ttyS0”;
my $modem = new Device::Modem(port => $port ) or exit $ERRORS{“UNKNOWN”};
my $timeout = 11;

$modem->connect() or exit $ERRORS{“UNKNOWN”};
$modem->dial($number,$timeout);
$modem->hangup();

$modem->disconnect();

exit $ERRORS{“OK”};

########################################