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
Add comment