Page 1 of 1

Nagios XI API Notifications Disabled

Posted: Tue Mar 26, 2024 4:01 pm
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:

Re: Nagios XI API Notifications Disabled

Posted: Tue Mar 26, 2024 5:40 pm
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

Re: Nagios XI API Notifications Disabled

Posted: Thu Mar 28, 2024 3:24 pm
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

Re: Nagios XI API Notifications Disabled

Posted: Mon Apr 01, 2024 11:02 am
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"

Re: Nagios XI API Notifications Disabled

Posted: Tue Aug 27, 2024 9:07 am
by rarosswa
You rock.