newdevice: Added support for Emerson energy systems (#7128)

* newdevice: Added support for Emerson energy systems

* added missing test

* Update ees.yaml
This commit is contained in:
Neil Lathwood
2017-08-08 07:58:57 +01:00
committed by GitHub
parent 649795df86
commit d8140467ae
9 changed files with 4975 additions and 9 deletions

View File

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,169 @@
mib: EES-POWER-MIB
modules:
sensors:
temperature:
data:
-
oid: psTemperatureTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.7.3.1.2.
value: psTemperatureMeasurement
index: 'psTemperatureMeasurement.{{ $index }}'
descr: psTemperatureName
skip_value_lt: 0
voltage:
data:
-
oid: systemVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.2.
divisor: 1000
index: 'systemVoltage.{{ $index }}'
descr: 'System Voltage'
skip_values: 2147483647
-
oid: psBatteryVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.5.1.
divisor: 1000
index: 'psBatteryVoltage.{{ $index }}'
descr: 'Battery Voltage'
skip_values: 2147483647
-
oid: psInputLineAVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.6.1.
divisor: 1000
index: 'psInputLineAVoltage.{{ $index }}'
descr: 'Input Line A Voltage'
skip_values: 2147483647
-
oid: psInputLineBVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.6.2.
divisor: 1000
index: 'psInputLineBVoltage.{{ $index }}'
descr: 'Input Line B Voltage'
skip_values: 2147483647
-
oid: psInputLineCVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.6.3.
divisor: 1000
index: 'psInputLineCVoltage.{{ $index }}'
descr: 'Input Line C Voltage'
skip_values: 2147483647
-
oid: psConverterVoltage
num_oid: .1.3.6.1.4.1.6302.2.1.2.13.4.
divisor: 1000
index: 'psConverterVoltage.{{ $index }}'
descr: 'Convertor Voltage'
skip_values: 2147483647
current:
data:
-
oid: systemCurrent
num_oid: .1.3.6.1.4.1.6302.2.1.2.3.
divisor: 1000
index: 'systemCurrent.{{ $index }}'
descr: 'System Current'
skip_values: 2147483647
-
oid: psTotalBatteryCurrent
num_oid: .1.3.6.1.4.1.6302.2.1.2.5.2.
divisor: 1000
index: 'psTotalBatteryCurrent.{{ $index }}'
descr: 'Battery Current'
skip_values: 2147483647
-
oid: psBatteryTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.5.5.
value: psBatteryCurrent
index: 'psBatteryTable.{{ $index }}'
descr: psBatteryName
-
oid: psRectifierTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.11.4.
value: psRectifierCurrent
divisor: 1000
index: 'psRectifierTable.{{ $index }}'
descr: psRectifierIdent
-
oid: psDistributionLoadTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.11.4.
value: psDistributionLoadCurrent
divisor: 1000
index: 'psDistributionLoadTable.{{ $index }}'
descr: psDistributionLoadName
-
oid: psDistributionGeneralTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.12.3.
value: psDistributionGeneralCurrent
divisor: 1000
index: 'psDistributionGeneralTable.{{ $index }}'
descr: psDistributionGeneralName
-
oid: psTotalConverterCurrent
num_oid: .1.3.6.1.4.1.6302.2.1.2.13.5.
index: 'psTotalConverterCurrent.{{ $index }}'
descr: 'Converter Current'
skip_values: 2147483647
-
oid: psConverterTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.13.6.1.6.
value: psConverterCurrent
divisor: 1000
index: 'psConverterTable.{{ $index }}'
descr: psConverterIdent
state:
data:
-
oid: systemStatus
num_oid: .1.3.6.1.4.1.6302.2.1.2.1.
descr: 'System Status'
index: 'systemStatus.{{ $index }}'
states:
- { descr: unknown, graph: 1, value: 1, generic: 3 }
- { descr: normal, graph: 1, value: 2, generic: 0 }
- { descr: warning, graph: 1, value: 3, generic: 1 }
- { descr: minor, graph: 1, value: 4, generic: 1 }
- { descr: major, graph: 1, value: 5, generic: 2 }
- { descr: critical, graph: 1, value: 6, generic: 2 }
- { descr: unmanaged, graph: 1, value: 7, generic: 1 }
- { descr: restricted, graph: 1, value: 8, generic: 1 }
- { descr: testing, graph: 1, value: 9, generic: 3 }
- { descr: disabled, graph: 1, value: 10, generic: 1 }
-
oid: psStatusCommunication
num_oid: .1.3.6.1.4.1.6302.2.1.2.8.
descr: 'Communication Status'
index: 'psStatusCommunication.{{ $index }}'
states:
- { descr: unknown, graph: 1, value: 1, generic: 3 }
- { descr: normal, graph: 1, value: 2, generic: 0 }
- { descr: interupt, graph: 1, value: 3, generic: 2 }
-
oid: psStatusBatteryMode
num_oid: .1.3.6.1.4.1.6302.2.1.2.9.
descr: 'Battery Status'
index: 'psStatusBatteryMode.{{ $index }}'
states:
- { descr: unknown, graph: 1, value: 1, generic: 3 }
- { descr: floatCharging, graph: 1, value: 2, generic: 1 }
- { descr: shortTest, graph: 1, value: 3, generic: 1 }
- { descr: bcForTest, graph: 1, value: 4, generic: 1 }
- { descr: manualTesting, graph: 1, value: 5, generic: 1 }
- { descr: planTesting, graph: 1, value: 6, generic: 1 }
- { descr: acFailTesting, graph: 1, value: 7, generic: 1 }
- { descr: acFail, graph: 1, value: 8, generic: 2 }
- { descr: manualBC, graph: 1, value: 9, generic: 1 }
- { descr: autoBC, graph: 1, value: 10, generic: 1 }
- { descr: cyclicBC, graph: 1, value: 11, generic: 1 }
- { descr: masterBC, graph: 1, value: 12, generic: 1 }
- { descr: masterBT, graph: 1, value: 13, generic: 1 }
-
oid: psTemperatureTable
num_oid: .1.3.6.1.4.1.6302.2.1.2.7.3.1.5.
value: psTemperatureAlarmStatus
index: 'psTemperatureAlarmStatus.{{ $index }}'
descr: psTemperatureName
states:
- { descr: high, graph: 1, value: 1, generic: 2 }
- { descr: low, graph: 1, value: 2, generic: 2 }
- { descr: fail, graph: 1, value: 3, generic: 2 }
- { descr: none, graph: 1, value: 4, generic: 3 }

View File

@@ -0,0 +1,13 @@
os: ees
text: Emerson Energy System
type: power
icon: emerson
over:
- { graph: sensor_current, text: 'Current' }
- { graph: sensor_voltage, text: 'Voltage' }
- { graph: sensor_state, text: 'State' }
mib_dir:
- emerson
discovery:
- sysObjectId:
- .1.3.6.1.4.1.6302.2.

View File

@@ -198,7 +198,7 @@ function discover_device(&$device, $options = null)
//end discover_device()
// Discover sensors
function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr, $divisor = 1, $multiplier = 1, $low_limit = null, $low_warn_limit = null, $warn_limit = null, $high_limit = null, $current = null, $poller_type = 'snmp', $entPhysicalIndex = null, $entPhysicalIndex_measured = null, $user_func = null, $entity_link_type = null, $entity_link_index = 0)
function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr, $divisor = 1, $multiplier = 1, $low_limit = null, $low_warn_limit = null, $warn_limit = null, $high_limit = null, $current = null, $poller_type = 'snmp', $entPhysicalIndex = null, $entPhysicalIndex_measured = null, $user_func = null)
{
$low_limit = set_null($low_limit);
$low_warn_limit = set_null($low_warn_limit);
@@ -252,8 +252,6 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
'entPhysicalIndex' => $entPhysicalIndex,
'entPhysicalIndex_measured' => $entPhysicalIndex_measured,
'user_func' => $user_func,
'entity_link_type' => $entity_link_type,
'entity_link_index' => $entity_link_index,
);
foreach ($insert as $key => $val_check) {
@@ -338,9 +336,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
$divisor == $sensor_entry['sensor_divisor'] &&
$entPhysicalIndex_measured == $sensor_entry['entPhysicalIndex_measured'] &&
$entPhysicalIndex == $sensor_entry['entPhysicalIndex'] &&
$user_func == $sensor_entry['user_func'] &&
$entity_link_type == $sensor_entry['entity_link_type'] &&
$entity_link_index == $sensor_entry['entity_link_index']
$user_func == $sensor_entry['user_func']
) {
echo '.';
} else {
@@ -352,8 +348,6 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
'entPhysicalIndex' => $entPhysicalIndex,
'entPhysicalIndex_measured' => $entPhysicalIndex_measured,
'user_func' => $user_func,
'entity_link_type' => $entity_link_type,
'entity_link_index' => $entity_link_index,
);
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
echo 'U';
@@ -1081,7 +1075,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
$tmp_name = $data['oid'];
$raw_data = $pre_cache[$tmp_name];
foreach ($raw_data as $index => $snmp_data) {
$value = is_numeric($snmp_data[$data['value']]) ? $snmp_data[$data['value']] : ($snmp_data[$data['oid']] ?: false);
$value = is_numeric($snmp_data[$data['value']]) ? $snmp_data[$data['value']] : (is_numeric($snmp_data[$data['oid']]) ? $snmp_data[$data['oid']]: false);
if (can_skip_sensor($value, $data, $sensor_options) === false && is_numeric($value)) {
$oid = $data['num_oid'] . $index;
if (isset($snmp_data[$data['descr']])) {

View File

@@ -0,0 +1,30 @@
<?php
/**
* ees.inc.php
*
* LibreNMS os polling module for Emerson
*
* 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>
*/
$tmp_ees = snmp_get_multi($device, 'identControllerFirmwareVersion.0 identControllerSerialNumber.0', '-OQUs', 'EES-POWER-MIB');
$version = $tmp_ees[0]['identControllerFirmwareVersion'];
$serial = $tmp_ees[0]['identControllerSerialNumber'];
unset($tmp_ees);

View File

File diff suppressed because it is too large Load Diff

1115
mibs/emerson/EES-POWER-MIB Normal file
View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Linux ES_Controller 2.6.27.18-419-g12a78a3 #267 PREEMPT Fri Aug 15 15:19:49 CDT 2014 armv5tejl
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6302.2.1