Is it possible to schedule a maintenance plan wich occurs every two weeks, three weeks, once a month, etc. in stead of every single week?
Maintenance schedule once per two weeks or more
Votes:
0
3 Replies
Votes:
1
Not by default :) You'll need to use scheduled tasks and run the following script with some parameters. Save it as Set-Maintenance.ps1 to any path you want:
param([int]$Id,[int]$Duration = 1,[string]$Unit = "Hours") $Server = "your-prtg-server-url-or-dns" $User = "your-username" $Hash = "your-passhash" $DateFormat = "yyyy-MM-dd-HH-mm-ss"; $StartDate = (Get-Date).ToString($DateFormat); switch($Unit){ "Minutes" { $EndDate = (Get-Date).AddMinutes($Duration).ToString($DateFormat); } "Hours" { $EndDate = (Get-Date).AddHours($Duration).ToString($DateFormat); } "Days" { $EndDate = (Get-Date).AddDays($Duration).ToString($DateFormat); } default { $EndDate = (Get-Date).AddHours($Duration).ToString($DateFormat); } } Invoke-WebRequest "http://$Server/api/setobjectproperty.htm?id=$Id&name=Inheritscheduledependency&value=0&username=$User&passhash=$Hash" | out-null Invoke-WebRequest "http://$Server/api/setobjectproperty.htm?id=$Id&name=maintenable&value=1&username=$User&passhash=$Hash" | out-null Invoke-WebRequest "http://$Server/api/setobjectproperty.htm?id=$Id&name=maintstart&value=$StartDate&username=$User&passhash=$Hash" | out-null Invoke-WebRequest "http://$Server/api/setobjectproperty.htm?id=$Id&name=maintend&value=$EndDate&username=$User&passhash=$Hash" | out-null
Modify the script with your server details, username and password. Create a new scheduled task that runs on the days or months you need and run it with the following parameters:
-Duration 1 -Unit Hours -Id 1234
Duration The duration as number
Unit Can be minutes,hours or days. It's hours by default.
Id The ID of the sensor, device or group you want to pause
Created on Jul 30, 2014 7:57:32 AM by
Stephan Linke [Paessler Support]
Last change on Jul 30, 2014 7:58:24 AM by
Stephan Linke [Paessler Support]
Votes:
1
Thanks for your answer. It looks like it works!
Is it already requested as a new feature in future releases of PRTG? If not, I'd like to request it right now :).
Votes:
2
I would like to add my +1 to requesting a monthly option for scheduling, rather than the current weekly only. In the meantime, I'll try using this Powershell script.
Add comment