mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added power and temperature sensors for Extreme hardware (xos)
This commit is contained in:
27
includes/discovery/power/extreme.inc.php
Normal file
27
includes/discovery/power/extreme.inc.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observium
|
||||||
|
*
|
||||||
|
* This file is part of Observium.
|
||||||
|
*
|
||||||
|
* @package observium
|
||||||
|
* @subpackage discovery
|
||||||
|
* @copyright (C) 2006-2014 Adam Armstrong
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo(" EXTREME-BASE-MIB ");
|
||||||
|
|
||||||
|
// Power Usage
|
||||||
|
$descr = "Power Usage";
|
||||||
|
$oid = "1.3.6.1.4.1.1916.1.1.1.40.1.0"; // extremeSystemPowerUsage
|
||||||
|
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||||
|
$divisor = "1000";
|
||||||
|
$value = ($value / $divisor); // Nasty hack to divide the first value by 1000 since the divisor only works for polling after the sensor has been added
|
||||||
|
|
||||||
|
if (is_numeric($value) && $value > 0) {
|
||||||
|
discover_sensor($valid['sensor'], 'power', $device, $oid, '1', 'extreme-power', $descr, $divisor, 1, null, null, null, null, $value); // No limits have been specified since all equipment is different and will use different amount of Watts
|
||||||
|
}
|
||||||
|
|
||||||
|
// EOF
|
21
includes/discovery/temperatures/extreme.inc.php
Normal file
21
includes/discovery/temperatures/extreme.inc.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($device['os'] == 'xos') {
|
||||||
|
echo(" EXTREME-BASE-MIB ");
|
||||||
|
|
||||||
|
// Chassis temperature
|
||||||
|
$high_limit = 65;
|
||||||
|
$high_warn_limit = 55;
|
||||||
|
$low_warn_limit = 15;
|
||||||
|
$low_limit = 5;
|
||||||
|
|
||||||
|
$descr = "Chassis Temperature";
|
||||||
|
$oid = "1.3.6.1.4.1.1916.1.1.1.8.0"; // extremeCurrentTemperature
|
||||||
|
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||||
|
|
||||||
|
if (is_numeric($value) && $value > 0) {
|
||||||
|
discover_sensor($valid['sensor'], 'temperature', $device, $oid, 1, 'extreme-temp', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EOF
|
Reference in New Issue
Block a user