mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Finished dell rac support and updated mib
This commit is contained in:
9
html/includes/graphs/device/state.inc.php
Normal file
9
html/includes/graphs/device/state.inc.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$class = "state";
|
||||||
|
$unit = "";
|
||||||
|
$unit_long = "State";
|
||||||
|
|
||||||
|
include("includes/graphs/device/sensor.inc.php");
|
||||||
|
|
||||||
|
?>
|
17
html/includes/graphs/sensor/state.inc.php
Normal file
17
html/includes/graphs/sensor/state.inc.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$scale_min = "0";
|
||||||
|
$scale_max = "10";
|
||||||
|
|
||||||
|
include("includes/graphs/common.inc.php");
|
||||||
|
|
||||||
|
$rrd_options .= " COMMENT:' Min Max Last\\n'";
|
||||||
|
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||||
|
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],21)."'";
|
||||||
|
$rrd_options .= " GPRINT:sensor:MIN:%4.1lf";
|
||||||
|
$rrd_options .= " GPRINT:sensor:MAX:%4.1lf";
|
||||||
|
$rrd_options .= " GPRINT:sensor:LAST:%4.1lf\\\\l";
|
||||||
|
|
||||||
|
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
|
||||||
|
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
|
||||||
|
|
@ -14,6 +14,7 @@ $current = dbFetchCell("select count(*) from sensors WHERE sensor_class='cu
|
|||||||
$freqs = dbFetchCell("select count(*) from sensors WHERE sensor_class='frequency' AND device_id = ?", array($device['device_id']));
|
$freqs = dbFetchCell("select count(*) from sensors WHERE sensor_class='frequency' AND device_id = ?", array($device['device_id']));
|
||||||
$power = dbFetchCell("select count(*) from sensors WHERE sensor_class='power' AND device_id = ?", array($device['device_id']));
|
$power = dbFetchCell("select count(*) from sensors WHERE sensor_class='power' AND device_id = ?", array($device['device_id']));
|
||||||
$dBm = dbFetchCell("select count(*) from sensors WHERE sensor_class='dBm' AND device_id = ?", array($device['device_id']));
|
$dBm = dbFetchCell("select count(*) from sensors WHERE sensor_class='dBm' AND device_id = ?", array($device['device_id']));
|
||||||
|
$states = dbFetchCell("select count(*) from sensors WHERE sensor_class='state' AND device_id = ?", array($device['device_id']));
|
||||||
|
|
||||||
unset($datas);
|
unset($datas);
|
||||||
$datas[] = 'overview';
|
$datas[] = 'overview';
|
||||||
@ -30,6 +31,7 @@ if ($freqs) { $datas[] = 'frequency'; }
|
|||||||
if ($current) { $datas[] = 'current'; }
|
if ($current) { $datas[] = 'current'; }
|
||||||
if ($power) { $datas[] = 'power'; }
|
if ($power) { $datas[] = 'power'; }
|
||||||
if ($dBm) { $datas[] = 'dbm'; }
|
if ($dBm) { $datas[] = 'dbm'; }
|
||||||
|
if ($states) { $datas[] = 'state'; }
|
||||||
|
|
||||||
$type_text['overview'] = "Overview";
|
$type_text['overview'] = "Overview";
|
||||||
$type_text['charge'] = "Battery Charge";
|
$type_text['charge'] = "Battery Charge";
|
||||||
@ -45,6 +47,7 @@ $type_text['frequency'] = "Frequency";
|
|||||||
$type_text['current'] = "Current";
|
$type_text['current'] = "Current";
|
||||||
$type_text['power'] = "Power";
|
$type_text['power'] = "Power";
|
||||||
$type_text['dbm'] = "dBm";
|
$type_text['dbm'] = "dBm";
|
||||||
|
$type_text['state'] = "State";
|
||||||
|
|
||||||
$link_array = array('page' => 'device',
|
$link_array = array('page' => 'device',
|
||||||
'device' => $device['device_id'],
|
'device' => $device['device_id'],
|
||||||
|
7
html/pages/device/health/state.inc.php
Normal file
7
html/pages/device/health/state.inc.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$class = "state";
|
||||||
|
$unit = "";
|
||||||
|
$graph_type = "sensor_state";
|
||||||
|
|
||||||
|
include("sensors.inc.php");
|
@ -19,5 +19,6 @@ include("includes/discovery/power.inc.php");
|
|||||||
include("includes/discovery/fanspeeds.inc.php");
|
include("includes/discovery/fanspeeds.inc.php");
|
||||||
include("includes/discovery/charge.inc.php");
|
include("includes/discovery/charge.inc.php");
|
||||||
include("includes/discovery/load.inc.php");
|
include("includes/discovery/load.inc.php");
|
||||||
|
include "includes/discovery/states.inc.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
26
includes/discovery/states.inc.php
Normal file
26
includes/discovery/states.inc.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LibreNMS
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo "States: ";
|
||||||
|
|
||||||
|
$include_dir = "includes/discovery/states";
|
||||||
|
include("includes/include-dir.inc.php");
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
print_r($valid['sensor']['states']);
|
||||||
|
}
|
||||||
|
|
||||||
|
check_valid_sensors($device, 'states', $valid['sensor']);
|
||||||
|
|
||||||
|
echo "\n";
|
31
includes/discovery/states/dell.inc.php
Normal file
31
includes/discovery/states/dell.inc.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LibreNMS
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($device['os'] == "linux") {
|
||||||
|
$oids = snmp_walk($device, "virtualDiskNumber", "-Oesqn", "StorageManagement-MIB");
|
||||||
|
$main_oid = ".1.3.6.1.4.1.674.10893.1.20.140.1.1.";
|
||||||
|
if ($debug) {
|
||||||
|
echo $oids."\n";
|
||||||
|
}
|
||||||
|
$oids = trim($oids);
|
||||||
|
if ($oids) {
|
||||||
|
echo "Dell ";
|
||||||
|
foreach (explode("\n", $oids) as $data) {
|
||||||
|
list($oid,) = explode(" ", $data, 2);
|
||||||
|
$state_oid = "4.1";
|
||||||
|
$state_current = snmp_get($device, $main_oid.$state_oid, "-Oevq");
|
||||||
|
discover_sensor($valid['sensor'], 'state', $device, $main_oid.$state_oid, "virtualDiskState.$state_oid", 'dell', 'Raid State', '1', '1', NULL, NULL, NULL, NULL, $state_current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -34,6 +34,8 @@ function poll_sensor($device, $class, $unit)
|
|||||||
sleep(1); # Give the TME some time to reset
|
sleep(1); # Give the TME some time to reset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif ($class == "state") {
|
||||||
|
$sensor_value = trim(str_replace("\"", "", snmp_walk($device, $sensor['sensor_oid'], "-Oevq", "SNMPv2-MIB")));
|
||||||
} else {
|
} else {
|
||||||
if ($sensor['sensor_type'] == 'apc') {
|
if ($sensor['sensor_type'] == 'apc') {
|
||||||
$sensor_value = trim(str_replace("\"", "", snmp_walk($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB:PowerNet-MIB$mib")));
|
$sensor_value = trim(str_replace("\"", "", snmp_walk($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB:PowerNet-MIB$mib")));
|
||||||
|
@ -22,7 +22,8 @@ $supported_sensors = array('current' => 'A',
|
|||||||
'temperature' => 'C',
|
'temperature' => 'C',
|
||||||
'dbm' => 'dBm',
|
'dbm' => 'dBm',
|
||||||
'charge' => '%',
|
'charge' => '%',
|
||||||
'load' => '%'
|
'load' => '%',
|
||||||
|
'state' => '#',
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($supported_sensors as $sensor_type => $sensor_unit)
|
foreach ($supported_sensors as $sensor_type => $sensor_unit)
|
||||||
|
2842
mibs/DELL-RAC-MIB
2842
mibs/DELL-RAC-MIB
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user