mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Add support for APC Netbotz 200 (#4443)
Unfortunately, it is clobbered by other devices because it returns a value for all sorts of snmpget requests
This commit is contained in:
committed by
Neil Lathwood
parent
d2193f76ca
commit
6d93dc0572
@@ -1,16 +1,14 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysDescr, 'APC Web/SNMP Management Card')) {
|
||||
$os = 'apc';
|
||||
}
|
||||
if (strstr($sysDescr, 'APC Switched Rack PDU')) {
|
||||
$os = 'apc';
|
||||
}
|
||||
if (strstr($sysDescr, 'APC MasterSwitch PDU')) {
|
||||
$os = 'apc';
|
||||
}
|
||||
if (strstr($sysDescr, 'APC Metered Rack PDU')) {
|
||||
$apcDesc = array(
|
||||
'APC Web/SNMP Management Card',
|
||||
'APC Switched Rack PDU',
|
||||
'APC MasterSwitch PDU',
|
||||
'APC Metered Rack PDU',
|
||||
);
|
||||
|
||||
if (str_contains($sysDescr, $apcDesc)) {
|
||||
$os = 'apc';
|
||||
}
|
||||
}
|
||||
|
@@ -21,4 +21,22 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', array(), 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
if ($apc_env_data[$index]['emsProbeStatusProbeCommStatus'] != 'commsNeverDiscovered') {
|
||||
$descr = $apc_env_data[$index]['emsProbeStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['emsProbeStatusProbeHumidity'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.' . $index;
|
||||
$low_limit = $apc_env_data[$index]['emsProbeStatusProbeMinHumidityThresh'];
|
||||
$low_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeLowHumidityThresh'];
|
||||
$high_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeHighHumidityThresh'];
|
||||
$high_limit = $apc_env_data[$index]['emsProbeStatusProbeMaxHumidityThresh'];
|
||||
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
|
@@ -33,23 +33,22 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
|
||||
/*
|
||||
[iemConfigProbeHighHumidThreshold] => -1
|
||||
[iemConfigProbeLowHumidThreshold] => -1
|
||||
[iemConfigProbeHighHumidEnable] => disabled
|
||||
[iemConfigProbeLowHumidEnable] => disabled
|
||||
[iemConfigProbeMaxHumidThreshold] => -1
|
||||
[iemConfigProbeMinHumidThreshold] => -1
|
||||
[iemConfigProbeMaxHumidEnable] => disabled
|
||||
[iemConfigProbeMinHumidEnable] => disabled
|
||||
[iemConfigProbeHumidHysteresis] => -1
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', array(), 'PowerNet-MIB');
|
||||
|
||||
[iemStatusProbeStatus] => connected
|
||||
[iemStatusProbeCurrentTemp] => 25
|
||||
[iemStatusProbeTempUnits] => celsius
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
if ($apc_env_data[$index]['emsProbeStatusProbeCommStatus'] != 'commsNeverDiscovered') {
|
||||
$descr = $apc_env_data[$index]['emsProbeStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['emsProbeStatusProbeTemperature'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.3.' . $index;
|
||||
$low_limit = $apc_env_data[$index]['emsProbeStatusProbeMinTempThresh'];
|
||||
$low_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeLowTempThresh'];
|
||||
$high_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeHighTempThresh'];
|
||||
$high_limit = $apc_env_data[$index]['emsProbeStatusProbeMaxTempThresh'];
|
||||
|
||||
[iemStatusProbeCurrentHumid] => 0
|
||||
*/
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
// InRow Chiller.
|
||||
// A silly check to find out if it's the right hardware.
|
||||
|
@@ -75,6 +75,14 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('airos-af', 'Linux', '.1.3.6.1.4.1.10002.1', $mockSnmp);
|
||||
}
|
||||
|
||||
public function testApc()
|
||||
{
|
||||
$this->checkOS('apc', 'APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.5.9 PN:apc_hw03_aos_359.bin AF1:v3.5.6 AN1:apc_hw03_nb200_356.bin MN:NBRK0200 HR:05 SN: FFFFFFFFFFFF MD:07/07/2012)', '.1.3.6.1.4.1.318.1.3.8.4');
|
||||
$this->checkOS('apc', 'APC Switched Rack PDU');
|
||||
$this->checkOS('apc', 'APC MasterSwitch PDU');
|
||||
$this->checkOS('apc', 'APC Metered Rack PDU');
|
||||
}
|
||||
|
||||
public function testAxiscam()
|
||||
{
|
||||
$this->checkOS('axiscam', ' ; AXIS 221; Network Camera; 4.30; Nov 29 2005 11:18; 141; 1;');
|
||||
|
Reference in New Issue
Block a user