If you are trying to create an EXE/Script Advanced sensor within PRTG that contains this information, the easiest way to extract this from PRTG is with PrtgAPI via the Get-PrtgStatus cmdlet
PS C:\> Get-PrtgStatus
Version : 18.1.38.11958
NewLogs : 1
NewAlarms : 0
Alarms : 1
AcknowledgedAlarms : 1
PartialAlarms : 0
UnusualSensors : 1
UpSensors : 21
WarningSensors : 1
...
You can store the result of Get-PrtgStatus in a variable and then turn each property you care about into a channel (which you should obviously do with PrtgAPI.CustomSensors :P)
$status = Get-PrtgStatus
Prtg {
Result {
Channel "Up"
Value $status.UpSensors
}
Result {
Channel "Down"
Value $status.DownSensors
}
Result {
Channel "Alarms"
Value $status.Alarms
}
}
Output:
<Prtg>
<Result>
<Channel>Up</Channel>
<Value>199</Value>
</Result>
<Result>
<Channel>Down</Channel>
<Value />
</Result>
<Result>
<Channel>Alarms</Channel>
<Value>29</Value>
</Result>
</Prtg>
By specifying the -Verbose argument to any PrtgAPI cmdlet you can see the URL it generates to retrieve the specified data.
I'm not sure why you would be getting object not found unless your user account potentially has limited permissions on your system
If Get-PrtgStatus also returns object not found, you can retrieve the information returned by gettreenodestats.xml via the Get-SensorTotals cmdlet
Add comment