logo       

RE: [TEC] task in rule fails due to strange return from wsnmptrap [RESOLVED: msg#00592

sysutils.tivoli.tme10

Subject: RE: [TEC] task in rule fails due to strange return from wsnmptrap [RESOLVED]

Arrrrrgggg ... I found the problem right after I posed this issue to the list
... path to script in the exec_program template has a typo. That was the
whole cause of my problem. I've been beating my head against the desk for the
better part of a week, and only after reading my own email did I see that I had
the path wrong.

I hate Mondays.

John Guadagnino
Gap Inc.

-----Original Message-----
From: owner-tme10@xxxxxxxxxxxxxxxx
[mailto:owner-tme10@xxxxxxxxxxxxxxxx]On Behalf Of John Guadagnino
Sent: Monday, February 28, 2005 2:52 PM
To: Tme10list (E-mail)
Subject: [tme10] [TEC] task in rule fails due to strange return from
wsnmptrap



We are trying to forward some TEC events to HPOV via a script using the
'wsnmptrap' command. If I run wsnmptrap from the command line, I get this odd
message: "wsnmptrap: No such service defined, using default snmp-trap port".
I don't understand what that means, nothing in the DM manuals is helpful. My
HPOV guys here just say "ignore it, it's meaningless". Even though I get that
error(?) message, the trap still succeeds and shows up in OpenView.

The TEC rule which calls the script runs successfully ... the action
successfully executes the exec_program template which runs the perl script. But
when I check task results in the TEC console (click on the blue whirligig in
the far left column) it shows 'task status' is 'FAILURE' with 'exit status' of
'255'. The message that is supposed to be sent from TEC never makes it to OV.

This same script runs from the command line without any hint of trouble ....
same script .... from command line, succeeds; from TEC, fails. I added some
'debugging' statements ... print env to log, etc. etc. ... when TEC runs it,
nothing. When I run it command line, works exactly as expected.


rules.trace snippet:

[136415] 14:37:2 -> rule forward_to_hpov
event : 0x12c4df0 of_class Action_Required
[136416] call condition
[136417] call sub_source : _1134
[136418] exit sub_source :
'hq.apps.storage.psan01.acp'
[136419] call sub_source :
'hq.apps.storage.psan01.acp' equals 'hq.apps.storage.psan01.acp'
[136420] exit sub_source :
'hq.apps.storage.psan01.acp' equals 'hq.apps.storage.psan01.acp'
[136421] exit condition
[136422] 14:37:2 call reception_action action0
[136423] call
exec_program(0x12c4df0,'/opt/Tivol/ESM/tools/SendOVO.pl','',[],YES)
[136424] exit
exec_program(0x12c4df0,'/opt/Tivol/ESM/tools/SendOVO.pl','',[],YES)
[136425] 14:37:2 exit reception_action action0
[136426] 14:37:2 => rule set gap_application_NBU



script:

#!/usr/local/bin/perl

use strict;

my $ovoHostName = "hostname goes here";
my $oidPrefix = "1.3.6.1.4.1.8088";
my $ovoCommand = "/opt/Tivoli/bin/solaris2/bin/wsnmptrap -h $ovoHostName ";
my $ovoCommand = $ovoCommand . "$oidPrefix 6 1 ";
my $ovoCommand = $ovoCommand . "$oidPrefix.0.1.1 OctetString
\"$ENV{'class_name'}\" ";
my $ovoCommand = $ovoCommand . "$oidPrefix.0.1.2 OctetString
\"$ENV{'hostname'}\" ";
my $ovoCommand = $ovoCommand . "$oidPrefix.0.1.3 OctetString \"$ENV{'msg'}\" ";

# log the event

my $now=`date`;
my $key="";
open(LOG,">>/tmp/SendOVO.log");
print LOG "$now $ovoCommand\n";
print LOG "enviro hash: ";
foreach $key(keys(%ENV)) {
print LOG qq/$key : $ENV{"$key"}\n/;
}
close(LOG);

# send the event

my $rc=`"$ovoCommand" 2>&1`;
exit 0;



=================================

... even though I'm forcing an "exit 0" at the end, TEC seems to think this
script is returning 255 ... the script is chmod 775, and the logfile is a=rw,
so there's no chance of any permissions problems. Originally the call to
wsnmptrap was a system() call, but I changed it to $rc=`` in order to trap any
possible return. No help, no difference in behavior except that at the command
line I don't see the message about 'no such service' because of course it has
been trapped in the var $rc and I'm not printing that. Anybody have any ideas
on how to further troubleshoot or fix this?

tia,

John Guadagnino
Gap Inc.













<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise