- Code cleanup by Bastian Widmer.

git-svn-id: http://www.observium.org/svn/observer/trunk@1957 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Geert Hauwaerts
2011-03-22 20:27:39 +00:00
parent 0c4e6b5dfc
commit 6501cd29b5
45 changed files with 3658 additions and 3656 deletions

View File

@@ -2,53 +2,53 @@
function rrdtool_update($rrdfile, $rrdupdate)
{
return rrdtool("update", $rrdfile, $rrdupdate);
return rrdtool("update", $rrdfile, $rrdupdate);
}
function rrdtool_create($rrdfile, $rrdupdate)
{
global $config; global $debug;
global $config; global $debug;
$command = $config['rrdtool'] . " create $rrdfile $rrdupdate";
$command = $config['rrdtool'] . " create $rrdfile $rrdupdate";
if ($debug) { echo($command."\n"); }
if ($debug) { echo($command."\n"); }
return shell_exec($command);
return shell_exec($command);
}
function rrdtool_fetch($rrdfile, $rrdupdate)
{
return rrdtool("fetch", $rrdfile, $rrdupdate);
return rrdtool("fetch", $rrdfile, $rrdupdate);
}
function rrdtool_graph($rrdfile, $rrdupdate)
{
return rrdtool("graph", $rrdfile, $rrdupdate);
return rrdtool("graph", $rrdfile, $rrdupdate);
}
function rrdtool_last($rrdfile, $rrdupdate)
{
return rrdtool("last", $rrdfile, $rrdupdate);
return rrdtool("last", $rrdfile, $rrdupdate);
}
function rrdtool_lastupdate($rrdfile, $rrdupdate)
{
return rrdtool("lastupdate", $rrdfile, $rrdupdate);
return rrdtool("lastupdate", $rrdfile, $rrdupdate);
}
function rrdtool($command, $file, $options)
{
global $config; global $debug;
global $config; global $debug;
$command = $config['rrdtool'] . " $command $file $options";
if ($config['rrdcached'])
{
$command .= " --daemon " . $config['rrdcached'];
}
$command = $config['rrdtool'] . " $command $file $options";
if ($config['rrdcached'])
{
$command .= " --daemon " . $config['rrdcached'];
}
if ($debug) { echo($command."\n"); }
return shell_exec($command);
if ($debug) { echo($command."\n"); }
return shell_exec($command);
}
?>