From 7677569b043827c0d3efb541b8235826de0fa086 Mon Sep 17 00:00:00 2001 From: Mat Sugumaran Date: Wed, 4 Jul 2007 12:10:51 +0000 Subject: [PATCH] bug fix git-svn-id: http://svn.centreon.com/Plugins/Dev@2568 6bcd3966-0018-0410-8128-fd23d134de7e --- src/traps/genSnmpttConfFile | 8 +++++--- src/traps/trapHandler | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/traps/genSnmpttConfFile b/src/traps/genSnmpttConfFile index b913f1677..14d881bb5 100644 --- a/src/traps/genSnmpttConfFile +++ b/src/traps/genSnmpttConfFile @@ -29,7 +29,7 @@ use Getopt::Long; use DBI; use vars qw($mysql_database_oreon $mysql_database_ods $mysql_host $mysql_user $mysql_passwd); -require "@CENTREON_PATH@/ODS/etc/conf.pm"; +require "/srv/oreon/ODS/etc/conf.pm"; ###################################### ## Get snmptt configuration files path @@ -76,8 +76,10 @@ sub main() { print FILE "EVENT ".$values[0]." ".$values[1]." \"Status Event\" ".$values[2]."\n"; if (defined($values[3])) { print FILE "FORMAT ".$values[3]."\n"; - } - print FILE "EXEC ".$NAGIOS_TRAPS."/trapHandler \$aA \$o \"$values[3]\"\n"; + }else { + $values[3] = "no output for trap!"; + } + print FILE "EXEC ".$NAGIOS_TRAPS."trapHandler \$aA \$o \"$values[3]\"\n"; if (defined($values[4])) { print FILE "SDESC\n".$values[4]; if ($values[4] =~ /\n$/) { diff --git a/src/traps/trapHandler b/src/traps/trapHandler index 285a1e67d..3b3adcab5 100644 --- a/src/traps/trapHandler +++ b/src/traps/trapHandler @@ -28,7 +28,7 @@ use strict; use DBI; use vars qw($mysql_database_oreon $mysql_database_ods $mysql_host $mysql_user $mysql_passwd); -require "@CENTREON_PATH@/ODS/etc/conf.pm"; +require "/srv/oreon/ODS/etc/conf.pm"; ############################### ## GET HOSTNAME FROM IP ADDRESS @@ -124,6 +124,5 @@ if (scalar(@ARGV)) { my $ip = $ARGV[0]; my $oid = $ARGV[1]; my $arguments = $ARGV[2]; - my $toto = `/bin/echo $arguments >> /tmp/traphandler.log`; getTrapsInfos($ip, $oid, $arguments); }