IBM Support

ObjectServer: Generic clear and nco_postmsg

Technical Blog Post


Abstract

ObjectServer: Generic clear and nco_postmsg

Body

Following on from an earlier post on nco_postmsg, I received the following request from user mirani...

 
mirani wrote:

Thank you for the post. Very helpful!
I am new to Netcool/Omnibus. I am planning to call nco_postmsg from a PERL script. If my application is running slow or if it is down, the script will then post an alert to Event List. Something similar to your command line example:

nco_postmsg “Identifier='Jazz01Down'” "Severity=5" "Summary='Jazz01 is DOWN!'"

Next time the script runs and the application is up, the alert will need to be automatically cleared. I tried lowering the Severity to zero using nco_postmsg. But the severity doesn't change only the count goes up. I am able to change the Summary and I am thinking using that with a trigger I should be able to set the Severity to clear.
What is the best way to accomplish this?

Thanks!
 
I thought I'd answer this request using a blog post as it highlights some pretty nifty ObjectServer functionality called Generic Clear, which automatically matches problem type events with corresponding resolution type events and then clears both events.  Plus it's available right out of the box!
The generic clear functionality is provided by the generic_clear trigger which can be found in the $OMNIHOME/etc/automation.sql file for those interested in taking a look.
In order for generic_clear to work, the Node, AlertKey, AlertGroup and Manager fields of the problem and resolution events must be identical.
Also the Identifier must be different otherwise the insert will be deduplicated, which is also cool functionality of the ObjectServer but not what we want here.  Finally the problem event should have Type=1 and the resolution Type=2
It would also be good practice to set the Severity of the resolution event to 1 (Not 0)

For example...

nco_postmsg “Identifier='jazzop23_server_1'” "Severity=5" "Summary='The server is slow!'" "Type=1"

Will be cleared by...

nco_postmsg “Identifier='jazzop23_server_2'” "Severity=1" "Summary='The server is slow!'" "Type=2"
 
This works because the default Node, AlertKey, AlertGroup and Manager fields all match.
By default the generic_clear trigger works every 5 seconds, so it won't be long before the events are cleared.  Once cleared another trigger delete_clears will come along and remove the events.  All of this functionality is available by default without having to perform any additional configuration.
 
Thanks for reading.

Alex :)

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"","label":""},"Component":"","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm11081989