Page 1 of 1
Bulk modify Notification Interval on hosts and service
Posted: Mon Mar 01, 2021 8:09 am
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.
Re: Bulk modify Notification Interval on hosts and service
Posted: Mon Mar 01, 2021 7:12 pm
by ssax
First, edit this file:
Set this:
Then restart apache:
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
Re: Bulk modify Notification Interval on hosts and service
Posted: Tue Mar 02, 2021 12:42 am
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.
Re: Bulk modify Notification Interval on hosts and service
Posted: Tue Mar 02, 2021 1:43 am
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.
Re: Bulk modify Notification Interval on hosts and service
Posted: Tue Mar 02, 2021 6:40 pm
by ssax
Thanks @IPOInS.
The instructions I sent were for the Bulk Modifications Tool which will do all 1400 in one go.