-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newdevice: APC Environmental monitoring units #5140 #5356
Conversation
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
$descr = $temp['emsProbeStatusProbeName']; | ||
$low_limit = $temp['emsProbeStatusProbeMinHumidityThresh']; | ||
$low_warn_limit = $temp['emsProbeStatusProbeLowHumidityThresh']; | ||
$high_limit = $temp['emsProbeStatusProbeMaxHumidityThresh']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The device I tested against doesn't send any info back for:
emsProbeStatusProbeMaxHumidityThresh
emsProbeStatusProbeMinHumidityThresh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it not then just auto calculate?
foreach ($emu2_temp as $id => $temp) { | ||
if (isset($temp['emsProbeStatusProbeHumidity']) && $temp['emsProbeStatusProbeHumidity'] > 0) { | ||
$index = $temp['emsProbeStatusProbeIndex']; | ||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.3.' . $index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I belive this should be .1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well spotted, updated now
$index = $temp['emsProbeStatusProbeIndex']; | ||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.3.' . $index; | ||
$descr = $temp['emsProbeStatusProbeName']; | ||
$low_limit = fahrenheit_to_celsius($emu2_temp_scale, $temp['emsProbeStatusProbeMinTempThresh']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The device I tested against doesn't send any info back for:
emsProbeStatusProbeMaxTempThresh
emsProbeStatusProbeMinTempThresh
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
Disco: http://pastebin.com/2hgQtvVA To sum up, missing min/max messes up the thresholds, polling doesn't reflect the Fahrenheit conversion. |
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
Forgot to push this last night. Added a function to set the default value to null based on the minimum we expect so if none of the thresholds are valid (i.e 0 according to your output) then we default to null so they are excluded. The Fahrenheit was fixed in another commit but you were on the older one hence it didn't work for you. |
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
bump |
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
fixed rebase. |
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
@last thing: Other than that I think we are good to go! |
Thanks, I've moved set_null to inside discover_sensor now so any invalid high/low limits will be nulled out. |
Auto-Deploy finished, Test PR at http://5356.ci.librenms.org or https://5356.ci.librenms.org |
The inspection completed: 3 updated code elements |
Still an issue, you are aware that it was Humidity that was wrong, right? |
Yes but the call is now in discover_sensor() so cleans anything. Up what's actually wrong and where's the debug on the latest commit? |
Can we look at merging this. The issue for @Rosiak is not from this PR, defaults for humidity sensors with no thresholds are 70/70 |
DO NOT DELETE THIS TEXT
Please note
Fixes: #5140
Few things.
These devices allow users to specify the data is in Fahrenheit rather than Celsius so I've added a function to convert.
The includes/polling/sensors/X/ folders were named wrong so have been moved. They don't follow the plural like disco but use the name registered in discover_sensor() which is the singular!
Added a pre-cache for sensor polling.