Bulk modify Notification Interval on hosts and service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bseuser
Posts: 39
Joined: Thu Jul 02, 2020 2:33 am

Bulk modify Notification Interval on hosts and service

Post by bseuser »

I'm trying to modify Notification interval on 1400+ plus hosts and their respective services.

The normal method is to select the host and select the services attached to the host and save the configuration.
Looking for a method in which i can do it on 1400+ hosts and all the services attached to them.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk modify Notification Interval on hosts and service

Post by ssax »

First, edit this file:

Code: Select all

/etc/php.ini
Set this:

Code: Select all

max_input_vars = 100000
Then restart apache:

Code: Select all

systemctl restart httpd
Then you can go to Configure > Core Config Manager > Tools > Bulk Modifications Tool > Change a Single Config Option:
- Select Notification Interval from the dropdown
- Set it to what you want
- Select the Hosts under the Select Hosts button
- Select the Services under the Select Services button
- Click Save Changes and Apply Configuration
bseuser
Posts: 39
Joined: Thu Jul 02, 2020 2:33 am

Re: Bulk modify Notification Interval on hosts and service

Post by bseuser »

Then you can go to Configure > Core Config Manager > Tools > Bulk Modifications Tool > Change a Single Config Option:
- Select Notification Interval from the dropdown
- Set it to what you want
- Select the Hosts under the Select Hosts button
- Select the Services under the Select Services button
- Click Save Changes and Apply Configuration
These are the steps that i'm trying to find a workaround for, performing this manually for 1400+ hosts will be tedious and might also lead to some errors.
IPOInS
Posts: 25
Joined: Tue Jan 14, 2020 6:08 am

Re: Bulk modify Notification Interval on hosts and service

Post by IPOInS »

The API is your answer (http(s)://<YOUR_NAGIOS_SERVER>/nagiosxi/help/api-config-reference.php):

config/host and config/service are what you need. You simply submit the parameter notification_interval for each object that requires changing.

Use the GET method first to retrieve all the host objects.
Depending on which objects need changing (i.e. is it every single one or based on a matching criteria) you might need to create a filter on the results. For each object use the PUT method to submit the change to the notification_interval.
Repeat this for service. Depending on how you've got your services defined you might need to filter the services based on the host name(s) or group(s) assigned before submitting to the PUT command.
Check everything over (either by randomly selecting objects in the UI to check the interval or better by using the GET method for hosts and services again to validate the notification_interval value of each object has changed. Once you're happy, use the system/applyconfig method to apply the changes.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk modify Notification Interval on hosts and service

Post by ssax »

Thanks @IPOInS.

The instructions I sent were for the Bulk Modifications Tool which will do all 1400 in one go.
Locked