InterfaceUp Event with AlarmPoint Integration (283 Views)
Reply
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 1 of 13 (283 Views)

InterfaceUp Event with AlarmPoint Integration

I currently have AlarmPoint integrated with the NNMi and I am trying to ensure all notifications we need will be sent. We have it configured so that we are receiving InterfaceDown alerts, but we would like to also receive InterfaceUp alerts to know it is back up. The problem is that there is not a seperate event in the NNMi for InterfaceUp, but instead I believe that the InterfaceDown event is just simply closed by an InterfaceUp attribute according to the correlation notes - example below:

Incident duration: 4 minutes, 328 ms
Time incident detected: Tuesday, May 4, 2010 6:01:20 PM CDT.
Time incident resolved: Tuesday, May 4, 2010 6:05:20 PM CDT.
Incident cancelled by: InterfaceUp.

Anyone have any idea on what options I have to send alerts when the interface comes back up?

P.S. - This seems to be the case for AddressNotResponding as well... no AddressResponding event.


Please use plain text.
Frequent Advisor
CherryL_1
Posts: 34
Registered: ‎07-23-2009
Message 2 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

I had the same issue and have worked around it by generating an alarmpoint event on a Lifecycle status of 'Closed' as well as 'Registered'. This needs to be configured in the nnmi.properties file.

I also then needed to use the Developer IDE to edit our email notifications, otherwise the registered and closed emails were identical.

I did this by editing the presentation script to add the following -

IF ($event.lifecycleState == com.hp.nms.incident.lifecycle.Registered)
$State = OPENED
ENDIF
IF ($event.lifecycleState == com.hp.nms.incident.lifecycle.Closed)
$State = CLOSED
ENDIF

I then use the $State variable in the email title and body text so do something like this -

Subject : NNMi Subscription:Network node alerts CRITICAL Alert NodeDown on ABC Status OPENED

Subject : NNMi Subscription:Network node alerts CRITICAL Alert NodeDown on ABC Status CLOSED

I think this was all I had to do, but it's a while since I did the work. Hopefully I haven't missed out any steps.
Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 3 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Hi CherryL,

Thanks for the response! It helps a lot to know where I can edit the email subject and other stuff with the PRESENTATION script.

I like what you did to get the emails to work like you did, but I'd like to find another option to actually state NORMAL and InterfaceUp for the subject and to do this for InterfaceDown, ConnectionDown and AddressNotResponding events.

This is something I am considering... does the logic look correct?

# Specify subject line content.
IF ($event.name == InterfaceDown) AND ($event.lifecycleState == com.hp.nnms.incident.lifecycle.Closed)
$subject = "AlarmPoint (NNMi) - " & NORMAL & " " & InterfaceUp & " on " & $event.sourceNodeName
ENDIF
IF ($event.name == ConnectionDown) AND ($event.lifecycleState == com.hp.nnms.incident.lifecycle.Closed)
$subject = "AlarmPoint (NNMi) - " & NORMAL & " " & ConnectionUp & " on " & $event.sourceNodeName
ENDIF
IF ($event.name == AddressNotResponding) AND ($event.lifecycleState == com.hp.nnms.incident.lifecycle.Closed)
$subject = "AlarmPoint (NNMi) - " & NORMAL & " " & AddressResponding & " on " & $event.sourceNodeName
ENDIF
ELSE $subject = "AlarmPoint (NNMi) - " & $event.severity & " " & $event.name & " on " & $event.sourceNodeName

What I would be trying to accomplish would be to have it recognize when an InterfaceDown/ConnectionDown/AddressNotResponding event changes its lifecycle state to Closed then it should use a different email subject which would use a static variables of NORMAL and InterfaceUp/ConnectionUp/AddressResponding simply for the sake of the email it will send.
Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 4 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Updated logic on my script I plan to try and use... sorry!

# Specify subject line content.
$subject = "AlarmPoint (NNMi) - " & $event.severity & " " & $event.name & " on " & $event.sourceNodeName

IF ($event.name == "InterfaceDown" & $event.lifecycleState == "com.hp.nnms.incident.lifecycle.Closed")
$subject = "AlarmPoint (NNMi) - NORMAL InterfaceUp on " & $event.sourceNodeName
ELSE-IF ($event.name == "ConnectionDown" & $event.lifecycleState == "com.hp.nnms.incident.lifecycle.Closed")
$subject = "AlarmPoint (NNMi) - NORMAL ConnectionUp on " & $event.sourceNodeName
ELSE-IF ($event.name == "AddressNotResponding" & $event.lifecycleState == "com.hp.nnms.incident.lifecycle.Closed")
$subject = "AlarmPoint (NNMi) - NORMAL AddressResponding on " & $event.sourceNodeName
ENDIF
Please use plain text.
Frequent Advisor
CherryL_1
Posts: 34
Registered: ‎07-23-2009
Message 5 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Hi Brad

Your logic makes clear sense to me - so give it a go.

I find the checking in/checking out process in the Alarmpoint IDE slightly confusing but it does mean you've got a full backup of the script package if you need to rollback.

Your ideas have now tempted me to go and do a little be more 'tuning' on my alert emails!
Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 6 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

I've got the script below that I actually ended up implementing. It still isn't working, though. All the old emails are still working properly, but I'm not receiving the different emails from the IF statements like I was hoping. Seems like the problem may be that it doesn't see when the lifecycle state changes from Registered to Closed to know to send an email... only thing I can think of. Any ideas?

# Specify subject line content.

IF ($event.name == InterfaceDown & $event.lifecycleState == com.hp.nnms.incident.lifecycle.Closed)

$subject = "AlarmPoint (NNMi) - NORMAL InterfaceUp on " & $event.sourceNodeName

ELSE-IF ($event.name == ConnectionDown & $event.lifecycleState ==

com.hp.nnms.incident.lifecycle.Closed)

$subject = "AlarmPoint (NNMi) - NORMAL ConnectionUp on " & $event.sourceNodeName

ELSE-IF ($event.name == AddressNotResponding & $event.lifecycleState ==

com.hp.nnms.incident.lifecycle.Closed)

$subject = "AlarmPoint (NNMi) - NORMAL AddressResponding on " & $event.sourceNodeName

ELSE

$subject = "AlarmPoint (NNMi) - " & $event.severity & " " & $event.name & " on " &

$event.sourceNodeName

ENDIF
Please use plain text.
Frequent Advisor
CherryL_1
Posts: 34
Registered: ‎07-23-2009
Message 7 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

It might be worth double checking your nnmi.properties file just to make sure all the brackets, quotes etc are in the right place

(lifecycleState='com.hp.nms.incident.lifecycle.Registered' or lifecycleState='com.hp.nms.incident.lifecycle.Closed')

Apart from that, I would probably try changing the subject text very slightly in the ELSE statement of the script and see if it is reflected in the emails that are arriving - at least that would prove that alarmpoint is readint the current version of the script.
Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 8 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Thanks for the reply!

I just verified that my nnmi.filter is setup like you showed for the lifecyclestate. I'll give you idea a try about checking that it is using the current version of the script.

Do you know, when I check in an update the script package, do I only have to bounce the WebServer service or also the Node service?
Please use plain text.
Frequent Advisor
CherryL_1
Posts: 34
Registered: ‎07-23-2009
Message 9 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

I've never been quite sure about what to restart so I've just tested it, and you don't actually have to restart any services for script changes to take affect.

What I've just done is

Edit the script (in my case I'm actually using subscriptions so it's the subscriptionPresentation)

Right click on the script name and save

Right click on the script name and validate

Right click on the script package and checkin

Choose 'Update' on the two message to make the script the prodcution version.

Changes took effect on the next email

Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 10 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Okay, thank you!

I also just found a glaring mistake in my code.

$event.lifecycleState == com.hp.nnms.incident.lifecycle.Closed

I had two n's instead of just one. I changed these all to $event.lifecycleState == com.hp.nms.incident.lifecycle.Closed, so now hopefully the different emails will be sent.

Next on my list is to edit the email body with additional information we want to include... oh boy what a headache! Thanks again - I'll let you know if this fixed things next time Interface/Connection/Address events happen.
Please use plain text.
Advisor
Brad Stoube
Posts: 19
Registered: ‎03-28-2010
Message 11 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Still didn't work even after I fixed the typo. Hmmmm... well for now I'm going to try and set it up like you first posted with the $State = OPENED / CLOSED and see if that won't help things any.

I should probably share my nnm.filter with you as well in case there are any issues with that. If you have time, do you mind sharing yours with me as well? Thanks!

nnm.filter=(nature='ROOTCAUSE' or nature='INFO') and ( lifecycleState='com.hp.nms.incident.lifecycle.Registered' or lifecyclestate='com.hp.nms.incident.lifecycle.Closed') and (severity='CRITICAL' or severity='NORMAL') and ( name='AddressNotResponding' or name='ConnectionDown' or name='InterfaceDown' or name='NodeDown' or name='NodeUp' or name='NonSNMPNodeUnresponsive' )
Please use plain text.
Frequent Advisor
CherryL_1
Posts: 34
Registered: ‎07-23-2009
Message 12 of 13 (279 Views)

Re: InterfaceUp Event with AlarmPoint Integration

I think the problem might be the AND in your if/else-if statements.

& - string concatenation operator
&& - logical AND

I've just dug out a PDF called AP400-devguide-scriptref.pdf which I assume I downloaded from the Alarmpoint website when I first started trying to edit the emails. It's worth getting hold a copy as it covers the basics of the scripting language.


Please use plain text.
Advisor
bink19
Posts: 14
Registered: ‎03-28-2012
Message 13 of 13 (201 Views)

Re: InterfaceUp Event with AlarmPoint Integration

Hi Brad,

 

Did you ever get this resolved?  I am trying to do the same thing with NNMi 9.2 and Alarmpoint.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation