Skip to content
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

Add check for differently named Cisco Power sensor #5119

Merged
merged 2 commits into from Dec 7, 2016

Conversation

Projects
None yet
4 participants
@geordish
Copy link
Contributor

commented Dec 6, 2016

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Fix for #5106

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 6, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 6, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

@geordish

This comment has been minimized.

Copy link
Contributor Author

commented Dec 6, 2016

@laf @murrant @Rosiak @paulgear etc. The fix I've proposed is probably pretty bad, and going to break other stuff. Got any ideas about how we should do this properly?

Quick summary.
in includes/polling/functions.php around line 46, various files are included, some of which set $sensor_state using the current value of $sensor_state. $sensor_state hasn't been set at this point.

$sensor_state then gets set immediately afterwards.

One thought I have is changing this section of code to be:

if (file_exists('includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php')) {
       require_once 'includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php';
} else {
       $sensor_value = trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid']]));
}

Then modifying each of the includes to act upon $snmp_data[$sensor['sensor_oid']], rather than $sensor_data.

Thoughts?

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 6, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Copy link

commented Dec 6, 2016

The inspection completed: 1 new issues

@geordish geordish force-pushed the geordish:issue-5106 branch 4 times, most recently from a721b30 to 69348d1 Dec 7, 2016

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 7, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

2 similar comments
@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 7, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 7, 2016

Auto-Deploy finished, Test PR at http://5119.ci.librenms.org or https://5119.ci.librenms.org

@laf laf added the Bug 🐞 label Dec 7, 2016

@laf laf merged commit e67572c into librenms:master Dec 7, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

murrant added a commit to murrant/librenms that referenced this pull request Dec 8, 2016

VimCommando added a commit to VimCommando/librenms that referenced this pull request Jan 4, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.