I tried to create two different custom sensors: one was "SSH SCRIPT ADVANCED" and second was "REST CUSTOM" and can't found the method to display values of bandwidth and size channels correctly (in MB/s and MB).
As I understand there are four tags in xml config for this: "Unit", "SpeedSize", "VolumeSize" and "SpeedTime". For example, if I need to display values in "MB/s" - "Unit" must be set to "BytesBandwidth", "VolumeSize" to "MegaByte" and "SpeedTime" not needed (because 1s by default). But it is not work. I alredy tried to specify all these tags in various combinations, but always get simple " /s" as unit.
Moreover, I found strange behaviour in charts for channels where I defined "mode" as "Difference": in table all units displays as " /s", but in charts "/s" is added to every next channel (i.e. " /s/s", " /s/s/s", " /s/s/s/s").
Next question - I can't found the way to display value (size) in MB. My sensor provides data in bytes, I tried to set "Unit" as "BytesFile" and "VolumeSize" as "MegaByte" or "Mega" without any success - sensor still display bytes in bytes.
Now I define all sensors as "Custom", but I see in old forum threads, that some years ago this syntax was work correctly.
And maybe anyone know definition (and difference) of predefined unit types?
Article Comments
I'm using newly created configs. Did some tests to clarify API documentation. 1. Default unit sizes (name, volume, speed):
SpeedDisk: " ", " /s"
SpeedNet: " ", " /s"
BytesBandwidth: "KByte", "kbit/s"
BytesMemory: "MByte", "MByte/s"
BytesDisk: "MByte", "MByte/s"
BytesFile: "Byte", "Byte/s"
2. "Speed" column appears only if Channel mode set to "Difference".
3. "Volume" setting "KiloByte" work only with these Units:
- SpeedDisk
- SpeedNet
- BytesBandwidth
3.1. "Volume" setting "TeraBit", "Giga" work only with these Units:
- SpeedDisk
- SpeedNet
4. "Speed" setting "Gigabyte", "GigaBit", "Tera" work only with these Units (in "Speed" column):
- SpeedDisk
- SpeedNet
5. If you add "Speed" setting to the channel with "Absolute" mode it will display "Kbyte/s" in "Volume" column instead of absolute unit sizes: "SpeedDisk" "SpeedNet"
6. If you add more than one channel with Unit = "Custom" and Mode = "Difference" you will see fancy bug on the graph - it will displays in legend area "/s", "/s/s", "/s/s/s" for every custom channel.
Conclusion:
- If you need channel with high level of customization through "Speed" or/and "Volume" setting - choose "SpeedDisk" or "SpeedNet". All other unit types does not respond to the Speed and Value settings.
- If your sensor returns speed as absolute value you need to set Unit = "SpeedDisk", "Speed" and "Volume" to the apropriate unit size ("MegaByte" for example) - result will be displayed as "Mbyte/s".
Mar, 2018 - Permalink
I'll review the /s/s/s issue - other than that, is the issue resolved?
Kind regards,
Stephan Linke, Tech Support Team
Mar, 2018 - Permalink
Could you provide me with the complete XML output that causes the units to have /s appended indefinitely? Thanks! :)
Kind regards,
Stephan Linke, Tech Support Team
Mar, 2018 - Permalink
Here is the Custom REST template:
{ "prtg": { "result": [ { "channel": "17 - " , "value": $.controllerStats[0].readBytesTotal, "mode": "Difference", "float":"0", "Unit": "Custom", "CustomUnit": "IOPS" }, { "channel": "18 - " , "value": $.controllerStats[0].readBytesTotal, "mode": "Difference", "float":"0", "Unit": "Custom", "CustomUnit": "IOPS" }, { "channel": "19 - " , "value": $.controllerStats[0].readBytesTotal, "mode": "Difference", "float":"0", "Unit": "Custom", "CustomUnit": "IOPS" } ] } }
Mar, 2018 - Permalink
Thanks for that. It's seemingly indeed related to another bug (i.e. expanding it). Thanks for reporting, we'll make sure to address this in a future release. Unfortunately, I don't have a workaround at hand :/
Kind regards,
Stephan Linke, Tech Support Team
Mar, 2018 - Permalink
Note that you'll need to configure those before the channel is actually created (as the data type is only read upon channel creation). Or does it also appear with a newly created sensor? Did you configure the channel unit settings at device level already?
Kind regards,
Stephan Linke, Tech Support Team
Mar, 2018 - Permalink