some fixes

git-svn-id: http://www.observium.org/svn/observer/trunk@513 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-11-11 15:56:31 +00:00
parent 0983c2f94a
commit 070af9f831
6 changed files with 12 additions and 17 deletions
@@ -13,24 +13,24 @@
$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 width=350><a href='' $proc_popup>" . $proc['entPhysicalDescr'] . "</a></td>
<td><a href='#' $proc_popup><img src='percentage.php?per=" . $proc['hrProcessorTotal5minRev'] . "&width=600'></a></td>
<td style='font-weight: bold; color: $drv_colour'>" . $proc['hrProcessorTotal5minRev'] . "%</td>
echo("<tr><td class=tablehead width=350><a href='' $proc_popup>" . $proc['hrDeviceDescr'] . "</a></td>
<td><a href='#' $proc_popup><img src='percentage.php?per=" . $proc['hrProcessorLoad'] . "&width=600'></a></td>
<td style='font-weight: bold; color: $proc_colour'>" . $proc['hrProcessorLoad'] . "%</td>
</tr>");
echo("<tr bgcolor='$row_colour'><td colspan=5>");
$daily_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$day&to=$now&width=400&height=150";
$daily_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$day&to=$now&width=400&height=150";
$weekly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$week&to=$now&width=400&height=150";
$weekly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$week&to=$now&width=400&height=150";
$monthly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=150";
$monthly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=150";
$yearly_graph = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&from=$year&to=$now&width=400&height=150";
$yearly_url = "graph.php?id=" . $proc['hrDevice_id'] . "&type=hrProcessor&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> ");
@@ -42,7 +42,6 @@
<img src='$yearly_graph' border=0></a>");
echo("</td></tr>");
$i++;
}
echo("</table>");
+1 -1
View File
@@ -4,7 +4,7 @@ echo("hrDevice : ");
$hrDevice_oids = array('hrDeviceIndex','hrDeviceType','hrDeviceDescr','hrDeviceStatus','hrDeviceErrors','hrProcessorLoad');
foreach ($hrDevice_oids as $oid) { echo("$oid "); $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
foreach($hrDevice_array[$device[device_id]] as $hrDevice) {
if(is_array($hrDevice)) {
-2
View File
@@ -7,8 +7,6 @@
$oids = shell_exec($config['snmpwalk'] . " -CI -m HOST-RESOURCES-MIB -Osq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " hrStorageIndex");
$oids = trim(str_replace("hrStorageIndex.","",$oids));
echo(".. $oids .. ");
foreach(explode("\n", $oids) as $data) {
if($data) {
$data = trim($data);
-1
View File
@@ -37,7 +37,6 @@ if($device[os] != "Snom") {
foreach($oids[$proto] as $oid){
$oid_ds = truncate($oid, 19, '');
echo("\n$oid");
$rrd_create .= " DS:$oid_ds:COUNTER:600:U:100000000000";
$snmpstring .= " $oid.0";
}
+4 -4
View File
@@ -12,10 +12,10 @@ while ($hrDevice = mysql_fetch_array($query)) {
$this_hrDevice = $hrDevice_array[$device[device_id]][$hrDevice[hrDeviceIndex]];
$update_query = "UPDATE `hrDevice` SET";
$update_query .= ", `hrDeviceStatus` = '".mres($this_hrDevice[hrDeviceStatus])."'";
$update_query .= ", `hrDeviceErrors` = '".mres($this_hrDevice[hrDeviceErrors])."'";
$update_query .= ", `hrProcessorLoad` = '".mres($this_hrDevice[hrProcessorLoad])."'";
$update_query .= " WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrDevice['hrDeviceIndex']."'";
$update_query .= ", `hrDeviceStatus` = '".mres($this_hrDevice['hrDeviceStatus'])."'";
$update_query .= ", `hrDeviceErrors` = '".mres($this_hrDevice['hrDeviceErrors'])."'";
$update_query .= ", `hrProcessorLoad` = '".mres($this_hrDevice['hrProcessorLoad'])."'";
$update_query .= " WHERE hrDevice_id = '".$hrDevice['hrDevice_id']."'";
@mysql_query($update_query); $mysql++; echo(".");
$procrrd = addslashes($config['rrd_dir'] . "/" . $device['hostname'] . "/hrProcessor-" . $hrDevice['hrDeviceIndex'] . ".rrd");
-1
View File
@@ -135,7 +135,6 @@
}
$woo = "$polled:$ifInOctets:$ifOutOctets:$ifInErrors:$ifOutErrors:$ifInUcastPkts:$ifOutUcastPkts:$ifInNUcastPkts:$ifOutNUcastPkts";
echo("\n rrdtool update $rrdfile $woo\n");
$ret = rrdtool_update("$rrdfile", $woo);
/// End Update IF-MIB