Skip to content

Latest commit

 

History

History

copy-PRTGSensor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Script to copy/clone one or multiple sensors to one or multiple devices.

Limitations is max 2500 sensors.

Tested on PRTG 19.4.54.1506

One table to hold all PRTG API keys

$Global:APIkeys = [PSCustomObject]@{
        GetAllDevices = 'api/table.xml?content=devices&output=csvtable&columns=objid,device,host&count=2500&id={0}'
        GetDeviceSensor = 'api/table.xml?content=sensors&output=csvtable&columns=objid,device,sensor,status&id={0}'
        DuplicateSensor = 'api/duplicateobject.htm?id={0}&name={2}&targetid={1}' #SourceID, NewName, TargetID
        Resume = 'api/pause.htm?id={0}&action=1'
        Pause = 'api/pause.htm?id={0}&action=0'
    }

Example

    PS C:\>.\copy-PRTGSensor.ps1 -PRTGHost 'https://prtg.westeurope.cloudapp.azure.com/' -UserName apiadmin -Passhash 0123456789  -SourceSensorID 1200,1201 -TargetDeviceID 8001,8002 -Verbose

Output from script

SourceSensor Success TargetDevice
Microsoft Hyper-V Network Adapter True Server1
Microsoft Hyper-V Network Adapter True Server2
SNMP Traffic False Server1
SNMP Traffic True Server2