mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
device: Fix hpe-ipdu initial thresholds (#7694)
Convert to yaml Set load thresholds from snmp preserve existing indexes
This commit is contained in:
parent
b0dca5ba7e
commit
76a35f2e14
45
includes/definitions/discovery/hpe-ipdu.yaml
Normal file
45
includes/definitions/discovery/hpe-ipdu.yaml
Normal 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'
|
@ -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
|
||||
);
|
@ -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
|
||||
);
|
@ -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
|
||||
);
|
@ -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');
|
@ -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
|
||||
);
|
Loading…
Reference in New Issue
Block a user