how to uncheck RECOVERY notification (bulk mode)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

how to uncheck RECOVERY notification (bulk mode)

Post by zaji_nms »

Dear Expert

In our case , where there is thousands of interfaces (5000+ links are there), we want only DOWN alert if Host goes down and CRITICAL if its related to Bandwidth (Service), how can be done via bulk mode?

Currently if HOST UP/DOWN , notification are generating, we want one notification if its DOWN
same way, if Service is having WARNING / CRITICAL condition, there is notification, we want only if its CRITICAL.

Again, if HOST = DOWN, then only there should be Notification (Email)
if SERVICE = CRITICAL then only there should be Notification (Email)

Please note need to do changes in BULK MODIFICATION (or any other alternate way), not via single single changes per Host , per Service

Regards
Zajil NMS
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: how to uncheck RECOVERY notification (bulk mode)

Post by mp4783 »

It's not completely clear here what you want to do. You are discussing the use of a bulk modification and what appears to be event handlers. These are different things in my opinion.

If you want to make bulk changes, it depends on whether or not you want the changes to be permanent. If you just want to change the "state" of a configuration in the running instance of Nagios, then use external commands. This URL shows you how to do this: http://old.nagios.org/developerinfo/ext ... mit=Update. If you couple that with a shell script, you can loop through your servers and make changes.

If you want a specific thing to happen when a specific set of circumstances occur, then you may have to establish dependencies, which I'm not really familiar with, or use event handlers. I'm not going to discuss the use of either of these here.

Bulk modification can be done either through the Nagios XI GUI bulk modification tool for a limited number of configuration items. If that doesn't suit your needs, then you will need to generate configuration items to be imported into Nagios XI. For example, if you create an event handler that processes the logic described below and wanted it applied to thousands of service, then you could try the following.

I would strongly urge you to backup your entire /usr/local/nagios/etc/services directory to a separate location before proceeding.

1) Create the event handler command script and place it in the /usr/local/nagios/libexec/eventhandlers directory, assigning the proper ownership and privileges.

2) In the Nagios GUI, create the command to act as an event handler, making sure to set "Command Type" to "misc command"

3) Save the new command

4) Take one services you want the event handler assigned to and assign it, setting options as needed

5) Save the updated service check

6) Apply the changes to Nagios

7) In /usr/local/nagios/etc/services, examine the service configuration file for the configuration where you added the event handler. Look for the event handler directives inserted by Nagios, this is what you need to use in the following steps.

8) Create a copy (not the backup you should have made before starting) of the /usr/local/nagios/etc/services directory and all of the files within it

9) Working in the copied directory, you will need to create a script (or execute commands) to insert the directives you found in step 7 into the service configuration stanza for the service you're interested in each service configuration file you're interested in. The following would be an example of such an insertion.

event_handler my_event_handler
event_handler_enabled 1

10) Copy all of the modified files to /usr/local/nagios/etc/import

11) Change directories to /usr/local/nagios/nagiosxi/scripts

12) Execute ./reconfigure_nagios.sh

You will then have to wait for it to import the new configurations. It should simply update the existing service configuration files to include the event handler directives. If you have existing event handlers, look at those service configuration files for examples of what you need to do.

WARNING!!!! You should be aware that importing a large number of changes at one time can damage Nagios. You should test the preceding with a few files to assure yourself that it worked as required. My experience indicates you should limit the number of service changes your are attempting to between 50 and 100 until you are sure you can increase them.

The preceding assumes you don't have service groups where you could apply these changes versus performing this on individual configuration files.

Best of luck.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: how to uncheck RECOVERY notification (bulk mode)

Post by lmiltchev »

@zaji_nms
Each user can set his/her notification options, for example:
example01.PNG
You can set these as "default" for all/some users via the "Notification Settings Management" page in Nagios XI Enterprise Edition.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked