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

Device: Add Open Access Netspire OS support #8674

Merged
merged 4 commits into from May 10, 2018

Conversation

Projects
None yet
3 participants
@vivia11
Contributor

vivia11 commented May 8, 2018

Adding OS support for OA Netspire devices.

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

vivia11 and others added some commits May 7, 2018

@laf

Thanks for submitting this @vivia11

Few comments left in line :)

@@ -0,0 +1,7 @@
<?php
// OACOMMON-MIB::netspireDeviceModelName

This comment has been minimized.

@laf

laf May 8, 2018

Member

Please remove this comment and use the MIB name + oid in the snmp_get()

$hardware = snmp_get($device, "1.3.6.1.4.1.1732.2.1.41.0", "-OQv");
// OACOMMON-MIB::netSpireDeviceDeviceSerialNo
$serial = preg_replace('/[\r\n\"]+/', ' ', snmp_get($device, "1.3.6.1.4.1.1732.2.1.11.0", "-OQv"));

This comment has been minimized.

@laf

laf May 8, 2018

Member

Please move this snmp_get() and merge with the $hardware one using snmp_get_multi_oid

if ($device['os'] === 'netspire') {
echo 'Netspire Memory Pool\n';
$usage = str_replace('"', "", snmp_get($device, '1.3.6.1.4.1.1732.2.1.8.0', "-OQv"));

This comment has been minimized.

@laf

laf May 8, 2018

Member

Can you use the MIB and named OID here please

<?php
//OACOMMON-MIB::netSpireDevicestorageUsed
$usage = str_replace('"', "", snmp_get($device, "1.3.6.1.4.1.1732.2.1.8.0", "-OQv"));

This comment has been minimized.

@laf

laf May 8, 2018

Member

Can you use the MIB and named OID here please

- .1.3.6.1.4.1.1732
mib_dir:
- openaccess
poller_modules:

This comment has been minimized.

@laf

laf May 8, 2018

Member

You don't really need to disable most of these poller and discovery modules as they should have negligible impact to poll times.

@vivia11

This comment has been minimized.

Contributor

vivia11 commented May 9, 2018

@laf

Thanks for the suggestions, I've made some changes to the code. I'm not sure if I should be unsetting my extra variables as I use them or not...

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented May 9, 2018

The inspection completed: No new issues

if ($device['os'] === 'netspire') {
echo 'Netspire Memory Pool\n';
$usage = str_replace('"', "", snmp_get($device, 'netSpireDeviceStorageUsed.0', "-OQv", 'OACOMMON-MIB', 'openaccess'));

This comment has been minimized.

@laf

laf May 9, 2018

Member

You can drop the openaccess from the end of the snmp_get() call, this is already pulled in from the yaml file.

@@ -0,0 +1,9 @@
<?php
$usage = str_replace('"', "", snmp_get($device, "netSpireDeviceStorageUsed.0", "-OQv", 'OACOMMON-MIB', 'openaccess'));

This comment has been minimized.

@laf

laf May 9, 2018

Member

Same here.

$data = snmp_get_multi_oid($device, $oids, '-OUQs', 'OACOMMON-MIB', 'openaccess');
$hardware = $data[$oids[0]];

This comment has been minimized.

@laf

laf May 9, 2018

Member

This is easily broken I think. Take a look at how it's done in includes/polling/os/ipolis.inc.php

@@ -0,0 +1,9 @@
os: netspire

This comment has been minimized.

@laf

laf May 9, 2018

Member

So netspire appears to be a range of products. Does netspire cover them all (i.e they run the same firmware)?

This comment has been minimized.

@vivia11

vivia11 May 10, 2018

Contributor

We have two different devices (audio controller and paging station) which run the same firmware. I am not sure if this extends to their entire range. However, their oacommon-mib covers their entire netspire range.

@laf

laf approved these changes May 10, 2018

LGTM

@laf

This comment has been minimized.

Member

laf commented May 10, 2018

Awesome work as always :)

@laf laf merged commit 5fd81db into librenms:master May 10, 2018

2 checks passed

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

@vivia11 vivia11 deleted the vivia11:netspire branch May 14, 2018

TheMysteriousX added a commit to TheMysteriousX/librenms that referenced this pull request May 20, 2018

device: Added Open Access Netspire OS support (librenms#8674)
* Add netspire os support

* Update netspire.yaml

* Change from numerical oid to regular oid and readd poller/discovery modules

* Remove mib_dir and change os polling

@laf laf added the Device 🖥 label May 30, 2018

mattie47 added a commit to mattie47/librenms that referenced this pull request Jul 2, 2018

device: Added Open Access Netspire OS support (librenms#8674)
* Add netspire os support

* Update netspire.yaml

* Change from numerical oid to regular oid and readd poller/discovery modules

* Remove mib_dir and change os polling

@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2018

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