Add Support for Lenovo EMC (NAS) #2795

Merged
merged 12 commits into from Jan 18, 2016

Projects

None yet

4 participants

@arrmo
Contributor
arrmo commented Jan 17, 2016

Hi,

These are the updates for the Lenovo NAS. Still some more general issues with MIB support, but that's a bit different issue.

Yell if you have any questions. Thanks!

@laf laf and 2 others commented on an outdated diff Jan 17, 2016
doc/Extensions/MIB-based-polling.md
@@ -69,9 +69,9 @@ The components involved in MIB-based polling are:
- During discovery, relevant MIBs are parsed using `snmptranslate`, and the
data returned is used to populate a database which guides the poller in
- what to store. At the moment, only OIDs of INTEGER, Integer32, Gauge32,
@laf
laf Jan 17, 2016 Member

Any reason you've removed Guage32 from the doc?

@arrmo
arrmo Jan 17, 2016 Contributor

I didn't ... :-). This was applying a patch from Paul - so it's in my code now.

@paulgear
paulgear Jan 17, 2016 Member

I've updated the documentation in another PR, so best to just remove d3cddff from this PR.

@arrmo
arrmo Jan 17, 2016 Contributor

Will do - thanks!

@arrmo
arrmo Jan 17, 2016 Contributor

Reverted, and will push right away.

@laf laf and 2 others commented on an outdated diff Jan 17, 2016
includes/polling/os/lenovoemc.inc.php
@@ -0,0 +1,5 @@
+<?php
+$hardware = snmp_get($device, 'deviceDescr.0', '-Ovq', 'IOMEGANAS-MIB');
+$version = 'v1';
@laf
laf Jan 17, 2016 Member

How come this is hardcoded to v1?

@arrmo
arrmo Jan 17, 2016 Contributor

Because it doesn't seem to provide a version number anywhere (stepped through all the SNMP info), and I figured this was required. I can remove it, if that makes sense to you - no issue here!

@laf
laf Jan 17, 2016 Member

Just remove it then :)

@paulgear
paulgear Jan 17, 2016 Member

Yeah - if version's not defined, just leave it out.

@arrmo
arrmo Jan 17, 2016 Contributor

Done!

@laf laf and 1 other commented on an outdated diff Jan 17, 2016
includes/polling/os/lenovoemc.inc.php
@@ -0,0 +1,5 @@
+<?php
+$hardware = snmp_get($device, 'deviceDescr.0', '-Ovq', 'IOMEGANAS-MIB');
+$version = 'v1';
+$serial = 'N/A';
@laf
laf Jan 17, 2016 Member

Best just to not define $serial if we don't have one.

@arrmo
arrmo Jan 17, 2016 Contributor

Will do! Thought all 3 were mandatory.

@laf
laf Jan 17, 2016 Member

Nope, only set what you have :)

@laf laf commented on the diff Jan 17, 2016
includes/definitions.inc.php
@@ -1435,6 +1435,19 @@
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
+// Lenovo EMC (NAS)
+$os = 'lenovoemc';
@laf
laf Jan 17, 2016 Member

Is lenovoemc the OS? Ideally these should be named after the OS they running unless that OS covers a variety of hardware

@arrmo
arrmo Jan 17, 2016 Contributor

Makes sense! I can change this if you like. It's running a version / variant of Linux - note that?

@laf
laf Jan 17, 2016 Member

What's the OS it runs, they must give it a name?

@paulgear
paulgear Jan 17, 2016 Member

Does Lenovo give the OS a name? EMC seems like it could be confusing as well, since that's a well-established SAN/NAS company, and this device has nothing to do with them.

@arrmo
arrmo Jan 17, 2016 Contributor

Checked it (from the USB device / interface) ... it's Linux, 2.6.31.8. Is there a specific format / way to use this info? New to this, sorry if that's a dumb question.

@arrmo
arrmo Jan 17, 2016 Contributor

BTW, FYI - Lenovo EMC seems to be a branch of Lenovo (e.g. http://setup.lenovoemc.com/setup.php)

@laf
laf Jan 17, 2016 Member

Like Cisco switches, they run IOS or NX-OS etc. That's what we would call the $os variable. What does this kit run?

@arrmo
arrmo Jan 17, 2016 Contributor

It's a somewhat customized version of Linux it seems - but if you ssh in to the box, it reports Linux (2.6.31.8). But SNMP doesn't match to Linux, which is why I gave it a special name. Thoughts?

Thanks!

@arrmo
arrmo Jan 17, 2016 Contributor

BTW, this is the box (just in case it helps),
http://shop.lenovo.com/us/en/servers/network-storage/lenovoemc/ix2/

@laf
laf Jan 17, 2016 Member

Does it have a web interface? What do they call that?

@arrmo
arrmo Jan 17, 2016 Contributor

Yep, there is a web interface - but I admit, they don't call it much (and it isn't much .. LOL). It just says "lenovo" at the top, and then config options. Status page -> just Lenovo, then HW and SW status / details.

I'm definitely open to suggestions!

@laf
laf Jan 17, 2016 Member

As bad as it seems, I'd say we have to stick with lenovoemc then :/

@arrmo
arrmo Jan 18, 2016 Contributor

Makes sense, no issue here.

I think I made the requested updates, and reverted the patch file - but by all means yell if I missed something.

Thanks!

@laf
Member
laf commented Jan 17, 2016

Thanks @arrmo. I've put some in-line comments on.

Can you confirm where the MIB is from please?

@laf laf and 1 other commented on an outdated diff Jan 17, 2016
includes/polling/os/lenovoemc.inc.php
@@ -0,0 +1,5 @@
+<?php
+$hardware = snmp_get($device, 'deviceDescr.0', '-Ovq', 'IOMEGANAS-MIB');
+$version = 'v1';
+$serial = 'N/A';
+?>
@laf
laf Jan 17, 2016 Member

Can you remove the ?> it's not needed and can cause issues.

@arrmo
arrmo Jan 17, 2016 Contributor

You bet - will do!

@arrmo
Contributor
arrmo commented Jan 17, 2016

To the question above - the MIB is available on the device itself (i.e. it's downloaded from the device, Lenovo stores it on the NAS). Make sense?

arrmo added some commits Jan 17, 2016
@arrmo arrmo Revert "Patch from Paul Gear, for Custom MIB data handling (non-integ…
…er)"

This reverts commit d3cddff.
734f9bc
@arrmo arrmo Updates based on comments from Pull-Request
2f6800b
@laf
Member
laf commented Jan 18, 2016

I think the doc file is still wrong, can you completely revert this file?

@arrmo
Contributor
arrmo commented Jan 18, 2016

I think I've undone this, but I could be wrong! Do I need to update the pull request somehow, to show the "new" file (=original)?

Thanks!

@laf
Member
laf commented Jan 18, 2016

Looks like it's still there. Have you pushed your branch to your repo, it doesn't look like you have.

If you have then grab https://raw.githubusercontent.com/librenms/librenms/master/doc/Extensions/MIB-based-polling.md and just commit that file it should be fine. You can do it by just messing around in git but for the second of an extra commit it's not worth it.

@arrmo arrmo Revert changes to MIB-based-polling.md
Pull legacy file, put back in place.
c14099b
@arrmo arrmo Make sure full document pulled (MIB-based-polling.md)
f66c20a
@arrmo
Contributor
arrmo commented Jan 18, 2016

OK, I think it's all there now - fixed in my commit f66c20a.

Thanks for catching this!

@laf
Member
laf commented Jan 18, 2016

@arrmo it looks like this PR also overwrites the recent updates for includes/snmp.inc.php that @paulgear made. Can you ensure that you grab the latest file for this as well please.

@arrmo arrmo Pull the latest from recent merge (corrections by Paul Gear)
73113b8
@arrmo
Contributor
arrmo commented Jan 18, 2016

Yep, NP! Sorry for the confusion - I was thinking I was doing the right thing including the patch Paul sent me, but this way works just fine for me.

I have copied the file over to my branch (in commit 73113b8) - should be the correct file now, but by all means yell if I have it wrong. Thanks!

@laf
Member
laf commented Jan 18, 2016

:) You've taken the github page so includes/snmp.inc.php now contains a load of a html. You need to grab the raw version.

@arrmo arrmo Non-HTML version of the file ... :-).
d9857f8
@arrmo
Contributor
arrmo commented Jan 18, 2016

#%*@# ... that's what happens you do things while you're at work ... ;-).

Fixed - thanks!!! Opened the file itself to check (thought I was being smart, downloading it directly to get the exact file).

@laf laf merged commit 7c39cba into librenms:master Jan 18, 2016

2 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer No new issues
Details
@laf
Member
laf commented Jan 18, 2016

Merged. Thanks @arrmo.

You may want to have a read of http://docs.librenms.org/Developing/Using-Git/ for some help on using git. The biggest one is not using your master to make changes but instead create a branch.

@arrmo
Contributor
arrmo commented Jan 18, 2016

Thanks for the link! Yes, still figuring out git, I admit that. The coding part is easy, git is a struggle yet ... LOL.

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