NagiosXI API system/scheduleddowntime author parameter
Posted: Thu Apr 11, 2019 5:15 am
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:
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.
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
PS: We have a licensed NagiosXI install, but cannot post in the Customer section on this forum.