mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
device/health page improvements and sentry3 and tripplite fixes from falz
git-svn-id: http://www.observium.org/svn/observer/trunk@2041 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -13,27 +13,27 @@ $current = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_c
|
||||
$freqs = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='freq' AND device_id = '" . $device['device_id'] . "'"), 0);
|
||||
|
||||
$datas[] = 'overview';
|
||||
if ($processor) { $datas[] = 'processors'; }
|
||||
if ($mempools) { $datas[] = 'mempools'; }
|
||||
if ($processor) { $datas[] = 'processor'; }
|
||||
if ($mempools) { $datas[] = 'mempool'; }
|
||||
if ($storage) { $datas[] = 'storage'; }
|
||||
if ($diskio) { $datas[] = 'diskio'; }
|
||||
if ($temperatures) { $datas[] = 'temperatures'; }
|
||||
if ($temperatures) { $datas[] = 'temperature'; }
|
||||
if ($humidity) { $datas[] = 'humidity'; }
|
||||
if ($fans) { $datas[] = 'fanspeeds'; }
|
||||
if ($volts) { $datas[] = 'voltages'; }
|
||||
if ($freqs) { $datas[] = 'frequencies'; }
|
||||
if ($fans) { $datas[] = 'fanspeed'; }
|
||||
if ($volts) { $datas[] = 'voltage'; }
|
||||
if ($freqs) { $datas[] = 'frequency'; }
|
||||
if ($current) { $datas[] = 'current'; }
|
||||
|
||||
$type_text['overview'] = "Overview";
|
||||
$type_text['temperatures'] = "Temperatures";
|
||||
$type_text['temperature'] = "Temperature";
|
||||
$type_text['humidity'] = "Humidity";
|
||||
$type_text['mempools'] = "Memory Pools";
|
||||
$type_text['mempool'] = "Memory";
|
||||
$type_text['storage'] = "Disk Usage";
|
||||
$type_text['diskio'] = "Disk I/O";
|
||||
$type_text['processors'] = "Processor Usage";
|
||||
$type_text['voltages'] = "Voltages";
|
||||
$type_text['fanspeeds'] = "Fan Speeds";
|
||||
$type_text['frequencies'] = "Frequencies";
|
||||
$type_text['processor'] = "Processor";
|
||||
$type_text['voltage'] = "Voltages";
|
||||
$type_text['fanspeed'] = "Fanspeed";
|
||||
$type_text['frequency'] = "Frequency";
|
||||
$type_text['current'] = "Current";
|
||||
|
||||
print_optionbar_start();
|
||||
@@ -47,13 +47,13 @@ foreach ($datas as $type)
|
||||
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("<strong>");
|
||||
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
||||
echo('<span class="pagemenu-selected">');
|
||||
# echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
|
||||
} else {
|
||||
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
# echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
}
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/health/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/health/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>");
|
||||
if ($_GET['opta'] == $type) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
||||
@@ -74,4 +74,4 @@ if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php"))
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -28,33 +28,3 @@ if ($device['os'] == "sentry3")
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
if ($device['os'] == "sentry3")
|
||||
{
|
||||
$oids = snmp_walk($device, "infeedVoltage", "-OsqnU", "Sentry3-MIB");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
if ($oids) echo("Sentry3-MIB ");
|
||||
$divisor = 10;
|
||||
$type = "sentry3";
|
||||
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
{
|
||||
list($oid,$descr) = explode(" ", $data,2);
|
||||
$split_oid = explode('.',$oid);
|
||||
$descr = "Tower " . $index;
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.1718.3.2.2.1.11." . $index . ".1";
|
||||
$current = snmp_get($device, $oid, "-Oqv") / $divisor;
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -688,7 +688,7 @@ $config['os'][$os]['text'] = "Tripp Lite PowerAlert";
|
||||
$config['os'][$os]['type'] = "power";
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_current";
|
||||
$config['os'][$os]['over'][0]['text'] = "Current";
|
||||
$config['os'][$os]['icon'] = "poweralert";
|
||||
$config['os'][$os]['icon'] = "tripplite";
|
||||
|
||||
|
||||
$device_types = array('server', 'network', 'firewall', 'workstation', 'printer', 'power', 'environment');
|
||||
|
||||
Reference in New Issue
Block a user