Nagios XI API Notifications Disabled

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
rarosswa
Posts: 4
Joined: Thu Mar 01, 2018 2:29 pm

Nagios XI API Notifications Disabled

Post by rarosswa »

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

:arrow:
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios XI API Notifications Disabled

Post by danderson »

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
rarosswa
Posts: 4
Joined: Thu Mar 01, 2018 2:29 pm

Re: Nagios XI API Notifications Disabled

Post by rarosswa »

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
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios XI API Notifications Disabled

Post by danderson »

Sure thing, if you look here there is an external command for disabling notifications.

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"
Post Reply