Page 1 of 1
enable all OK(green) services at once
Posted: Thu Feb 25, 2016 2:58 pm
by amit.ahuja
I have 3000+ services and some of them are disabled. Is there a way to enable all OK(green) services at once instead of manually enable one by one?
services.png
Re: enable all OK(green) services at once
Posted: Thu Feb 25, 2016 3:07 pm
by lmiltchev
Are you talking about enabling notifications on all services that are in OK state? Can you elaborate?
Re: enable all OK(green) services at once
Posted: Thu Feb 25, 2016 3:34 pm
by amit.ahuja
Yes, I want to enable alert notification for all services that are in OK state.
Re: enable all OK(green) services at once
Posted: Thu Feb 25, 2016 4:09 pm
by lmiltchev
This functionality doesn't exist in XI. I am not even sure why you would want to be notified only about services that are in "OK" state? Don't you want to be notified when there is a problem?
Anyway, if you know what services are in "OK" state, you could enable notifications for all of them "in one go" via the "Bulk Modifications Tool".
CCM->Tools->Bulk Modifications->Change a Single Config Option->Notifications Enabled=on->Select all of the services from your "OK" list (tip: hold the "Ctrl" key to select multiple services)->Add Selected->Close->Save Changes->Apply Configuration
The "Bulk Modifications Tool" is a part of
Nagios XI Enterprise edition. If you haven't purchased Enterprise yet, you can start a 60-day, fully functional trial, and get the job done.
Hope this helps.
Re: enable all OK(green) services at once
Posted: Fri Feb 26, 2016 11:08 am
by haile711
lmiltchev,
We have a case where initially we want to disable all the notification by default. When we add the services, and we want to turn on the notification for the "OK, green" status first. The "Critical" status we are still working on, we don't want to be bombarded with notifications from these services. Currently we are using the "static" directory for config all of our services therefore we could not use the "Bulk Modifications Tool" these services doesn't show up there.
Many Thanks
Hai
Re: enable all OK(green) services at once
Posted: Fri Feb 26, 2016 12:54 pm
by lmiltchev
If you are setting up some hosts+services in "static" to test them first (before importing them), you could add all of the hosts to a "test" hostgroup. Disable notifications globally in XI by going to Admin->Monitoring Engine Status, and clicking on the "Disable" actions button next to "Notifications". Log into the Nagios Core web interface:
Go to "Host Groups", then click on the "test" hostgroup (test). Then click on "Disable notifications for all services in this hostgroup" (Disable For Hosts Too: = checked), and press "Commit". You can now enable notifications globally. The hosts, members of the "test" hostgroup should have notifications disabled (+services).
Check the status of services in let's say an hour. Remove the hosts with "non-ok" services from the "test" hostgroup, then enable notifications for the whole "test" group (the remaining members should have their services in OK state).
This is just a workaround. There could be better ways for achieving the same goal. You could probably come up with some scripting solution but this is out of the scope of nagios support.