Page 1 of 1

NagiosXI API system/scheduleddowntime author parameter

Posted: Thu Apr 11, 2019 5:15 am
by wbaars
Since we upgrade our Nagios XI to 5.5, I'm trying to use the API to set scheduleddowntime.

I can schedule a downtime (via Powershell) correctly by using an API Key, but when I use the API Key from a special created admin account, and set the "author" parameter, the author for the downtime (in the webui and API) is still the user the API key belongs to.


A small piece of my Powershell code:

Code: Select all

$author = "exampleuser"

$uri = "http://$nagsrv/nagiosxi/api/v1/system/scheduleddowntime?apikey=$apikey"
$body = "author=$author&comment=$comment&all_services=1&duration=$duration&start=$starttime&end=$endtime&hosts[]=$hostname"

$downtimejson = Invoke-RestMethod -Uri $uri -Method Post -Body $body
Has anyone seen this before? Is there a way to get this working? Or am I doing something wrong?

PS: We have a licensed NagiosXI install, but cannot post in the Customer section on this forum.

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Thu Apr 11, 2019 3:27 pm
by scottwilkerson
Is "exampleuser" an actual username of a user on your system? It must match a username exactly

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Thu Apr 11, 2019 3:34 pm
by scottwilkerson
Actually looking into this, it does appear to be a bug.

I am submitting a bug report to get this resolved in a future release

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Mon Apr 15, 2019 7:08 am
by wbaars
Thanks for looking into this issue. Happy it's not my fault :)
My script retrieves the correct username from the system, the username does match.

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Mon Apr 15, 2019 7:58 am
by scottwilkerson
wbaars wrote:Thanks for looking into this issue. Happy it's not my fault :)
My script retrieves the correct username from the system, the username does match.
This should be resolved in the next release of Nagios XI

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Wed May 22, 2019 6:58 am
by wbaars
I updated last week, and verified this issue is solved in NagiosXI 5.6.1.
Thanks!

Re: NagiosXI API system/scheduleddowntime author parameter

Posted: Wed May 22, 2019 7:40 am
by scottwilkerson
wbaars wrote:I updated last week, and verified this issue is solved in NagiosXI 5.6.1.
Thanks!
Great!

Locking thread