Preliminary HP Virtual Connect support #3487

Merged
merged 1 commit into from May 4, 2016

Projects

None yet

3 participants

@mieleton
Contributor
mieleton commented May 4, 2016

Barebones support to discovering HP Virtual Connect (Ethernet) modules including their model, serial and version.

SNMP support in Virtual Connect is quite limited, information like CPU and MEM usage etc. is not available.

@mieleton mieleton Preliminary HP Virtual Connect support
4569a08
@LibreNMS-CI

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

@laf
Member
laf commented May 4, 2016

You need to sign the contributors agreement: http://docs.librenms.org/General/Contributing/

@mieleton
Contributor
mieleton commented May 4, 2016

@laf done, see pull request #3489

@laf laf commented on the diff May 4, 2016
includes/polling/os/hpvc.inc.php
@@ -0,0 +1,9 @@
+<?php
+
+// Format of sysDescr is hardware model followed by version followed by build date
+$tempstr = substr($poll_device['sysDescr'], 0, strrpos($poll_device['sysDescr'], ' '));
+$version = trim(substr($tempstr, strrpos($tempstr, ' ')));
+$hardware = trim(substr($tempstr, 0, strrpos($tempstr, ' ')));
+
+// Serial number is in sysName after string "VCEX"
+$serial = substr(snmp_get($device, 'sysName.0', '-OvQ', 'SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB'), 4);
@laf
laf May 4, 2016 Member

sysName should be available in $poll_device['sysName']

@mieleton
mieleton May 4, 2016 Contributor

Yes, though looking at the code it gets transformed to lowercase from the original string. I wanted to keep the serial number in exactly the same format it's visible in other places. However, I can change this, if needed.

@laf laf commented on the diff May 4, 2016
includes/definitions.inc.php
@@ -1577,6 +1577,14 @@
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
$config['os'][$os]['over'][0]['text'] = 'Traffic';
+// HP Virtual Connect
+$os = 'hpvc';
@laf
laf May 4, 2016 Member

Is hpvc the OS name for this?

@mieleton
mieleton May 4, 2016 Contributor

HP does not have any (public) OS name for the software the modules are running, so I went with an acronym of HP Virtual Connect to keep it short.

@laf laf merged commit 4d526c8 into librenms:master May 4, 2016

3 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@laf
Member
laf commented May 4, 2016

We probably should just expose sysName_orig or something but yes for now this is fine.

@laf laf removed the Blocker label May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment