Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Better default temperature sensor limits #7754
DO NOT DELETE THIS TEXT
If you would like to test this pull request then please run:
This pull request contains two patches to improve temperature sensor discovery.
One changes the default temperature sensor limits from scaled to static. Before this patch, the default temperature sensor limits were 70% through 160% of the current value at time of discovery. At 20C this resulted in a pretty useful range of 14-32C. However, for devices in spaces with lower temperatures, 3C for example, it set default temperature limits of 2.1-4.8C. At negative temperatures, the limits flip flop! This has nothing to do with the temperature specification of the device and for values near zero it causes alert flapping. My solution is to make the defaults static (yet relative), rather than scaled, so that single digit temperatures have ranges just as broad as double digit temperatures:
The other patch adds defaults for Mikrotik RouterOS hardware. A quick survey of Mikrotik hardware shows that most devices are rated for or close to -40C through 70C.
Rather than let LibreNMS choose defaults for these based on the temperature at the time of discovery, I've hardcoded the operating temperatures specified in the Mikrotik data sheets.