Add basic support for Emerson Netsure Controllers (#12091)

This commit is contained in:
craig-nokia 2020-09-14 07:03:35 +10:00 committed by GitHub
parent fde6ef5f3f
commit dda6377424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3667 additions and 0 deletions

38
LibreNMS/OS/Netsure.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/**
* Netsure.php
*
* Emerson Power Vortex Controllers
*
* 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
* @author Craig Harris
*/
namespace LibreNMS\OS;
use LibreNMS\Interfaces\Discovery\OSDiscovery;
use LibreNMS\OS;
class Netsure extends OS implements OSDiscovery
{
public function discoverOS(): void
{
$device = $this->getDeviceModel();
$info = snmp_getnext_multi($this->getDevice(), 'vecFirmwareVersion', '-OQUs', 'VEC-MIBv5-9');
$device->version = $info['vecFirmwareVersion'];
}
}

View File

@ -1183,6 +1183,7 @@ function fahrenheit_to_celsius($value, $scale = 'fahrenheit')
* @param string $scale fahrenheit or celsius
* @return string (containing a float)
*/
function celsius_to_fahrenheit($value, $scale = 'celsius')
{
if ($scale === 'celsius') {
@ -1191,6 +1192,15 @@ function celsius_to_fahrenheit($value, $scale = 'celsius')
return sprintf('%.02f', $value);
}
/**
* Converts string to float
*
*/
function string_to_float($value)
{
return sprintf('%.02f', $value);
}
/**
* Converts uW to dBm
* $value must be positive

View File

@ -0,0 +1,64 @@
mib: VEC-MIBv5-9
modules:
sensors:
state:
data:
-
oid: psHighestSeverityLevel
num_oid: '.1.3.6.1.4.1.885.3.2.1.10.0'
descr: 'System Status'
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: minor, graph: 1, value: 1, generic: 1 }
- { descr: major, graph: 1, value: 2, generic: 2 }
voltage:
data:
-
oid: psSenseVoltage
num_oid: '.1.3.6.1.4.1.885.3.2.1.5.{{ $index }}'
index: 'psSenseVoltage.{{ $index }}'
descr: 'Sense DC Voltage'
low_limit: 45.0
low_warn_limit: 50.0
warn_limit: 56.5
high_limit: 58.0
-
oid: psSystemVoltage
num_oid: '.1.3.6.1.4.1.885.3.2.1.1.{{ $index }}'
index: 'psSystemVoltage.{{ $index }}'
descr: 'System DC Voltage'
low_limit: 45.0
low_warn_limit: 50.0
warn_limit: 56.5
high_limit: 58.0
current:
data:
-
oid: psSystemCurrent
num_oid: '.1.3.6.1.4.1.885.3.2.1.2.{{ $index }}'
index: 'psSystemCurrent.{{ $index }}'
descr: 'System Current'
-
oid: psPCUTotalCurrent
num_oid: '.1.3.6.1.4.1.885.3.2.1.6.{{ $index }}'
index: 'psPCUTotalCurrent.{{ $index }}'
descr: 'Total PCU Current'
user_func: string_to_float
-
oid: psBatteryCurrent
num_oid: '.1.3.6.1.4.1.885.3.2.1.7.{{ $index }}'
index: 'psBatteryCurrent.{{ $index }}'
descr: 'Total Battery Current'
user_func: string_to_float
-
oid: psDistributionTable
num_oid: '.1.3.6.1.4.1.885.3.2.4.1.2.{{ $index }}'
value: psShuntCurrent
index: 'psShuntCurrent.{{ $index }}'
descr: 'Shunt Current #{{ $index }}'
user_func: string_to_float
-
oid: psPCUCurrent
num_oid: '.1.3.6.1.4.1.885.3.2.5.1.3.{{ $index }}'
index: 'psPCUCurrent.{{ $index }}'
descr: 'PCU Current #{{ $index }}'

View File

@ -0,0 +1,40 @@
os: netsure
text: 'Emerson Netsure'
type: power
icon: emerson
over:
- { graph: device_current, text: Current }
- { graph: device_voltage, text: Voltage }
- { graph: device_state, text: State }
mib_dir: emerson
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.885.3
discovery_modules:
storage: false
bgp-peers: false
ntp: false
stp: false
diskio: false
vlans: false
arp-table: false
discovery-protocols: false
hr-device: false
mempools: false
entity-physical: false
ports-stack: false
ucd-diskio: false
processors: false
mpls: false
wireless: false
fdb-table: false
services: false
cisco-vrf-lite: false
poller_modules:
ospf: false
ntp: false
services: false
storage: false
ucd-diskio: false
mpls: false

1132
mibs/emerson/VEC-MIBv5-9 Normal file

File diff suppressed because it is too large Load Diff

2134
tests/data/netsure.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,249 @@
1.3.6.1.2.1.1.1.0|4|Emerson Vortex Power System
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.885.3
1.3.6.1.2.1.1.3.0|67|1576133521
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.2.1.2.2.1.1.1|2|1
1.3.6.1.2.1.2.2.1.1.2|2|2
1.3.6.1.2.1.2.2.1.2.1|4|
1.3.6.1.2.1.2.2.1.2.2|4|
1.3.6.1.2.1.2.2.1.3.1|2|24
1.3.6.1.2.1.2.2.1.3.2|2|6
1.3.6.1.2.1.2.2.1.4.1|2|65535
1.3.6.1.2.1.2.2.1.4.2|2|1500
1.3.6.1.2.1.2.2.1.5.1|66|0
1.3.6.1.2.1.2.2.1.5.2|66|10000000
1.3.6.1.2.1.2.2.1.6.1|4|
1.3.6.1.2.1.2.2.1.6.2|4x|00C09B60FCB0
1.3.6.1.2.1.2.2.1.7.1|2|1
1.3.6.1.2.1.2.2.1.7.2|2|1
1.3.6.1.2.1.2.2.1.8.1|2|1
1.3.6.1.2.1.2.2.1.8.2|2|1
1.3.6.1.2.1.2.2.1.9.1|67|0
1.3.6.1.2.1.2.2.1.9.2|67|0
1.3.6.1.2.1.2.2.1.10.1|65|0
1.3.6.1.2.1.2.2.1.10.2|65|3756866681
1.3.6.1.2.1.2.2.1.11.1|65|0
1.3.6.1.2.1.2.2.1.11.2|65|26682060
1.3.6.1.2.1.2.2.1.12.1|65|0
1.3.6.1.2.1.2.2.1.12.2|65|1362679
1.3.6.1.2.1.2.2.1.13.1|65|0
1.3.6.1.2.1.2.2.1.13.2|65|0
1.3.6.1.2.1.2.2.1.14.1|65|0
1.3.6.1.2.1.2.2.1.14.2|65|0
1.3.6.1.2.1.2.2.1.15.1|65|0
1.3.6.1.2.1.2.2.1.15.2|65|0
1.3.6.1.2.1.2.2.1.16.1|65|0
1.3.6.1.2.1.2.2.1.16.2|65|3624523089
1.3.6.1.2.1.2.2.1.17.1|65|0
1.3.6.1.2.1.2.2.1.17.2|65|23536097
1.3.6.1.2.1.2.2.1.18.1|65|0
1.3.6.1.2.1.2.2.1.18.2|65|14602
1.3.6.1.2.1.2.2.1.19.1|65|0
1.3.6.1.2.1.2.2.1.19.2|65|0
1.3.6.1.2.1.2.2.1.20.1|65|0
1.3.6.1.2.1.2.2.1.20.2|65|0
1.3.6.1.2.1.2.2.1.21.1|66|0
1.3.6.1.2.1.2.2.1.21.2|66|0
1.3.6.1.2.1.2.2.1.22.1|6|0.0
1.3.6.1.2.1.2.2.1.22.2|6|0.0
1.3.6.1.2.1.4.3.0|65|26737904
1.3.6.1.2.1.4.4.0|65|10
1.3.6.1.2.1.4.5.0|65|702
1.3.6.1.2.1.4.6.0|65|0
1.3.6.1.2.1.4.7.0|65|0
1.3.6.1.2.1.4.8.0|65|0
1.3.6.1.2.1.4.9.0|65|26737191
1.3.6.1.2.1.4.10.0|65|23534865
1.3.6.1.2.1.4.11.0|65|0
1.3.6.1.2.1.4.12.0|65|0
1.3.6.1.2.1.4.14.0|65|0
1.3.6.1.2.1.4.15.0|65|0
1.3.6.1.2.1.4.16.0|65|0
1.3.6.1.2.1.4.17.0|65|25
1.3.6.1.2.1.4.18.0|65|0
1.3.6.1.2.1.4.19.0|65|1125
1.3.6.1.2.1.4.20.1.2.127.0.0.1|2|1
1.3.6.1.2.1.4.20.1.2.192.168.19.6|2|2
1.3.6.1.2.1.4.20.1.3.127.0.0.1|64|255.0.0.0
1.3.6.1.2.1.4.20.1.3.192.168.19.6|64|255.255.255.0
1.3.6.1.2.1.5.1.0|65|414973
1.3.6.1.2.1.5.2.0|65|0
1.3.6.1.2.1.5.3.0|65|3062
1.3.6.1.2.1.5.4.0|65|0
1.3.6.1.2.1.5.5.0|65|0
1.3.6.1.2.1.5.6.0|65|0
1.3.6.1.2.1.5.7.0|65|0
1.3.6.1.2.1.5.8.0|65|411911
1.3.6.1.2.1.5.9.0|65|0
1.3.6.1.2.1.5.10.0|65|0
1.3.6.1.2.1.5.11.0|65|0
1.3.6.1.2.1.5.12.0|65|0
1.3.6.1.2.1.5.13.0|65|0
1.3.6.1.2.1.5.14.0|65|412484
1.3.6.1.2.1.5.15.0|65|0
1.3.6.1.2.1.5.16.0|65|573
1.3.6.1.2.1.5.17.0|65|0
1.3.6.1.2.1.5.18.0|65|0
1.3.6.1.2.1.5.19.0|65|0
1.3.6.1.2.1.5.20.0|65|0
1.3.6.1.2.1.5.21.0|65|0
1.3.6.1.2.1.5.22.0|65|411911
1.3.6.1.2.1.5.23.0|65|0
1.3.6.1.2.1.5.24.0|65|0
1.3.6.1.2.1.5.25.0|65|0
1.3.6.1.2.1.5.26.0|65|0
1.3.6.1.2.1.6.5.0|65|0
1.3.6.1.2.1.6.6.0|65|487646
1.3.6.1.2.1.6.7.0|65|0
1.3.6.1.2.1.6.8.0|65|0
1.3.6.1.2.1.6.9.0|66|2
1.3.6.1.2.1.6.10.0|65|23358754
1.3.6.1.2.1.6.11.0|65|19553375
1.3.6.1.2.1.6.12.0|65|668780
1.3.6.1.2.1.6.14.0|65|0
1.3.6.1.2.1.6.15.0|65|0
1.3.6.1.2.1.7.1.0|65|2893056
1.3.6.1.2.1.7.2.0|65|70441
1.3.6.1.2.1.7.3.0|65|0
1.3.6.1.2.1.7.4.0|65|2900256
1.3.6.1.2.1.11.1.0|65|2893041
1.3.6.1.2.1.11.2.0|65|2893040
1.3.6.1.2.1.11.3.0|65|0
1.3.6.1.2.1.11.4.0|65|0
1.3.6.1.2.1.11.5.0|65|0
1.3.6.1.2.1.11.6.0|65|0
1.3.6.1.2.1.11.8.0|65|0
1.3.6.1.2.1.11.9.0|65|0
1.3.6.1.2.1.11.10.0|65|0
1.3.6.1.2.1.11.11.0|65|0
1.3.6.1.2.1.11.12.0|65|0
1.3.6.1.2.1.11.13.0|65|19310259
1.3.6.1.2.1.11.14.0|65|0
1.3.6.1.2.1.11.15.0|65|1147036
1.3.6.1.2.1.11.16.0|65|316012
1.3.6.1.2.1.11.17.0|65|0
1.3.6.1.2.1.11.18.0|65|0
1.3.6.1.2.1.11.19.0|65|0
1.3.6.1.2.1.11.20.0|65|0
1.3.6.1.2.1.11.21.0|65|0
1.3.6.1.2.1.11.22.0|65|0
1.3.6.1.2.1.11.24.0|65|0
1.3.6.1.2.1.11.25.0|65|0
1.3.6.1.2.1.11.26.0|65|0
1.3.6.1.2.1.11.27.0|65|0
1.3.6.1.2.1.11.28.0|65|2893042
1.3.6.1.2.1.11.29.0|65|3600
1.3.6.1.2.1.11.30.0|2|2
1.3.6.1.4.1.885.3.1.1.0|4|4.0.0.1
1.3.6.1.4.1.885.3.2.1.1.0|4|54.01
1.3.6.1.4.1.885.3.2.1.2.0|2|1580
1.3.6.1.4.1.885.3.2.1.5.0|4|54.01
1.3.6.1.4.1.885.3.2.1.6.0|4|1576
1.3.6.1.4.1.885.3.2.1.7.0|4|0.00
1.3.6.1.4.1.885.3.2.1.10.0|2|0
1.3.6.1.4.1.885.3.2.4.1.1.1|2|1
1.3.6.1.4.1.885.3.2.4.1.1.2|2|2
1.3.6.1.4.1.885.3.2.4.1.1.3|2|3
1.3.6.1.4.1.885.3.2.4.1.1.4|2|4
1.3.6.1.4.1.885.3.2.4.1.1.5|2|5
1.3.6.1.4.1.885.3.2.4.1.1.6|2|6
1.3.6.1.4.1.885.3.2.4.1.1.7|2|7
1.3.6.1.4.1.885.3.2.4.1.1.8|2|8
1.3.6.1.4.1.885.3.2.4.1.2.1|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1.3.6.1.4.1.885.3.2.5.1.3.12|2|22
1.3.6.1.4.1.885.3.2.5.1.3.13|2|21
1.3.6.1.4.1.885.3.2.5.1.3.14|2|21
1.3.6.1.4.1.885.3.2.5.1.3.15|2|21
1.3.6.1.4.1.885.3.2.5.1.3.16|2|22
1.3.6.1.4.1.885.3.2.5.1.3.17|2|22
1.3.6.1.4.1.885.3.2.5.1.3.18|2|22
1.3.6.1.4.1.885.3.2.5.1.3.19|2|21
1.3.6.1.4.1.885.3.2.5.1.3.20|2|20
1.3.6.1.4.1.885.3.2.5.1.3.21|2|22
1.3.6.1.4.1.885.3.2.5.1.3.22|2|21
1.3.6.1.4.1.885.3.2.5.1.3.23|2|22
1.3.6.1.4.1.885.3.2.5.1.3.24|2|22
1.3.6.1.4.1.885.3.2.5.1.3.25|2|22
1.3.6.1.4.1.885.3.2.5.1.3.26|2|22
1.3.6.1.4.1.885.3.2.5.1.3.27|2|22
1.3.6.1.4.1.885.3.2.5.1.3.28|2|23
1.3.6.1.4.1.885.3.2.5.1.3.29|2|22
1.3.6.1.4.1.885.3.2.5.1.3.30|2|21
1.3.6.1.4.1.885.3.2.5.1.3.31|2|21
1.3.6.1.4.1.885.3.2.5.1.3.32|2|22
1.3.6.1.4.1.885.3.2.5.1.3.33|2|22
1.3.6.1.4.1.885.3.2.5.1.3.34|2|22
1.3.6.1.4.1.885.3.2.5.1.3.35|2|22
1.3.6.1.4.1.885.3.2.5.1.3.36|2|21
1.3.6.1.4.1.885.3.2.5.1.3.41|2|22
1.3.6.1.4.1.885.3.2.5.1.3.42|2|21
1.3.6.1.4.1.885.3.2.5.1.3.43|2|21
1.3.6.1.4.1.885.3.2.5.1.3.44|2|21
1.3.6.1.4.1.885.3.2.5.1.3.45|2|21
1.3.6.1.4.1.885.3.2.5.1.3.46|2|20
1.3.6.1.4.1.885.3.2.5.1.3.47|2|22
1.3.6.1.4.1.885.3.2.5.1.3.48|2|22
1.3.6.1.4.1.885.3.2.5.1.3.49|2|22
1.3.6.1.4.1.885.3.2.5.1.3.50|2|21
1.3.6.1.4.1.885.3.2.5.1.3.51|2|21
1.3.6.1.4.1.885.3.2.5.1.3.52|2|22
1.3.6.1.4.1.885.3.2.5.1.3.53|2|22
1.3.6.1.4.1.885.3.2.5.1.3.54|2|22
1.3.6.1.4.1.885.3.2.5.1.3.55|2|21
1.3.6.1.4.1.885.3.2.5.1.3.56|2|21
1.3.6.1.4.1.885.3.2.5.1.3.57|2|20
1.3.6.1.4.1.885.3.2.5.1.3.58|2|22
1.3.6.1.4.1.885.3.2.5.1.3.59|2|21
1.3.6.1.4.1.885.3.2.5.1.3.60|2|22
1.3.6.1.4.1.885.3.2.5.1.3.61|2|21
1.3.6.1.4.1.885.3.2.5.1.3.62|2|21
1.3.6.1.4.1.885.3.2.5.1.3.63|2|22
1.3.6.1.4.1.885.3.2.5.1.3.64|2|21
1.3.6.1.4.1.885.3.2.5.1.3.65|2|22
1.3.6.1.4.1.885.3.2.5.1.3.66|2|22
1.3.6.1.4.1.885.3.2.5.1.3.67|2|21
1.3.6.1.4.1.885.3.2.5.1.3.68|2|22
1.3.6.1.4.1.885.3.2.5.1.3.69|2|21
1.3.6.1.4.1.885.3.2.5.1.3.70|2|21
1.3.6.1.4.1.885.3.2.5.1.3.71|2|22
1.3.6.1.4.1.885.3.2.5.1.3.72|2|21
1.3.6.1.4.1.885.3.2.5.1.3.73|2|22
1.3.6.1.4.1.885.3.2.5.1.3.74|2|21
1.3.6.1.4.1.885.3.2.5.1.3.75|2|21
1.3.6.1.4.1.885.3.2.5.1.3.76|2|21