I have wrote a PowerShell script to use the "HTTP Push Data Advanced" sensor:
$prtgresult = '<prtg> <result> <channel>Message</channel> <value>1</value> </result> <Text>This_is_the_error</Text> </prtg> ' Add-Type -AssemblyName system.web $Answer = Invoke-WebRequest ` -method "POST" ` -URI ("http://***IPof PRTG_Server***:5050/***Token***") ` -ContentType "text/xml" ` -Body ([System.Web.HttpUtility]:: UrlEncode.($prtgresult)) ` -usebasicparsing if ($answer.statuscode -ne 200) { write-warning "Request to PRTG failed" exit 1 } else { $answer.content }
I get back a message saying it matched 1 sensor but the sensor is saying "No Data" (I tried adding the HTTP Push Count with the same Token and to matched 2 sensors and I could see it in the Push Count log as picking it up) so I'm now completely stuck and I'm sure I've missed something but I can't figure out what :(
The end result should be that whenever the sensor receives the push message it triggers a "Change Notification" to alert our out of hours support team with the contents on the Text Tag.
Add comment