What I ended up doing was creating a branch in my ruleset that looks
for a node up trap and compares it to a smartset for the node I am
monitoring. If it is there it starts the following script that produces a
NodeUp condition. The one problem was that if the node was down for lets say
1 minute instead of the 5 minutes it takes to fire the NodeDown in the rule,
the NodeUp event would appear without a NodeDown event. Since we are handing
the event to a TEK adapter via the syslog adapter, this is not an issue. The
NodeUp is a Harmless event and is basically ignored without a NodeDown to
act on. Hope this makes sense. It really seems to work good though.
Node is Up
#!/usr/bin/ksh
TWO=$2
THREE=$3
FOUR=$4
IP=`host $TWO |cut -d' ' -f3`
logger -plocal3.debug "$TWO" "$THREE""$FOUR" "UPBDC" "$IP"
_________________________________________________________
Node is Down
#!/usr/bin/ksh
TWO=$2
THREE=$3
FOUR=$4
IP=`host $TWO |cut -d' ' -f3`
logger -plocal3.debug "$TWO" "$THREE""$FOUR" "DownBDC" "$IP"
Scott Bursik
"Westphal, Raymond" <RWestphal@erac.com>
03/09/2001 03:00 PM
Please respond to IBM NetView Discussion
<nv-l@tkg.com>@SMTP@Exchange
To: IBM NetView Discussion <nv-l@tkg.com>@SMTP@Exchange
cc:
Subject: RE: [NV-L] Ruleset Question
Please let me know about your solution.
Thanks.
-----Original Message-----
From: Bursik, Scott [mailto:Scott.Bursik@fritolay.com]
Sent: Friday, March 09, 2001 2:56 PM
To: IBM NetView Discussion
Subject: RE: [NV-L] Ruleset Question
That brings up an interesting point. I am actually writing
to the
syslog and then monitoring the syslog with a TEK monitor. The time
stamp is
included as part fo the syslog daemon so its already there.
Interesting.......now to ponder.
Thanks,
Scott Bursik
"Westphal, Raymond" <RWestphal@erac.com>
03/09/2001 02:12 PM
Please respond to IBM NetView Discussion
<nv-l@tkg.com>@SMTP@Exchange
To: IBM NetView Discussion <nv-l@tkg.com>@SMTP@Exchange
cc:
Subject: RE: [NV-L] Ruleset Question
I'm sorry - I hadn't thought of it that way.
I suppose you could have a node down create an associated
txt file
containing some timestamp. Perhaps using an epoch time. Perl
will do
that
for you with the command perl -e "print localtime".
Then the node up would occur and check for the file created
by the
node
down. Then run some math against the file contents and the
current
epoch
time. Make sure to cat /dev/null the file created by the 1st
node
down.
How about that?
Ray.
-----Original Message-----
From: Bursik, Scott [mailto:Scott.Bursik@fritolay.com]
Sent: Friday, March 09, 2001 1:56 PM
To: IBM NetView Discussion
Subject: RE: [NV-L] Ruleset Question
Thanks for your answer.
I understand where you are coming from, and that
will work
great for
sending the trap after the node has been down for 5 minutes
and
resets it
before the 5 minutes. You could then run a script or forward
after
the Reset
on Match node. That is all really clear. The question is,
how would
you run
a script if the node comes back up after the 5 minute
period, but
not
before?
Scott Bursik
"Westphal, Raymond" <RWestphal@erac.com>
03/09/2001 01:13 PM
Please respond to IBM NetView Discussion
<nv-l@tkg.com>@SMTP@Exchange
To: IBM NetView Discussion
<nv-l@tkg.com>@SMTP@Exchange
cc:
Subject: RE: [NV-L] Ruleset Question
We use a ruleset that has node down trapd to input 1
on a
Reset On
Match.
Input 2 on the Reset on Match has a node up trap as
the
resetting
event. The
Reset on Match uses the Origin for comparison. Delay
time is
set to
5
minutes.
I test it by using the following script. The sleep
is a
little more
than 5
minutes. It seems to work but I'd like to see other
examples
myself.
/usr/OV/bin/nv6000_smit run_event -n'1' -e'AA_EV'
-h'tnvcorp02'
-s'N' \
-d'SIMULATE BLAH DOWN FOR MORE THAN 5
MINUTE(S). A
PAGE
SHOULD
OCCUR.'
/usr/OV/bin/nv6000_smit run_event -n'1' -e'NDWN_EV'
-h'blah.blah.com' -s'N'
-d'This is a test.'
sleep 303
/usr/OV/bin/nv6000_smit run_event -n'1' -e'NUP_EV'
-h'blah.blah.com'
-s'N'
-d'This is a test.'
Ray.
-----Original Message-----
From: Scott.Bursik@fritolay.com
[mailto:Scott.Bursik@fritolay.com]
Sent: Friday, March 09, 2001 11:51 AM
To: nv-l@tkg.com
Subject: [NV-L] Ruleset Question
NetView 6.0.1 AIX 4.3.3
I am attempting to create a rule and perhaps I am
making
harder than
it
needs to
be. I have a smartset that contains node X when its
IP
status is
anything
but
critical. I have another smartset that contains node
X when
its IP
Status is
Critical. The node can only be in one smartset at
any given
time. I
want to
run
a script that I have written when the node has been
down for
5
minutes and
do
nothing if it comes back up within the 5 minutes. If
it
comes back
up after
the
5 minutes I need to run another script that tells me
the
node is
back up.
Thanks in advance
Scott Bursik
_________________________________________________________________________
NV-L List information and Archives:
http://www.tkg.com/nv-l
_________________________________________________________________________
NV-L List information and Archives:
http://www.tkg.com/nv-l
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
|