Lots of pretty things!

git-svn-id: http://www.observium.org/svn/observer/trunk@99 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-06-06 09:23:41 +00:00
parent ad4160c2ea
commit b8e3ba656a
14 changed files with 154 additions and 48 deletions

View File

@@ -8,10 +8,11 @@ while($temperature = mysql_fetch_array($temp_data)) {
echo($temp_cmd);
$temp = `$temp_cmd`;
$temprrd = addslashes("rrd/" . $device['hostname'] . "-temp-" . str_replace("/", "_", str_replace(" ", "_",$temperature['temp_descr'])) . ".rrd");
$temprrd = str_replace(")", "_", $temprrd);
$temprrd = str_replace("(", "_", $temprrd);
$temprrd = "rrd/" . $device[hostname] . "-temp-" . str_replace(" ", "_",$temperature['temp_descr']) . ".rrd";
if (!is_file($temprrd)) {
`rrdtool create $temprrd \
--step 300 \
@@ -24,9 +25,13 @@ while($temperature = mysql_fetch_array($temp_data)) {
$temp = str_replace("\"", "", $temp);
if($temperature['temp_tenths']) { $temp = $temp / 10; }
echo("$temprrd, N:$temp");
echo("$temprrd N:$temp");
`rrdtool update $temprrd N:$temp`;
$updatecmd = "rrdtool update $temprrd N:$temp";
echo($updatecmd . "\n");
`$updatecmd`;
mysql_query("UPDATE temperature SET temp_current = '$temp' WHERE temp_id = '$temperature[temp_id]'");