Nagios XI - enable all notifications

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
treetop
Posts: 7
Joined: Thu Sep 21, 2017 1:45 pm

Nagios XI - enable all notifications

Post by treetop »

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!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI - enable all notifications

Post by lmiltchev »

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:

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 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
treetop
Posts: 7
Joined: Thu Sep 21, 2017 1:45 pm

Re: Nagios XI - enable all notifications

Post by treetop »

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!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI - enable all notifications

Post by lmiltchev »

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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
treetop
Posts: 7
Joined: Thu Sep 21, 2017 1:45 pm

Re: Nagios XI - enable all notifications

Post by treetop »

Understood. Yes, you can lock the thread. Thanks again for your help!
Locked