mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
device: Update hwg-ste and add hwg-ste-plus support (#7610)
* update hwg-ste and add hwg-ste-plus support * remove humidity graph over
This commit is contained in:
50
includes/definitions/discovery/hwg-ste.yaml
Normal file
50
includes/definitions/discovery/hwg-ste.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
mib: STE-MIB
|
||||
modules:
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
oid: sensTable
|
||||
value: sensValue
|
||||
num_oid: .1.3.6.1.4.1.21796.4.1.3.1.5.
|
||||
divisor: 10
|
||||
descr: sensName
|
||||
index: 'sensTable.{{ $index }}'
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: inpTable
|
||||
value: inpValue
|
||||
num_oid: .1.3.6.1.4.1.21796.4.1.1.1.2.
|
||||
descr: inpName
|
||||
index: 'inpValue.{{ $index }}'
|
||||
state_name: inpValue
|
||||
states:
|
||||
- { descr: open, graph: 0, value: 0, generic: 0 }
|
||||
- { descr: closed, graph: 0, value: 1, generic: 2 }
|
||||
-
|
||||
oid: inpTable
|
||||
value: inpAlarmState
|
||||
num_oid: .1.3.6.1.4.1.21796.4.1.1.1.4.
|
||||
descr: 'alarm : {{ $inpName }}'
|
||||
index: 'inpAlarmState.{{ $index }}'
|
||||
state_name: inpAlarmState
|
||||
states:
|
||||
- { descr: normal, graph: 0, value: 0, generic: 0 }
|
||||
- { descr: alarm, graph: 0, value: 1, generic: 2 }
|
||||
-
|
||||
oid: sensTable
|
||||
value: sensState
|
||||
num_oid: .1.3.6.1.4.1.21796.4.1.3.1.3.
|
||||
descr: sensName
|
||||
index: 'sensState.{{ $index }}'
|
||||
state_name: sensName
|
||||
states:
|
||||
- { descr: invalid, graph: 0, value: 0, generic: 2 }
|
||||
- { descr: normal, graph: 0, value: 1, generic: 0 }
|
||||
- { descr: outofrangelo, graph: 0, value: 2, generic: 2 }
|
||||
- { descr: outofrangehi, graph: 0, value: 3, generic: 2 }
|
||||
- { descr: alarmlo, graph: 0, value: 4, generic: 2 }
|
||||
- { descr: alarmhi, graph: 0, value: 5, generic: 2 }
|
||||
|
||||
|
@@ -3,9 +3,38 @@ text: 'HWg STE'
|
||||
type: environment
|
||||
icon: hwg
|
||||
over:
|
||||
- { graph: device_bits, text: Traffic }
|
||||
- { graph: device_temperature, text: Temperature }
|
||||
mib_dir:
|
||||
- hwg
|
||||
nobulk: 1
|
||||
poller_modules:
|
||||
applications : 0
|
||||
bgp-peers: 0
|
||||
ipmi : 0
|
||||
ospf: 0
|
||||
stp: 0
|
||||
netstats: 0
|
||||
discovery_modules:
|
||||
applications: 0
|
||||
arp-table : 0
|
||||
bgp-peers: 0
|
||||
cisco-vrf-lite : 0
|
||||
discovery-protocols : 0
|
||||
fdb-table : 0
|
||||
hr-device: 0
|
||||
ipv4-addresses : 0
|
||||
ipv6-addresses : 0
|
||||
mempools : 0
|
||||
ntp : 0
|
||||
ports : 0
|
||||
ports-stack : 0
|
||||
processors : 0
|
||||
services: 0
|
||||
storage : 0
|
||||
stp: 0
|
||||
ucd-diskio : 0
|
||||
vlans : 0
|
||||
wireless : 0
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.21796.4.1
|
||||
|
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'sensTable', array(), 'STE-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.21796.4.1.3.1.5.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
//Create State Index
|
||||
$state_name = 'sensState';
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
//Create State Translation
|
||||
if ($state_index_id !== null) {
|
||||
$states = array(
|
||||
array($state_index_id, 'invalid', 0, 0, 3),
|
||||
array($state_index_id, 'normal', 0, 1, 0),
|
||||
array($state_index_id, 'alarmstate', 0, 2, 1),
|
||||
array($state_index_id, 'alarm', 0, 3, 2)
|
||||
);
|
||||
foreach ($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($temp as $index => $entry) {
|
||||
$descr = $temp[$index]['sensName'];
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index]['sensState'], 'snmp', $index);
|
||||
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'sensTable', array(), 'STE-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.21796.4.1.3.1.5.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
foreach ($temp as $index => $entry) {
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $cur_oid.$index, $index, 'hwg-ste', $temp[$index]['sensName'], '10', '1', null, null, null, null, $temp[$index]['sensValue'], 'snmp', $index);
|
||||
}
|
||||
}
|
@@ -4,14 +4,14 @@
|
||||
-- 1.00 08.12.2008 Marek Hummel - Created
|
||||
-- 1.01 03.08.2009 Marek Hummel - Add SensorID, Change SensorState values
|
||||
-- 1.02 14.05.2010 Marek Hummel - Fix Syntax
|
||||
-- 1.03 17.07.2013 Marek Hummel - Add Dry Input contac for HWg-STE Plus
|
||||
--
|
||||
|
||||
STE-MIB DEFINITIONS ::= BEGIN
|
||||
IMPORTS
|
||||
OBJECT-TYPE FROM RFC-1212
|
||||
enterprises FROM RFC1155-SMI
|
||||
DisplayString,sysName FROM RFC1213-MIB
|
||||
TRAP-TYPE FROM RFC-1215;
|
||||
DisplayString FROM RFC1213-MIB;
|
||||
|
||||
--
|
||||
-- Type Definitions
|
||||
@@ -26,6 +26,18 @@ UnitType ::= INTEGER {
|
||||
percent(4)
|
||||
}
|
||||
|
||||
OnOff ::= INTEGER {
|
||||
off (0),
|
||||
on (1)
|
||||
}
|
||||
|
||||
InputAlarmState ::= INTEGER {
|
||||
normal (0),
|
||||
alarm (1)
|
||||
}
|
||||
|
||||
IOName ::= DisplayString (SIZE (0..16))
|
||||
|
||||
SensorState ::= INTEGER {
|
||||
invalid (0),
|
||||
normal (1),
|
||||
@@ -49,7 +61,8 @@ hwgroup OBJECT IDENTIFIER ::= { enterprises 21796 }
|
||||
x390 OBJECT IDENTIFIER ::= { hwgroup 4 }
|
||||
ste OBJECT IDENTIFIER ::= { x390 1 }
|
||||
|
||||
-- Application Info
|
||||
-- Application Info ------------------------------------------------------------
|
||||
|
||||
info OBJECT IDENTIFIER ::= { ste 70 }
|
||||
|
||||
infoAddressMAC OBJECT-TYPE
|
||||
@@ -61,7 +74,67 @@ infoAddressMAC OBJECT-TYPE
|
||||
It is here to distinguish devices in trap messages."
|
||||
::= { info 1 }
|
||||
|
||||
-- Table has to be last in a branch to satisfy snmp walk engine implementation
|
||||
-- Input Dry Contacts ----------------------------------------------------------
|
||||
|
||||
inpTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF InpEntry
|
||||
ACCESS not-accessible
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"A list of binary input entries."
|
||||
::= { ste 1 }
|
||||
|
||||
inpEntry OBJECT-TYPE
|
||||
SYNTAX InpEntry
|
||||
ACCESS not-accessible
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"An entry containing information applicable
|
||||
to a particular binary input."
|
||||
INDEX { inpIndex }
|
||||
::= { inpTable 1 }
|
||||
|
||||
InpEntry ::= SEQUENCE {
|
||||
inpIndex PositiveInteger,
|
||||
inpValue OnOff,
|
||||
inpName IOName,
|
||||
inpAlarmState InputAlarmState
|
||||
}
|
||||
|
||||
inpIndex OBJECT-TYPE
|
||||
SYNTAX PositiveInteger
|
||||
ACCESS not-accessible
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"The binary input index."
|
||||
::= { inpEntry 1 }
|
||||
|
||||
inpValue OBJECT-TYPE
|
||||
SYNTAX OnOff
|
||||
ACCESS read-only
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"The binary input value."
|
||||
::= { inpEntry 2 }
|
||||
|
||||
inpName OBJECT-TYPE
|
||||
SYNTAX IOName
|
||||
ACCESS read-only
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"The binary input name."
|
||||
::= { inpEntry 3 }
|
||||
|
||||
inpAlarmState OBJECT-TYPE
|
||||
SYNTAX InputAlarmState
|
||||
ACCESS read-only
|
||||
STATUS mandatory
|
||||
DESCRIPTION
|
||||
"The binary input alarm state."
|
||||
::= { inpEntry 4 }
|
||||
|
||||
-- Sensors ---------------------------------------------------------------------
|
||||
|
||||
sensTable OBJECT-TYPE
|
||||
SYNTAX SEQUENCE OF SensEntry
|
||||
ACCESS not-accessible
|
||||
@@ -158,3 +231,4 @@ sensID OBJECT-TYPE
|
||||
::= { sensEntry 8 }
|
||||
|
||||
END
|
||||
|
||||
|
Reference in New Issue
Block a user