problems with eventhandler with nagios1.2

Eric Doutreleau Eric.Doutreleau at int-evry.fr
Wed Apr 13 14:55:42 CEST 2005


hi
i'm using nagios 1.2 and i have a problem with the execution of an event
handmer

Here is the definition of my service

define service{
use check_rezo
host_name cisco7200
service_description bandwith RENATER
check_command
check_rrd2!/var/www/cacti/rra/cisco_7200_routeur_entre_traffic_in_681.rrd!14000000!16000000
event_handler sendsqlhandler
}

then the event_handler is sendsqlhandler
Here is its definition 

define command{
command_name sendsqlhandler
command_line /usr/lib/nagios/plugins/eventhandlers/eventhandlersql
$HOSTNAME$ "$SERVICEDESC$" $SERVICESTATE$ "$OUTPUT$"
}

but when the service change of state i can see the following in my 
nagios.log file

[1113342040] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;CRITICAL;HARD;3;sendsqlhandler
[1113342654] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;OK;HARD;3;sendsqlhandler
[1113377143] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;WARNING;SOFT;1;sendsqlhandler
[1113377204] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;WARNING;SOFT;2;sendsqlhandler
[1113377263] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;WARNING;HARD;3;sendsqlhandler
[1113377872] SERVICE EVENT HANDLER: cisco7200;bandwith
RENATER;CRITICAL;HARD;3;sendsqlhandler

but the script seems not to be launched.
when i launch it manually it works well under the identity of nagios.

how can i see what command nagios is running when it launch the
event_handler.
i put some debug information in my script as you can see below but
nothing in the debug file occurs

has someone already had this kind of problem?
thanks in advance for any help


#!/usr/bin/perl
use DBI;
$host=$ARGV[0];
$service=$ARGV[1];
$etatstate=$ARGV[2];
$output=$ARGV[3];
$ETAT{'OK'}=0;
$ETAT{'WARNING'}=1;
$ETAT{'CRITICAL'}=2;
$ETAT{'UNKNOWN'}=3;
my $db = "nagios";
my $server= "tyr.int-evry.fr";
my $user = "nagiosuser";
my $password = "*********";
my $debug = 0;
open(FIC,">>/var/log/nagios/event.debug") || die "peux pas ouvrir ke
dbug file $!\n";
$dbh = DBI->connect("DBI:mysql:$db:$server", $user, $password);
$dbh->{RaiseError} = 1;
if (not $dbh) {
close(FIC);
die "pas de connection a la base",$DBI::errstr,"\n";;
}
else
{
print "connection a la base reussie \n" if $debug;
}
my $quer = qq /UPDATE etat set etat = $ETAT{$etatstate} , chaine =
'$output' where host = '$host' AND service = '$service'/;
print FIC "$quer\n";
my $out=$dbh->prepare($quer);
$out->execute;
close(FIC);







-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list