device: Fix hpe-ipdu initial thresholds (#7694)

Convert to yaml
Set load thresholds from snmp
preserve existing indexes
This commit is contained in:
Tony Murray 2017-11-09 14:24:24 -06:00 committed by Neil Lathwood
parent b0dca5ba7e
commit 76a35f2e14
6 changed files with 45 additions and 207 deletions

View File

@ -0,0 +1,45 @@
mib: CPQPOWER-MIB
modules:
sensors:
current:
data:
-
oid: mpduOutputEntry
value: mpduOutputCurrent
num_oid: .1.3.6.1.4.1.232.165.5.2.1.1.7.
skip_values: -1
divisor: 100
index: 'mpduOutputCurrent.{{ $index }}'
descr: 'MPDU #{{ $mpduOutputIndex }} Current'
load:
data:
-
oid: mpduOutputEntry
value: mpduOutputPercentLoad
num_oid: .1.3.6.1.4.1.232.165.5.2.1.1.5.
skip_values: -1
divisor: 10
index: 'mpduOutputPercentLoad.{{ $index }}'
descr: 'MPDU #{{ $mpduOutputIndex }} Load'
warn_limit: mpduOutputWarningThreshold
high_limit: mpduOutputCriticalThreshold
power:
data:
-
oid: mpduOutputEntry
value: mpduOutputPowerFactor
num_oid: .1.3.6.1.4.1.232.165.5.2.1.1.10.
skip_values: -1
divisor: 100
index: 'mpduOutputPowerFactor.{{ $index }}'
descr: 'MPDU #{{ $mpduOutputIndex }} Power'
voltage:
data:
-
oid: mpduOutputEntry
value: mpduOutputVoltage
num_oid: .1.3.6.1.4.1.232.165.5.2.1.1.6.
skip_values: -1
divisor: 10
index: 'mpduOutputVoltage.{{ $index }}'
descr: 'MPDU #{{ $mpduOutputIndex }} Voltage'

View File

@ -1,45 +0,0 @@
<?php
/**
* hpe-ipdu.inc.php
*
* LibreNMS sensors current discovery module for HPE iPDU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
echo 'HPE iPDU Current ';
$x=1;
foreach ($pre_cache['hpe_ipdu'] as $index => $item) {
if (isset($item['mpduOutputCurrent'])) {
$oid = '.1.3.6.1.4.1.232.165.5.2.1.1.7.' . $index;
$current = $item['mpduOutputCurrent'];
discover_sensor($valid['sensor'], 'current', $device, $oid, 'mpduOutputCurrent.'.$index, 'hpe-ipdu', "MPDU #$x Current", 100, 1, null, null, null, null, $current);
$x++;
}
}//end foreach
unset(
$item,
$oid,
$index,
$item,
$x
);

View File

@ -1,45 +0,0 @@
<?php
/**
* hpe-ipdu.inc.php
*
* LibreNMS sensors load discovery module for HPE iPDU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
echo 'HPE iPDU Load ';
$x=1;
foreach ($pre_cache['hpe_ipdu'] as $index => $item) {
if (isset($item['mpduOutputPercentLoad'])) {
$oid = '.1.3.6.1.4.1.232.165.5.2.1.1.5.' . $index;
$current = $item['mpduOutputPercentLoad'];
discover_sensor($valid['sensor'], 'load', $device, $oid, 'mpduOutputPercentLoad.'.$index, 'hpe-ipdu', "MPDU #$x Load", 10, 1, null, null, null, null, $current);
$x++;
}
}//end foreach
unset(
$item,
$oid,
$index,
$item,
$x
);

View File

@ -1,45 +0,0 @@
<?php
/**
* hpe-ipdu.inc.php
*
* LibreNMS sensors power discovery module for HPE iPDU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
echo 'HPE iPDU Power ';
$x=1;
foreach ($pre_cache['hpe_ipdu'] as $index => $item) {
if (isset($item['mpduOutputPowerFactor'])) {
$oid = '.1.3.6.1.4.1.232.165.5.2.1.1.10.' . $index;
$current = $item['mpduOutputPowerFactor'];
discover_sensor($valid['sensor'], 'power', $device, $oid, 'mpduOutputPowerFactor.'.$index, 'hpe-ipdu', "MPDU #$x Power", 100, 1, null, null, null, null, $current);
$x++;
}
}//end foreach
unset(
$item,
$oid,
$index,
$item,
$x
);

View File

@ -1,27 +0,0 @@
<?php
/**
* hpe-ipdu.inc.php
*
* LibreNMS sensors pre-cache discovery module for HPE iPDU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
echo 'mpduOutputEntry ';
$pre_cache['hpe_ipdu'] = snmpwalk_cache_oid($device, 'mpduOutputEntry', array(), 'CPQPOWER-MIB');

View File

@ -1,45 +0,0 @@
<?php
/**
* hpe-ipdu.inc.php
*
* LibreNMS sensors voltage discovery module for HPE iPDU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
echo 'HPE iPDU Voltage ';
$x=1;
foreach ($pre_cache['hpe_ipdu'] as $index => $item) {
if (isset($item['mpduOutputVoltage'])) {
$oid = '.1.3.6.1.4.1.232.165.5.2.1.1.6.' . $index;
$current = $item['mpduOutputVoltage'];
discover_sensor($valid['sensor'], 'voltage', $device, $oid, 'mpduOutputVoltage.'.$index, 'hpe-ipdu', "MPDU #$x Voltage", 10, 1, null, null, null, null, $current);
$x++;
}
}//end foreach
unset(
$item,
$oid,
$index,
$item,
$x
);