Page 1 of 1

Nagios XI Rest API to disable event handlers

Posted: Tue Jun 25, 2019 8:11 am
by FrontlineIT
Good morning,

I'm starting to look into the Nagios XI Rest API that's available so that I can disable/enable event handlers in Nagios XI. I was wondering if I could get some assistance with this and if there are there any Powershell script examples for disabling/enabling event handlers in Nagios XI using the Rest API?

Thanks ahead of time

Re: Nagios XI Rest API to disable event handlers

Posted: Tue Jun 25, 2019 12:26 pm
by lmiltchev
You could submit a core command to disable event handlers via the REST API in Nagios XI. See the example below:

Code: Select all

# curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=xxx" -d "cmd=DISABLE_EVENT_HANDLERS"
{"cmd":"DISABLE_EVENT_HANDLERS","success":"Command submitted"}
Verifying that event handlers are disabled in the GUI:
example01.PNG
https://assets.nagios.com/downloads/nag ... mand_id=48

You can also enable event handlers by running:

Code: Select all

# curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=xxx" -d "cmd=ENABLE_EVENT_HANDLERS"
You can view the REST API documentation under the Help menu in Nagios XI.

Hope this helps.