I was reading this...
viewtopic.php?t=31681
...and I was wondering if we could use the API instead of editing files directly.
curl -XGET "http://(xi-dns-name)/nagiosxi/api/(version)/system/status?apikey=(mykey)&pretty=1"
Would be the command to list the system status, where I can see the notifications value. I cannot add a "notifications_enabled" in there to get just this value without getting an API error so it makes me think this functionality is not in the Nagios XI API.
Is this true? Is editing the file still the best way?
Thank you
Nagios XI API Notifications Disabled
Re: Nagios XI API Notifications Disabled
Thanks for reaching out @rarosswa,
You can look into sending a core command with the API.
https://[Your XI IP address or destination]/nagiosxi/help/api-system-reference.php#system-core-command
You can look into sending a core command with the API.
https://[Your XI IP address or destination]/nagiosxi/help/api-system-reference.php#system-core-command
Re: Nagios XI API Notifications Disabled
Do you have any more direction you can help me with? I ran an API command to see all core commands and I didn't see anything related to notifications.
Thanks,
rarosswa
Thanks,
rarosswa
Re: Nagios XI API Notifications Disabled
Sure thing, if you look here there is an external command for disabling notifications.
So the API call would look like
So the API call would look like
Code: Select all
curl -XPOST "http://[IP]/nagiosxi/api/v1/system/corecommand?apikey=[key]" -d "cmd=DISABLE_NOTIFICATIONS"