fix a couple of graphs

git-svn-id: http://www.observium.org/svn/observer/trunk@1158 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-06-12 20:14:41 +00:00
parent d33dfc87a1
commit aa9540007d
3 changed files with 10 additions and 9 deletions

View File

@@ -1,12 +1,13 @@
<?php
$query = mysql_query("SELECT * FROM `hrDevice` where `device_id` = '".$id."' AND hrDeviceType = 'hrDeviceProcessor'");
$device = device_by_id_cache($id);
$query = mysql_query("SELECT * FROM `hrDevice` where `device_id` = '".mres($_GET['id'])."' AND hrDeviceType = 'hrDeviceProcessor'");
$device = device_by_id_cache(mres($device_id));
$i=0;
while($proc = mysql_fetch_array($query)) {
$rrd_filename = $config['rrd_dir'] . "/."$device['hostname']."/" . safename("hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd");
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd");
if(is_file($rrd_filename)) {
@@ -37,7 +38,7 @@ include ("generic_multi_line.inc.php");
} else {
include("common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/" . "ucd_cpu.rrd";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . "ucd_cpu.rrd";
$rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE";
$rrd_options .= " DEF:nice=$rrd_filename:nice:AVERAGE";
$rrd_options .= " DEF:system=$rrd_filename:system:AVERAGE";

View File

@@ -17,7 +17,7 @@ $select[$section] = "selected";
$device_query = mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $_GET['id'] . "'");
while($device = mysql_fetch_array($device_query)) {
if($os_groups[$device['os']]) {$device['os_group'] = $os_groups[$device['os']]; echo "(".$device['os_group'].")";}
if($os_groups[$device['os']]) {$device['os_group'] = $os_groups[$device['os']]; }
echo('<table cellpadding="15" cellspacing="0" class="devicetable" width="100%">');
include("includes/device-header.inc.php");