HP BladeSystem C3000/C7000 OA #4035

Merged
merged 8 commits into from Aug 16, 2016

Projects

None yet

4 participants

@crcro
Contributor
crcro commented Aug 11, 2016

added: hardware model, software version, fans and power source sensor states
remove: header graphs for memory and cpu usage (not available).

@crcro crcro added hardware model, software version, fans and ps sensor states, re…
…moved header cpu and memory graphs
d95cf4a
@murrant murrant and 1 other commented on an outdated diff Aug 11, 2016
includes/discovery/sensors/states/hpblmos.inc.php
+ '.1.3.6.1.4.1.232.22.2.3.1.3.1.11.6',
+ );
+ }
+
+ /* CPQRACK-MIB::cpqRackCommonEnclosureFanTable
+ * 1 - other
+ * 2 - ok
+ * 3 - degraded
+ * 4 - failed
+ */
+
+ foreach($oids as $oid) {
+ $state = snmp_get($device, $oid, '-Oqv');
+ $descr = $state_descr . $index;
+
+ if(!empty($state))
@murrant
murrant Aug 11, 2016 Contributor

I would ignore non-present PSUs (0) too keep them from cluttering things.

@crcro
crcro Aug 11, 2016 Contributor

there is no state as non-present, maybe those with other but also other can mean several other failures/warnings

@murrant
murrant Aug 11, 2016 edited Contributor

'The status could not be determined or not present.'

BTW, this would only prevent initial discovery. Once it has been discovered, it won't be removed. So, whenever the state is discovered with a non-zero status it would be added permanently.

@crcro
crcro Aug 11, 2016 edited Contributor

@murrant

there is a different oid that reports the status of psu presence:
.1.3.6.1.4.1.232.22.2.5.1.1.1.16.x (1 to 6)

which may report:
1 - other
2 - absent
3 - present

i didn't get the "Once it has been discovered, it won't be removed. So, whenever the state is discovered with a non-zero status it would be added permanently." part.

@murrant
murrant Aug 11, 2016 edited Contributor

Then you should use .1.3.6.1.4.1.232.22.2.5.1.1.1.16 to discover.

I was wrong about the "wont' be removed" comment. Please ignore me :/

@crcro crcro rewrite the discovery module based on presence oid
133a8c8
@laf
Member
laf commented Aug 12, 2016

A lot of the formatting of if and similar are wrong here.

The { should be on the same line so: if (something) {

@laf laf added the New-Device label Aug 12, 2016
@crcro crcro fixes - PSR-2 style
709e941
@crcro crcro added sensors for power usage and temperatures of the blade system
ca1223c
@crcro crcro fix: sensor id for rrd file
b201e64
@murrant murrant commented on an outdated diff Aug 15, 2016
includes/discovery/sensors/power/hpblmos.inc.php
@@ -0,0 +1,20 @@
+<?php
+if ($device['os'] == 'hpblmos') {
+
+ $sensor_type = 'hpblmos_psu_usage';
+ $psu_exists_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16.';
+ $psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.';
+ $psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.';
+
+ for ($psuid = 1; $psuid < 7; $psuid++) {
@murrant
murrant Aug 15, 2016 Contributor

Could you use snmpwalk to determine which PSUs and fans exist rather than individual gets?

@crcro crcro rewrite to use snmp_walk against snmp_get for fewer device queries
b4354b3
@crcro
Contributor
crcro commented Aug 16, 2016

@murrant ... this should be better

@crcro crcro removed useless comments
2bf54f1
@murrant murrant commented on an outdated diff Aug 16, 2016
includes/discovery/sensors/power/hpblmos.inc.php
+ $psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16';
+ $psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.';
+ $psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.';
+
+ $psus = trim(snmp_walk($device, $psu_oid, '-Osqn'));
+
+ foreach (explode("\n", $psus) as $psu) {
+ $psu = trim($psu);
+ if ($psu) {
+ list($oid, $presence) = explode(' ', $psu, 2);
+ if ($presence != 2) {
+ $split_oid = explode('.', $oid);
+ $current_id = $split_oid[(count($split_oid) - 1)];
+ $current_oid = $psu_usage_oid.$current_id;
+ $psu_max_oid = $psu_max_usage_oid.$current_id;
+ $descr = 'PSU '.$psuid.' output';
@murrant
murrant Aug 16, 2016 Contributor

$psuid isn't set

@crcro crcro fix not set
370fab0
@murrant
Contributor
murrant commented Aug 16, 2016

Thanks!

@murrant murrant merged commit 3c24a67 into librenms:master Aug 16, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@crcro crcro deleted the unknown repository branch Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment