mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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>");
|
||||
}
|
||||
|
||||
?>
|
@@ -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>");
|
||||
|
||||
|
38
html/pages/device/overview/processors.inc.php
Normal file
38
html/pages/device/overview/processors.inc.php
Normal 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>");
|
||||
}
|
||||
|
||||
?>
|
@@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user