mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
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:
@@ -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]'");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user