We have 2 custome sensors with powershell. One observing DHCP scopes and another checking the expiary date on certificates. These sensors work well until we change something. If we rename or delete a scope in DHCP, the sensor doesnt get any data anymore (because we identify the channels with the scopename) and sends out an alarm. Only way to get around that, is to delete and recreate the sensor. On the first run, PRTG creates all channels based on the first run and it sticks with them. Is there a solution for this in the future?
I had a look at the API, but it is not possible to create sensors these days. Only workaround is to clone another sensor. But that isnt very beautiful.
Article Comments
To clarify some more im gonna give you an example:
I have a script that reads out all DHCP scopes on the server. For example these 3 scopes showing the amount of free IP addresses as values:
channel value Scope1 5 Scope2 9 Scope3 2
On the first run, PRTG creates 3 channels with name Scope1, Scope2, Scope3. If we delete Scope3 because we dont need it anymore, PRTG sends out an alarm. If we create Scope4, PRTG will never get data from this Scope because it wasnt there when we first ran it. So you pretty much have to stick with the channels you first had. Same goes for certificates. They constantly change. New ones arent gonna get picket up by PRTG and deleted certificates are shown as error because PRTG doesnt get any data for them anymore.
it would be great to have something like a "fireNforget" sensor that doesnt keep the data for history, but just observes the current state based on the data it gets from the script.
Jul, 2016 - Permalink
Yeah, that's because channels can't be deleted actually. Your best bet is either to create a sensor for each scope or create 10 channels where only some are active and have limits set. You should be able to check if the scope exists and then set the limit accordingly using the API:
/api/setobjectproperty.htm?id=sensorid&subid=channelid&subtype=channel&name=property_name&value=x
Limitminerror and Limitminwarning are probably the values you want to set.
About the certificates - you're monitoring them using a custom sensor as well, don't you?
Probably the same solution would apply here then.
Jul, 2016 - Permalink
We already set limitminerror and warning via the powershell script in the respective xml structure. These solutions are nice workarounds, but it would be great if you could set this topic on the feature wishlist somewhere. It would be great if we could delete channels in custom sensors, and if a new channel comes in via XML values, a new channel should be created in the PRTG Gui for that aswell.
Thanks and best regards
Jul, 2016 - Permalink
It's on our wishlist but will probably never find it's way into PRTG I'm afraid :)
Jul, 2016 - Permalink
Thanks for having a look into this case and your honesty. But remember, you have the power to remind the wishlist team repetitively about this feature. Dont give up. We PRTG users trust in your ability to persuade...
Jul, 2016 - Permalink
Well, we keep trying but it's always getting postponed due to the sheer complexity :)
Jul, 2016 - Permalink
So you basically need to change the parameters of the script, once anything changes?
Jul, 2016 - Permalink