Hello,
I'm writing a Python Advanced Sensor that is measuring bandwidth of a device gathering data via http. It calculates the difference of a certain value and the time elapsed between each run, returning a value that is my network speed in bytes/minute.
Here https://prtg.paessler.com/api.htm?username=demo&password=demodemo&tabid=7#toc-index-3 I found a bit of documentation about the custom sensors, and in particular I'm interested in the following parameters:
Unit=SpeedNet SpeedSize=KiloByte SpeedTime=Minute
..everything looks promising, except that the PRTG python library 'paepy' does not seems to contain the SpeedSize and SpeedTime parameters! I tried adding 'manually' theese params to ChannelDefinition.py, but the remote probe seems to ignore it, so I'm wondering if the parameters in questions are deprecated/outdated or still working.
I'd like to display my bandwidth as the "Windows Network Card" sensor does (Mbit/s), but I'm not able to reproduce it! Why?
Thanks
Article Comments
I modified 'ChannelDefinition.py' on my IDE where I imported the paepy module, then on the remote probe on C:\Program Files (x86)\PRTG Network Monitor\Python34\Lib\site-packages\paepy\ . I did not restarted the remote probe services.
Anyway, from your answer it seems that the settings are still valid, isn't it? Why the paepy library does not contain the parameters by default?
Thanks
Jan, 2018 - Permalink
Dear aventrax,
returning the unit scale factors with a custom sensor result is only rarely done, so it was not implemented in the default channel lib. If a modified ChannelDefinition.py file does not work, please create the XML (or JSON) output directly, as string, in order to print it to the console.
Jan, 2018 - Permalink
Dear aventrax,
about the ignored addition on the remote probe: Did you change the file on the remote probe as well, or on the core server only?
Jan, 2018 - Permalink