I use a number of custom sensors being served via the Advanced XML EXE sensor. I have tried passing the warning and error limits in the XML but this only applies to sensor creation. I would love to be able to set the values dynamically based on certain circumstances determined by the code. I release that may play havoc with your scheduling\error notification systems with very frequent updates but I would only have 2 or 3 bands per day and it would not be updating on every call. I know this can be worked around with multi sensors and different notification schedules but it is a long way around.
Article Comments
Hi everyone,
This is exactly what i was searching for, but not with es external script, but with the xml response.
It would be good if there is a way to set a tag <dynamicLimit>1</dynamicLimit> to tell PRTG that the limits are given dynamically from the xml.
Is there a way to integer that?
Regards
Oct, 2016 - Permalink
Hi Adrian,
Can you give me an example of how this might be useful? I might adapt what I have to include this (maybe).
I would assume something like this (pseudo code / Powershell)
$sensors = get-prtgsensors | where $_.tag -like "Dynamic1" $sensors | foreach { $sensor_id = $_.id $channels = prtgSensorChannels $sensor_id $channels | foreach{ $channel_id = $_.id Set-PRTGChannelSettings $sensor_id, $channel_id "Upper Error Limit", Get_Upper_Error_Limit($sensor_id, $channel_id) Set-PRTGChannelSettings $sensor_id, $channel_id "Upper Warning Limit", Get_Upper_Warning_Limit($sensor_id, $channel_id) } # end for each channel } #end for each sensor
I have a feeling this pseudo code is actually syntax correct :)
Of course you want to have a lookup table for the sensor/channel id limits. This would be used by the Get_Upper_Error_Limit function.
Then you need to run this code every x minutes to change the values.
--I do not see this being built in any time soon
Oct, 2016 - Permalink
Have a look at the limit scheduler by AndrewG of our forums :)
Apr, 2016 - Permalink