Page 1 of 1
Admin permissions needed for API downtime
Posted: Tue Sep 14, 2021 3:15 am
by optionstechnology
The ability to add scheduled downtime via the API is limited to full admin accounts
But normal non-admin users have the ability to set downtime via the front end
Can we get the permissions changed on this function in the API?
I frequently have to grant access to 3rd parties to allow them to programmatically downtime their services and the only way I can do this is to give them full admin access
Re: Admin permissions needed for API downtime
Posted: Tue Sep 14, 2021 2:48 pm
by pbroste
Hello @optionstechnology
Thanks for reaching out on sending downtime via API.
I ran the test command to schedule downtime via API using two 'admin users' using API keys associated and find that the command successfully completed in both cases.
Code: Select all
curl -XPOST "https://xxx.xxx.xxx.xxx/nagiosxi/api/v1/system/scheduleddowntime?apikey=AEiMFttHuQRqWEDbqgXYelB6GPCakE3F7i6CKQsNIMoAS9Pcol3eE3Ohe5fjYUGH&pretty=1" -d "comment=Test downtime creation&start=1631647944&end=1631655144&hosts[]=localhost" -k
{
"success": "Schedule downtime command(s) sent successfully.",
"scheduled": {
"hosts": [
"localhost"
]
}
}
[root@localhost ~]# curl -XPOST "https://xxx.xxx.xxx.xxx/nagiosxi/api/v1/system/scheduleddowntime?apikey=iIIcpAegUHQqa0QqOKk9Cn8LXPE7rDEEANWriIscHnVUFVe3S4Z38bE5Y7FJE8rL&pretty=1" -d "comment=Test downtime creation&start=1631647944&end=1631655144&hosts[]=localhost" -k
{
"success": "Schedule downtime command(s) sent successfully.",
"scheduled": {
"hosts": [
"localhost"
]
}
}
That leads me to my next question, what Nagios XI version are you on?
Also, what do you see for "authorizated_for_configuration_information" in cgi.cfg?
Code: Select all
grep -Eir 'authorized_for_configuration_information' /usr/local/nagiosxi/nom/checkpoints/nagioscore/*/cgi.cfg
- I see listed: =nagiosadmin,nagiosadmin,myaliasid
Thanks,
Perry