git-svn-id: http://svn.centreon.com/Plugins/Dev@2568 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Mat Sugumaran 2007-07-04 12:10:51 +00:00
parent af314ab658
commit 7677569b04
2 changed files with 6 additions and 5 deletions

View File

@ -29,7 +29,7 @@ use Getopt::Long;
use DBI; use DBI;
use vars qw($mysql_database_oreon $mysql_database_ods $mysql_host $mysql_user $mysql_passwd); 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 ## Get snmptt configuration files path
@ -76,8 +76,10 @@ sub main() {
print FILE "EVENT ".$values[0]." ".$values[1]." \"Status Event\" ".$values[2]."\n"; print FILE "EVENT ".$values[0]." ".$values[1]." \"Status Event\" ".$values[2]."\n";
if (defined($values[3])) { if (defined($values[3])) {
print FILE "FORMAT ".$values[3]."\n"; print FILE "FORMAT ".$values[3]."\n";
} }else {
print FILE "EXEC ".$NAGIOS_TRAPS."/trapHandler \$aA \$o \"$values[3]\"\n"; $values[3] = "no output for trap!";
}
print FILE "EXEC ".$NAGIOS_TRAPS."trapHandler \$aA \$o \"$values[3]\"\n";
if (defined($values[4])) { if (defined($values[4])) {
print FILE "SDESC\n".$values[4]; print FILE "SDESC\n".$values[4];
if ($values[4] =~ /\n$/) { if ($values[4] =~ /\n$/) {

View File

@ -28,7 +28,7 @@ use strict;
use DBI; use DBI;
use vars qw($mysql_database_oreon $mysql_database_ods $mysql_host $mysql_user $mysql_passwd); 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 ## GET HOSTNAME FROM IP ADDRESS
@ -124,6 +124,5 @@ if (scalar(@ARGV)) {
my $ip = $ARGV[0]; my $ip = $ARGV[0];
my $oid = $ARGV[1]; my $oid = $ARGV[1];
my $arguments = $ARGV[2]; my $arguments = $ARGV[2];
my $toto = `/bin/echo $arguments >> /tmp/traphandler.log`;
getTrapsInfos($ip, $oid, $arguments); getTrapsInfos($ip, $oid, $arguments);
} }