Example. - The Netapp sensor adds Snapshot free space as the primary channel rather than something sensible like "Free space %" I know about multi edit but changing the primary channel is not something which can be done in multi edit.
What would be the best way to multi edit 100 sensors primary channels?
Article Comments
Thanks for the reply. Would there be a way to do this in the back end? If i have 100+ sensor that I need to swap from one primary sensor to another this would be an easy job with find and replace in an XML file ect. Not sure where to look for something should it exist... Any tips on how to change other then with alot of hard work?
Happy to edit beyond the "supported" means if necessary and would try on Dev environment before doing anything in production.
Apr, 2019 - Permalink
Matt,
There is a post in the KB where someone has posted what looks like a Python script.
Let me know if you're able to accomplish this with the script.
Benjamin Day
Paessler Support
Apr, 2019 - Permalink
Thanks for the tip. As per the other thread i used the powershell script at the bottom of the thread to reset the primary channel to channel 15
$username = "username"
$password = "password"
$prtgServer = "prtg.local"
$response = Invoke-RestMethod "https://$prtgServer/api/table.json?content=sensors&columns=objid,device,sensor&filter_tags=@tag(wmiphysicaldisksensor)&username=$username&password=$password"
foreach($sensor in $response.sensors) {
$result = Invoke-RestMethod "https://$prtgServer/editsettings" -Method "POST" -Headers @{ "Content-Type" = "application/x-www-form-urlencoded" } -Body "primarychannel_=15&id=$($sensor.objid)&username=$username&password=$password"
Write-Host "Modified sensor $($sensor.objid) ($($sensor.device))"
}
One line change in the code allowed to me then do the same for sensor types instead of sensor tags
$response = Invoke-RestMethod "https://$prtgServer/api/table.json?content=sensors&columns=objid,device,sensor&filter_type=netappcdotvolume&username=$username&password=$password"
Apr, 2019 - Permalink
Matt,
Understood, were you able to get everything changed?
Benjamin Day
Paessler Support
Apr, 2019 - Permalink
Hi,
as i had the same problem for NetApp Volume Sensors i took a look into the Raw values and found a way to change them fast & easy.
- Get the Raw Value you need - in this case it´s the primarychannel_
- gather the Sensors you want to change and fire :)
Get-Sensor -Id xxxx | Get-ObjectProperty -Raw $sensor = Get-Sensor -Name '*NetApp Volume*' $sensor | Set-ObjectProperty -RawProperty primarychannel_ -RawValue "15" -Force
Hope that helps
Apr, 2020 - Permalink
Matt,
Unfortunately, we do not have the ability to change the Primary Channel via Multi-Edit at this time.
If you would like to suggest this for a feature request, please follow the link below.
How Can I Propose New Features or Sensors for PRTG?
Benjamin Day
Paessler Support
Apr, 2019 - Permalink