adding more junose and foundry/brocade. adding new mibs. unifying processor polling

git-svn-id: http://www.observium.org/svn/observer/trunk@831 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-02-13 21:45:39 +00:00
parent 54e8ac3cbd
commit 05735f4d55
294 changed files with 305727 additions and 141 deletions

View File

@@ -0,0 +1,10 @@
<?php
#include("cpu.inc.php");
#include("memory.inc.php");
include("temperatures.inc.php");
include("netstats.inc.php");
include("uptime.inc.php");
?>

View File

@@ -0,0 +1,6 @@
<?php
include("cpu.inc.php");
include("temperatures.inc.php");
include("netstats.inc.php");
include("uptime.inc.php");
?>

View File

@@ -6,16 +6,17 @@ $cemp = mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_
$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);
$processor = mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $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'; }
if ($storage) { $datas[] = 'storage'; }
if ($cemp) { $datas[] = 'cemp'; }
if ($cpm) { $datas[] = 'cpm'; }
if ($cmp) { $datas[] = 'cmp'; }
if ($hrprocessor) { $datas[] = 'hrprocessors'; }
if ($processor) { $datas[] = 'processors'; }
if ($fans) { $datas[] = 'fanspeeds'; }
if ($volts) { $datas[] = 'voltages'; }
@@ -25,6 +26,7 @@ $type_text['cemp'] = "Memory Enh Pools";
$type_text['cpm'] = "Processor Usage";
$type_text['storage'] = "Disk Usage";
$type_text['hrprocessors'] = "Processor Usage";
$type_text['processors'] = "Processor Usage";
$type_text['voltages'] = "Voltages";
$type_text['fanspeeds'] = "Fanspeeds";

View File

@@ -0,0 +1,52 @@
<?php
echo("<div style='margin-top: 5px; padding: 0px;'>");
echo("<table width=100% cellpadding=6 cellspacing=0>");
$i = '1';
$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "'");
while($proc = mysql_fetch_array($procs)) {
$proc_url = "?page=device/".$device['device_id']."/health/processors/";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['processor_descr'];
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
if($proc['processor_usage'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
echo("<tr><td class=tablehead width=450><a href='' $proc_popup>" . $proc['processor_descr'] . "</a></td>
<td><a href='#' $proc_popup>
<img src='percentage.php?per=" . $proc['processorLoad'] . "&width=500'></a></td>
<td style='font-weight: bold; color: $proc_colour'>" . $proc['processor_usage'] . "%</td>
</tr>");
echo("<tr bgcolor='$row_colour'><td colspan=5>");
$daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=400&height=150";
$weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=400&height=150";
$monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=150";
$yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=400&height=150";
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$daily_graph' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$weekly_graph' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$monthly_graph' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$yearly_graph' border=0></a>");
echo("</td></tr>");
$i++;
}
echo("</table>");
echo("</div>");
?>

View File

@@ -19,9 +19,7 @@ $services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM
if($services['down']) { $services_colour = $warn_colour_a; } else { $services_colour = $list_colour_a; }
if($interfaces['down']) { $interfaces_colour = $warn_colour_a; } else { $interfaces_colour = $list_colour_a; }
echo("
<table width=100% cellspacing=0 cellpadding=0>
<tr><td width=50% valign=top>");
echo("<div style='width: 50%; float: left;'>");
#if(file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc.php")) {
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
@@ -31,32 +29,6 @@ echo("
echo("</div>");
#}
include("overview/hrProcessors.inc.php");
include("overview/cpmCPU.inc.php");
include("overview/cemp.inc.php");
include("overview/cmp.inc.php");
include("overview/hrStorage.inc.php");
include("overview/temperatures.inc.php");
include("overview/fanspeeds.inc.php");
include("overview/voltages.inc.php");
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Recent Events</p>");
$query = "SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,10";
$data = mysql_query($query);
echo("<table cellspacing=0 cellpadding=2 width=100%>");
while($entry = mysql_fetch_array($data)) {
include("includes/print-event-short.inc");
}
echo("</table></div>");
echo("</td><td width=50% valign=top>");
include("overview/ports.inc.php");
@@ -93,6 +65,34 @@ echo("
}
echo("</td></tr></table>");
echo("</div>");
echo("<div style='float:right; width: 50%;'>");
### Right Pane
include("overview/processors.inc.php");
include("overview/hrProcessors.inc.php");
include("overview/cemp.inc.php");
include("overview/cmp.inc.php");
include("overview/hrStorage.inc.php");
include("overview/temperatures.inc.php");
include("overview/fanspeeds.inc.php");
include("overview/voltages.inc.php");
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Recent Events</p>");
$query = "SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,10";
$data = mysql_query($query);
echo("<table cellspacing=0 cellpadding=2 width=100%>");
while($entry = mysql_fetch_array($data)) {
include("includes/print-event-short.inc");
}
echo("</table>");
echo("</div>");
?>

View File

@@ -1,27 +0,0 @@
<?php
if(mysql_result(mysql_query("SELECT count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"),0)) {
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p class=sectionhead>Processors</p>");
echo("<table width=100%>");
$i = '1';
$procs = mysql_query("SELECT * FROM `cpmCPU` WHERE device_id = '" . $device['device_id'] . "'");
while($proc = mysql_fetch_array($procs)) {
$proc_url = "?page=device/".$device['device_id']."/health/cpm/";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['entPhysicalDescr'];
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
echo("<tr><td class=tablehead><a href='$proc_url' $proc_popup>" . $proc['entPhysicalDescr'] . "</a></td>
<td><a href='#' $proc_popup><img src='percentage.php?per=" . $proc['cpmCPUTotal5minRev'] . "'></a></td>
<td style='font-weight: bold; color: $drv_colour'>" . $proc['cpmCPUTotal5minRev'] . "%</td>
</tr>");
$i++;
}
echo("</table>");
echo("</div>");
}
?>

View File

@@ -2,7 +2,7 @@
if($interfaces['total']) {
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>
<p class=sectionhead>Ports</p>" . device_traffic_image($device['device_id'], 490, 100, $day, '-300s') . "");
" . device_traffic_image($device['device_id'], 490, 100, $day, '-300s') . "");
echo("<div style='height: 5px;'></div>");

View File

@@ -0,0 +1,38 @@
<?php
if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$processor_rows = 0;
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>Processors</p>");
echo("<table width=100% cellspacing=0 cellpadding=5>");
$i = '1';
$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "'");
while($proc = mysql_fetch_array($procs)) {
if(is_integer($processor_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$proc_url = $config['base_url'] . "/device/".$device['device_id']."/health/processors/";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['processor_descr'];
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
$mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
$text_descr = $proc['processor_descr'];
# $text_descr = short_processor_descr($proc['processor_descr']);
if($proc['processor_usage'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
echo("<tr bgcolor=$row_colour><td class=tablehead width=350><a href='".$proc_url."' $proc_popup>" . $text_descr . "</a></td>
<td width=100><a href='".$proc_url."'><img src='$mini_url'></a></td>
<td width=160><a href='".$proc_url."' $proc_popup>
<img src='percentage.php?per=" . $proc['processor_usage'] . "&width=150'></a></td>
<td style='font-weight: bold; color: $proc_colour'>
" . $proc['processor_usage'] . "%</td>
</tr>");
$processor_rows++;
}
echo("</table>");
echo("</div>");
}
?>

View File

@@ -33,7 +33,7 @@ if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE device
$temp_link_a = $temp_link . $temp['temp_descr'] . "</a>";
$temp['temp_descr'] = truncate($temp['temp_descr'], 25, '');
echo("<tr bgcolor='$row_colour'><td class=tablehead><strong>$temp_link_a</strong></td><td width=80 align=right class=tablehead>$temp_link_b<td width=80 align=right class=tablehead>$temp_link_c</td></tr>");
echo("<tr bgcolor='$row_colour'><td class=tablehead><strong>$temp_link_a</strong></td><td width=80 align=right class=tablehead>$temp_link_b<td width=35 align=right class=tablehead>$temp_link_c</td></tr>");
if($i == $rows) { echo("</table></td><td valign=top><table width=100% cellspacing=0 cellpadding=2>"); }
$i++;
}