I found this two kb entries:
https://helpdesk.paessler.com/en/support/solutions/articles/62304-restful-one-time-maintenance-window#reply-200661
https://helpdesk.paessler.com/en/support/solutions/articles/61037-maintenance-schedule-once-per-two-weeks-or-more#reply-195796
I'd like to set the maintanence interval by api.
I run the following 3 API Requests. The Response Code was "OK" by all requests. But nothing happens. The Object (a device) of the id doesnt paused between the interval. And in History was no entry set.
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintstart&value=2020-11-30-17-30-00
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintend&value=2020-11-30-17-30-00
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintenable&value=1
By other objects (groups oder devices). It only set the maintenance end time. (i can see it in history). The result: the device paused now and not in future.
Article Comments
Hi Matthias, thank you for your help.
it fails again:
here are the response values of my test by id 18142 :
Inheritscheduledependency OK
maintenable OK
maintstart Request:
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-helper&passhash=xxxxxxxx&id=18142&id=17606&name=maintstart&value=2020-12-01-15-30-00
Result:
<prtg>
<version>20.4.64.1402</version>
<error>Die Validierung Ihrer Eingaben war nicht erfolgreich:<br/><ul><li>"Wartung startet" muss vor "Wartung endet" liegen</li></ul><br/>. Das Objekt wurde nicht geändert.</error>
</prtg>
The message is confused because i have not startet maintend.
----------------
even stranger is that my tests by 17606 are all response values "OK", but nothing is happened an nothing to see in history/log
best regards
Dec, 2020 - Permalink
Hi Tobias,
You have an error in your query. You duplicated the "id=" parameter. Please remove the duplicate id and the query should work.
Kind regards,
Matthias Kupfer - Team Tech Support
Dec, 2020 - Permalink
Sorry, I made the mistake while writing the KnowHow entry.
here is the corrext request url: https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=18142&name=maintstart&value=2020-12-02-17-10-00
and the response value
<prtg>
<version>20.4.64.1402</version>
<error>Die Validierung Ihrer Eingaben war nicht erfolgreich:<br/><ul><li>"Wartung startet" muss vor "Wartung endet" liegen</li></ul><br/>. Das Objekt wurde nicht geändert.</error>
</prtg>
Dec, 2020 - Permalink
Hi Tobias,
you will have to send the request to enable the maintenance first, otherwise you can't set the start- and end-date. You might as well have to break the inheritance for "Schedules, Dependencies and Maintenance Windows". So the order of the requests should be as following:
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=Inheritscheduledependency&value=0
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintenable&value=1
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintstart&value=2020-11-30-17-30-00
https://prtg.teamgruppe.home/api/setobjectproperty.htm?username=prtg-user&passhash=xxxxxxxxxx&id=17606&name=maintend&value=2020-11-30-17-30-00
Kind regards,
Matthias Kupfer - Team Tech Support
Dec, 2020 - Permalink