add new IronWare (Brocade/Foundry) OS type. rename temp/fan/voltage_host to device_id

git-svn-id: http://www.observium.org/svn/observer/trunk@830 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-02-13 07:40:43 +00:00
parent 7317b68951
commit 54e8ac3cbd
30 changed files with 573 additions and 82 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

+3 -1
View File
@@ -2,7 +2,9 @@
echo("<div style='font-family: courier, serif; margin: 10px';><strong>" . $device['sysDescr'] . "</strong></div>");
$uptime = @mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0);
# $uptime = @mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0);
$uptime = $device['uptime'];
if(is_file("images/devices/" . $device['hardware'] . ".gif")) {
$dev_img = "<div style='float: left;'><img src='images/devices/" . $device['hardware'] . ".gif' align=absmiddle></img></div>";
@@ -5,7 +5,7 @@ include("common.inc.php");
$rrd_options .= " -l 0 -E ";
$iter = "1";
$sql = mysql_query("SELECT * FROM temperature where temp_host = '$device_id'");
$sql = mysql_query("SELECT * FROM temperature where device_id = '$device_id'");
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
while($temperature = mysql_fetch_array($sql))
{
+1 -1
View File
@@ -8,7 +8,7 @@ include("common.inc.php");
$fanspeed = mysql_fetch_array(mysql_query("SELECT * FROM fanspeed where fan_id = '".mres($_GET['id'])."'"));
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $fanspeed['fan_host'] . "'"),0);
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $fanspeed['device_id'] . "'"),0);
$fanspeed['fan_descr_fixed'] = substr(str_pad($fanspeed['fan_descr'], 28),0,28);
+1 -1
View File
@@ -9,7 +9,7 @@ include("common.inc.php");
$sql = mysql_query("SELECT * FROM temperature where temp_id = '$temp'");
$temperature = mysql_fetch_array(mysql_query("SELECT * FROM temperature where temp_id = '".mres($_GET['id'])."'"));
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $temperature['temp_host'] . "'"),0);
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $temperature['device_id'] . "'"),0);
$temperature['temp_descr_fixed'] = substr(str_pad($temperature['temp_descr'], 28),0,28);
+1 -1
View File
@@ -8,7 +8,7 @@ include("common.inc.php");
$voltage = mysql_fetch_array(mysql_query("SELECT * FROM voltage where volt_id = '".mres($_GET['id'])."'"));
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $voltage['volt_host'] . "'"),0);
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $voltage['device_id'] . "'"),0);
$voltage['volt_descr_fixed'] = substr(str_pad($voltage['volt_descr'], 28),0,28);
+5 -5
View File
@@ -24,7 +24,7 @@
} else { $mac = ""; }
echo("<tr style=\"background-color: $row_colour; padding: 5px;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" onclick=\"location.href='/device/".$device['device_id']."/interface/".$interface['interface_id']."/'\" style='cursor: hand;'>
<td valign=top width=300>");
<td valign=top width=350>");
echo(" <span class=list-large>
" . generateiflink($interface, $interface['ifIndex'] . ". ".$interface['label']) . " $error_img $mac
@@ -66,10 +66,10 @@
$interface['out_rate'] = $interface['ifOutOctets_rate'] * 8;
$in_perc = @round($interface['in_rate']/$interface['ifSpeed']*100);
$out_perc = @round($interface['in_rate']/$interface['ifSpeed']*100);
echo("<img src='images/16/arrow_left.png' align=absmiddle> <span style='color: " . percent_colour($in_perc) . "'>" .
formatRates($interface['in_rate']) . "<br />".format_bi($interface['ifInUcastPkts_rate'])."pps</span><br />");
echo("<img align=absmiddle src='images/16/arrow_out.png'> <span style='color: " . percent_colour($out_perc) . "'>" .
formatRates($interface['out_rate']) . "<br />".format_bi($interface['ifOutUcastPkts_rate'])."pps</span>");
echo("<img src='images/16/arrow_left.png' align=absmiddle> <span style='color: " . percent_colour($in_perc) . "'>".formatRates($interface['in_rate'])."<br />
<img align=absmiddle src='images/16/arrow_out.png'> <span style='color: " . percent_colour($out_perc) . "'>".formatRates($interface['out_rate']) . "<br />
<img src='images/icons/arrow_pps_in.png' align=absmiddle> ".format_bi($interface['ifInUcastPkts_rate'])."pps</span><br />
<img src='images/icons/arrow_pps_out.png' align=absmiddle> ".format_bi($interface['ifOutUcastPkts_rate'])."pps</span>");
}
echo("</td><td width=75>");
+1 -1
View File
@@ -40,7 +40,7 @@ echo('<li class="' . $select['graphs'] . '">
</li>');
$health = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
@@ -1,5 +1,5 @@
<?php
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$graph_title = "Temperatures";
$graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
echo("<br />");
+3 -3
View File
@@ -1,13 +1,13 @@
<?php
$temp = mysql_result(mysql_query("select count(*) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0);
$temp = mysql_result(mysql_query("select count(*) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0);
$storage = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0);
$cemp = mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
$cmp = mysql_result(mysql_query("select count(*) from cmpMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
$cpm = mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
$hrprocessor = mysql_result(mysql_query("select count(*) from hrDevice WHERE device_id = '" . $device['device_id'] . "' AND `hrDeviceType` = 'hrDeviceProcessor'"), 0);
$fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE fan_host = '" . $device['device_id'] . "'"), 0);
$volts = mysql_result(mysql_query("select count(*) from voltage WHERE volt_host = '" . $device['device_id'] . "'"), 0);
$fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0);
$volts = mysql_result(mysql_query("select count(*) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0);
if ($temp) { $datas[] = 'temp'; }
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
$sql = "SELECT * FROM `fanspeed` WHERE fan_host = '" . $_GET[id] . "' ORDER BY fan_descr";
$sql = "SELECT * FROM `fanspeed` WHERE device_id = '" . $_GET[id] . "' ORDER BY fan_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
$sql = "SELECT * FROM `temperature` WHERE temp_host = '" . $_GET[id] . "' ORDER BY temp_descr";
$sql = "SELECT * FROM `temperature` WHERE device_id = '" . $_GET[id] . "' ORDER BY temp_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
$sql = "SELECT * FROM `voltage` WHERE volt_host = '" . $_GET[id] . "' ORDER BY volt_descr";
$sql = "SELECT * FROM `voltage` WHERE device_id = '" . $_GET[id] . "' ORDER BY volt_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
+3 -3
View File
@@ -1,13 +1,13 @@
<?php
unset($fan_seperator);
if(mysql_result(mysql_query("SELECT count(fan_id) from fanspeed WHERE fan_host = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(fan_id) from fanspeed WHERE fan_host = '" . $device['device_id'] . "'"),0);
if(mysql_result(mysql_query("SELECT count(fan_id) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(fan_id) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"),0);
$rows = round($total / 2,0);
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Fanspeeds</p>");
$i = '1';
$fans = mysql_query("SELECT * FROM fanspeed WHERE fan_host = '" . $device['device_id'] . "'");
$fans = mysql_query("SELECT * FROM fanspeed WHERE device_id = '" . $device['device_id'] . "'");
echo("<table width=100% valign=top>");
echo("<tr><td width=50%>");
echo("<table width=100% cellspacing=0 cellpadding=2>");
@@ -1,13 +1,13 @@
<?php
unset($temp_seperator);
if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0);
if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device_id = '" . $device['device_id'] . "'"),0);
$rows = round($total / 2,0);
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Temperatures</p>");
$i = '1';
$temps = mysql_query("SELECT * FROM temperature WHERE temp_host = '" . $device['device_id'] . "'");
$temps = mysql_query("SELECT * FROM temperature WHERE device_id = '" . $device['device_id'] . "'");
echo("<table width=100% valign=top>");
echo("<tr><td width=50%>");
echo("<table width=100% cellspacing=0 cellpadding=2>");
+3 -3
View File
@@ -1,13 +1,13 @@
<?php
unset($volt_seperator);
if(mysql_result(mysql_query("SELECT count(volt_id) from voltage WHERE volt_host = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(volt_id) from voltage WHERE volt_host = '" . $device['device_id'] . "'"),0);
if(mysql_result(mysql_query("SELECT count(volt_id) from voltage WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$total = mysql_result(mysql_query("SELECT count(volt_id) from voltage WHERE device_id = '" . $device['device_id'] . "'"),0);
$rows = round($total / 2,0);
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Voltages</p>");
$i = '1';
$volts = mysql_query("SELECT * FROM voltage WHERE volt_host = '" . $device['device_id'] . "'");
$volts = mysql_query("SELECT * FROM voltage WHERE device_id = '" . $device['device_id'] . "'");
echo("<table width=100% valign=top>");
echo("<tr><td width=50%>");
echo("<table width=100% cellspacing=0 cellpadding=2>");
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
if($_SESSION['userlevel'] >= '5') {
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D WHERE F.fan_host = D.device_id ORDER BY D.hostname, F.fan_descr";
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D WHERE F.device_id = D.device_id ORDER BY D.hostname, F.fan_descr";
} else {
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D, devices_perms as P WHERE F.fan_host = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, F.fan_descr";
$sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D, devices_perms as P WHERE F.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, F.fan_descr";
}
$query = mysql_query($sql);
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
if($_SESSION['userlevel'] >= '5') {
$sql = "SELECT * FROM `temperature` AS T, `devices` AS D WHERE T.temp_host = D.device_id ORDER BY D.hostname, T.temp_descr";
$sql = "SELECT * FROM `temperature` AS T, `devices` AS D WHERE T.device_id = D.device_id ORDER BY D.hostname, T.temp_descr";
} else {
$sql = "SELECT * FROM `temperature` AS T, `devices` AS D, devices_perms as P WHERE T.temp_host = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, T.temp_descr";
$sql = "SELECT * FROM `temperature` AS T, `devices` AS D, devices_perms as P WHERE T.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, T.temp_descr";
}
$query = mysql_query($sql);
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
if($_SESSION['userlevel'] >= '5') {
$sql = "SELECT * FROM `voltage` AS V, `devices` AS D WHERE V.volt_host = D.device_id ORDER BY D.hostname, V.volt_descr";
$sql = "SELECT * FROM `voltage` AS V, `devices` AS D WHERE V.device_id = D.device_id ORDER BY D.hostname, V.volt_descr";
} else {
$sql = "SELECT * FROM `voltage` AS V, `devices` AS D, devices_perms as P WHERE V.volt_host = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.volt_descr";
$sql = "SELECT * FROM `voltage` AS V, `devices` AS D, devices_perms as P WHERE V.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.volt_descr";
}
$query = mysql_query($sql);