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: Add basic support for CradlePoint WiPipe Cellular Broadband Routers #6695

Merged
merged 11 commits into from May 31, 2017

Conversation

Projects
None yet
4 participants
@thecityofguanyu
Contributor

thecityofguanyu commented May 20, 2017

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

thecityofguanyu added some commits May 20, 2017

Add basic support for CradlePoint Ceullular Broadband Rotuers
 	new file:   html/images/os/cradlepoint.png
 	new file:   includes/definitions/wipipe.yaml
 	new file:   includes/discovery/sensors/dbm/wipipe.inc.php
 	new file:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	new file:   includes/discovery/sensors/state/wipipe.inc.php
 	new file:   includes/polling/os/wipipe.inc.php
@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 20, 2017

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

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 20, 2017

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

@laf

Please move the MIB to mibs/cradlepoint

That logo should be 32x32 max for OS logo. You can use the one you've got as html/images/logo/cradlepoint.png but you need a 32x32 for html/images/os/cradlepoint.png

Show outdated Hide outdated includes/discovery/sensors/pre-cache/wipipe.inc.php
*/
echo 'Caching WIPIPE-MIB';
$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.20992', array(), 'WIPIPE-MIB');

This comment has been minimized.

@laf

laf May 20, 2017

Member

Can you use the OID name here rather than the numerical one.

That also seems like a large walk to do.

@laf

laf May 20, 2017

Member

Can you use the OID name here rather than the numerical one.

That also seems like a large walk to do.

Show outdated Hide outdated includes/polling/os/wipipe.inc.php
*/
// Rip hardware and firmware version from sysDescr string -- example: Cradlepoint CBA850, Firmware Version 6.2.0.dd92f49
$getsysdescr = snmp_get($device, 'sysDescr.0', '-Ovqs', 'SNMPv2-MIB');

This comment has been minimized.

@laf

laf May 20, 2017

Member

sysDescr is already available as $poll_device['sysDescr']

@laf

laf May 20, 2017

Member

sysDescr is already available as $poll_device['sysDescr']

Show outdated Hide outdated includes/polling/os/wipipe.inc.php
$version = $getsysdescr[1];
$version = explode(" ", $version);
$version = $version[2];
$serial = '';

This comment has been minimized.

@laf

laf May 20, 2017

Member

You don't need to set these to null so just remove serial and features.

@laf

laf May 20, 2017

Member

You don't need to set these to null so just remove serial and features.

Show outdated Hide outdated includes/definitions/wipipe.yaml
icon: cradlepoint
discovery:
- sysObjectId:
- .1.3.6.1.4.1.20992.

This comment has been minimized.

@laf

laf May 20, 2017

Member

add:

mib_dir:
    - cradlepoint
@laf

laf May 20, 2017

Member

add:

mib_dir:
    - cradlepoint
copied: html/images/os/cradlepoint.png -> html/images/logos/cradlepo…
…int.png

 	modified:   html/images/os/cradlepoint.png
 	modified:   includes/definitions/wipipe.yaml
 	modified:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	modified:   includes/polling/os/wipipe.inc.php
@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 22, 2017

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

@laf

Some small changes and after that 👍 from me.

Show outdated Hide outdated includes/discovery/sensors/dbm/wipipe.inc.php
$device,
$oid,
'mdmSignalStrength.'.$index,
'mrv-od',

This comment has been minimized.

@laf

laf May 22, 2017

Member

This should be wipipe

@laf

laf May 22, 2017

Member

This should be wipipe

Show outdated Hide outdated includes/discovery/sensors/pre-cache/wipipe.inc.php
*/
echo 'Caching WIPIPE-MIB';
$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, 'enterprises.20992', array(), 'SNMPv2-SMI');

This comment has been minimized.

@laf

laf May 22, 2017

Member

This looks wrong, enterprises. is just a numerical OID translated from SNMPv2-SMI but 20992 is a vendor specific OID. So either use the vendors MIB and use the full OID name or drop SNMPv2-SMI and change the OID to the full numerical one.

@laf

laf May 22, 2017

Member

This looks wrong, enterprises. is just a numerical OID translated from SNMPv2-SMI but 20992 is a vendor specific OID. So either use the vendors MIB and use the full OID name or drop SNMPv2-SMI and change the OID to the full numerical one.

Show outdated Hide outdated includes/polling/os/wipipe.inc.php
*/
// Rip hardware and firmware version from sysDescr string -- example: Cradlepoint CBA850, Firmware Version 6.2.0.dd92f49
$getsysdescr = $poll_device['sysDescr'];

This comment has been minimized.

@laf

laf May 22, 2017

Member

This can be done with something like:

preg_match($poll_device['sysDescr'], '/(.*) ([\w\d]+), (.*) ([\w\d/.]+)/', $wipipe_data);
$hardware = $wipipe_data[2];
$version    = $wipipe_data[4];
@laf

laf May 22, 2017

Member

This can be done with something like:

preg_match($poll_device['sysDescr'], '/(.*) ([\w\d]+), (.*) ([\w\d/.]+)/', $wipipe_data);
$hardware = $wipipe_data[2];
$version    = $wipipe_data[4];

This comment has been minimized.

@thecityofguanyu

thecityofguanyu May 22, 2017

Contributor

Thanks for this! Still getting used to finding more efficient ways do certain tasks. Certainly cleaner than all of those variable declarations.

@thecityofguanyu

thecityofguanyu May 22, 2017

Contributor

Thanks for this! Still getting used to finding more efficient ways do certain tasks. Certainly cleaner than all of those variable declarations.

This comment has been minimized.

@thecityofguanyu

thecityofguanyu May 22, 2017

Contributor

This seemed to break the hardware and version detection. Taking a look.

@thecityofguanyu

thecityofguanyu May 22, 2017

Contributor

This seemed to break the hardware and version detection. Taking a look.

Changes requested by laf
 	modified:   includes/discovery/sensors/dbm/wipipe.inc.php
 	modified:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	modified:   includes/polling/os/wipipe.inc.php
@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 22, 2017

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

@thecityofguanyu

This comment has been minimized.

Show comment
Hide comment
@thecityofguanyu

thecityofguanyu May 22, 2017

Contributor

Latest commit breaks the devFWUpgradeStatus state because it is not included in mdmEntry. Working on fixing.

Contributor

thecityofguanyu commented May 22, 2017

Latest commit breaks the devFWUpgradeStatus state because it is not included in mdmEntry. Working on fixing.

Reworked devFWUpgradeStatus state sensor
 	modified:   includes/discovery/sensors/state/wipipe.inc.php
@thecityofguanyu

This comment has been minimized.

Show comment
Hide comment
@thecityofguanyu
Contributor

thecityofguanyu commented May 22, 2017

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 22, 2017

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

Fixed hardware/OS version detection
 	modified:   includes/polling/os/wipipe.inc.php
@thecityofguanyu

This comment has been minimized.

Show comment
Hide comment
@thecityofguanyu
Contributor

thecityofguanyu commented May 22, 2017

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 22, 2017

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

@thecityofguanyu

This comment has been minimized.

Show comment
Hide comment
@thecityofguanyu

thecityofguanyu May 26, 2017

Contributor

@laf

Are there any additional changes you need made here?

Contributor

thecityofguanyu commented May 26, 2017

@laf

Are there any additional changes you need made here?

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf May 31, 2017

Member

Moved the mib into the correct dir, will merge when checks complete.

Member

laf commented May 31, 2017

Moved the mib into the correct dir, will merge when checks complete.

@laf

laf approved these changes May 31, 2017

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented May 31, 2017

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

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier May 31, 2017

The inspection completed: No new issues

scrutinizer-notifier commented May 31, 2017

The inspection completed: No new issues

@laf laf merged commit 8c8d591 into librenms:master May 31, 2017

3 checks passed

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

@thecityofguanyu thecityofguanyu deleted the thecityofguanyu:add-cradlepoint-support branch Oct 4, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

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

lock bot commented May 17, 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 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.