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

ewc: more WirelessSensors and processor/mempools support #8294

Merged
merged 3 commits into from Mar 5, 2018

Conversation

Projects
None yet
3 participants
@trs80
Copy link
Contributor

trs80 commented Feb 25, 2018

Errors, NoiseFloor, RSSI, SNR and Utilization WirelessSensors
processor/mempools support using existing enterasys code

DO NOT DELETE THIS TEXT

Please note

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

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

public function discoverWirelessFrequency()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'apRadioStatusChannel', array(), 'HIPATH-WIRELESS-HWC-MIB');
$ap_interfaces = $this->getCacheByIndex('ifName', 'IEEE8021-BRIDGE-MIB');

This comment has been minimized.

@murrant

murrant Feb 26, 2018

Member

IEEE8021-BRIDGE-MIB does not contain ifName.
Probably try to avoid fetching again unless you don't have the data

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Feb 26, 2018

Looks great. Just one item about ifName.

Something like this:

$ifName = array_column(dbFetchColumn("SELECT ifIndex,ifName FROM ports WHERE device_id=?", $this->getDeviceId()), 'ifName', 'ifIndex');
@trs80

This comment has been minimized.

Copy link
Contributor Author

trs80 commented Feb 26, 2018

Hmm, "$this->getDeviceId() is of type integer, but the function expects a array." I'm still getting data though.

@trs80

This comment has been minimized.

Copy link
Contributor Author

trs80 commented Feb 27, 2018

Some of the sensor OIDs (RSS and SNR) can return -100 when there's no clients associated, is it possible to handle this in the WirelessSensor code somewhere so that no data is recorded?

BTW LibreNMS/OS/Ceraos.php has lots of $ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Feb 27, 2018

Yeah, that is fine. But I would like to find a solution in the future.

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Feb 27, 2018

Oh and you need to wrap device id in an array. Typed that off the top of my head.

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Feb 28, 2018

That won't work either. We don't like inter-module dependencies.

It will have to check for data then fall back to snmp. Just put it back to what you had before (using the proper IF-MIB) and we can update all similar calls with some common code later. Sorry to waste your time, sometimes I think out loud.

@trs80 trs80 force-pushed the trs80:patch-7 branch from 6ebf14e to 668982c Feb 28, 2018

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Feb 28, 2018

@scrutinizer-notifier

This comment has been minimized.

Copy link

scrutinizer-notifier commented Mar 1, 2018

The inspection completed: 5 new issues, 6 updated code elements

@murrant murrant merged commit 6c3473a into librenms:master Mar 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

inetAnt added a commit to criteo-forks/librenms that referenced this pull request Mar 19, 2018

ewc: more WirelessSensors and processor/mempools support (librenms#8294)
* Add Errors, NoiseFloor, RSSI, SNR and Utilization Wireless Sensors for ewc

* Enable processor/mempool support for ewc using existing enterasys implementation

* Add test data
@lock

This comment has been minimized.

Copy link

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

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.