Page 1 of 1

Nagios XI Disabling Notifications via API

Posted: Tue Dec 04, 2018 4:05 pm
by madhu2852
Hi Team,

Is there a way that I can disable all notifications in nagios xi using an api call by passing the token instead of giving username and password?

The command which works fine at the moment is below:


curl -u USER:PASS "http://<NAGIOSXI>/nagios/cgi-bin/cmd.cgi?cmd_mod=2&cmd_typ=11"

I want to execute above command using an api token that is provided by nagiosxi for every user.

Thanks,
Madhu.

Re: Nagios XI Disabling Notifications via API

Posted: Tue Dec 04, 2018 4:29 pm
by scottwilkerson
See the Help -> API Docs -> System -> system/corecommand

Use DISABLE_NOTIFICATIONS passed ad the cmd

example

Code: Select all

curl -XPOST "http://192.168.5.xx/nagiosxi/api/v1/system/corecommand?apikey=API_KEY" -d "cmd=DISABLE_NOTIFICATIONS"

Command reference
https://assets.nagios.com/downloads/nag ... mmand_id=7