Nagios XI - enable all notifications
Nagios XI - enable all notifications
All host and service notifications are individually disabled. In Core, I would just run sed from the command line and modify all the service and host config files. In XI, those changes don’t stick. Is there any way to do this same thing via MySQL or otherwise without going through each host and service one-by-one? Thanks!
Re: Nagios XI - enable all notifications
There may be other (better) ways of doing this, but the only thing I can come up with at this time is to use the REST API and submit a core command. For example, you could set up a hostgroup, named "allhosts", and add all your hosts to it as members. You can also set up a servicegroup, named "allservices", and add all services to it as members. Then, you should be able to enable all hosts/service notifications by running something like this:
You can review the REST API documentation about submitting core commands by going to the Help menu > System Reference > POST system/corecommand.
You can view the external nagios commands here:
https://old.nagios.org/developerinfo/ex ... ndlist.php
Hope this helps.
Code: Select all
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=LTltbjobR0X3V5ViDIitYaI8hjsjoFBaOcWYukamF7oAsD8lhJRvSPWq8I3PjTf7" -d "cmd=ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;allhosts"
{"cmd":"ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;allhosts","success":"Command submitted"}
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=LTltbjobR0X3V5ViDIitYaI8hjsjoFBaOcWYukamF7oAsD8lhJRvSPWq8I3PjTf7" -d "cmd=ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS;allservices"
{"cmd":"ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS;allservices","success":"Command submitted"}
You can view the external nagios commands here:
https://old.nagios.org/developerinfo/ex ... ndlist.php
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI - enable all notifications
Yikes! I was hoping for something a little more straight forward like a SQL statement, but if the API is the only route then that is what I'll do. Thanks!
Re: Nagios XI - enable all notifications
We usually do not recommend modifying stuff directly into the db as this can be dangerous... Yes, it is possible but using the REST API is safer (and supported).
Let us know if it is OK to lock this thread. Thanks!
Let us know if it is OK to lock this thread. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI - enable all notifications
Understood. Yes, you can lock the thread. Thanks again for your help!