What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Change primary channel on multiple sensors at once

Votes:

0

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?

multi-edit primary-channel sensor

Created on Apr 24, 2019 4:13:57 PM



Best Answer

Accepted Answer

Votes:

1

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"

Created on Apr 25, 2019 11:52:22 AM



7 Replies

Votes:

0

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

Created on Apr 25, 2019 7:10:45 AM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

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.

Created on Apr 25, 2019 8:19:16 AM



Votes:

0

Matt,

There is a post in the KB where someone has posted what looks like a Python script.

KB9933

Let me know if you're able to accomplish this with the script.

Benjamin Day
Paessler Support

Created on Apr 25, 2019 8:48:11 AM by  Benjamin Day [Paessler Support] (1,441) 2 1



Accepted Answer

Votes:

1

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"

Created on Apr 25, 2019 11:52:22 AM



Votes:

0

Matt,

Understood, were you able to get everything changed?

Benjamin Day
Paessler Support

Created on Apr 25, 2019 1:32:25 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Yes thanks.

Created on Apr 25, 2019 1:34:16 PM



Votes:

1

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

Created on Apr 30, 2020 10:05:37 AM

Last change on May 1, 2020 4:21:58 AM by  Felix Saure [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.