projects
/
php-utility-classes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
86ff8b9
)
improve error reporting and do it the same way for all calls od rrdtool
author
robert
<robert>
Fri, 13 May 2005 19:15:59 +0000
(19:15 +0000)
committer
robert
<robert>
Fri, 13 May 2005 19:15:59 +0000
(19:15 +0000)
include/classes/rrdstat.php-class
patch
|
blob
|
blame
|
history
diff --git
a/include/classes/rrdstat.php-class
b/include/classes/rrdstat.php-class
index 9e2a747b9da4e41b5b6847f135f3025dc8437ee5..55ffaec9d380e2ac7099597ddfb7757a92c91149 100644
(file)
--- a/
include/classes/rrdstat.php-class
+++ b/
include/classes/rrdstat.php-class
@@
-138,9
+138,10
@@
class rrdstat {
}
}
}
}
}
}
- $output = array(); $return_var = null;
- exec($create_cmd, $output, $return_var);
- if ($return_var) { trigger_error('rrd create returned with value '.$return_var, E_USER_WARNING); }
+ $return = `$create_cmd 2>&1`;
+ if (strpos($return, 'ERROR') !== false) {
+ trigger_error($this->rrd_file.' - rrd create error: '.$return, E_USER_WARNING);
+ }
else { $this->status = 'ok'; }
}
else { $this->status = 'ok'; }
}
@@
-193,9
+194,13
@@
class rrdstat {
}
}
$update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
}
}
$update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
- $output = array(); $return_var = null;
- exec($update_cmd, $output, $return_var);
- if ($return_var) { trigger_error('rrd update returned with value '.$return_var, E_USER_WARNING); }
+ $return = `$update_cmd 2>&1`;
+
+ if (strpos($return, 'ERROR') !== false) {
+ trigger_error($this->rrd_file.' - rrd update error: '.$return, E_USER_WARNING);
+ $success = false;
+ }
+ else { $success = true; }
return ($return_var == 0);
}
return ($return_var == 0);
}
@@
-216,7
+221,7
@@
class rrdstat {
$return = `$fetch_cmd 2>&1`;
if (strpos($return, 'ERROR') !== false) {
$return = `$fetch_cmd 2>&1`;
if (strpos($return, 'ERROR') !== false) {
- trigger_error(
'
rrd fetch error: '.$return, E_USER_WARNING);
+ trigger_error(
$this->rrd_file.' -
rrd fetch error: '.$return, E_USER_WARNING);
$fresult = false;
}
else {
$fresult = false;
}
else {
@@
-457,7
+462,7
@@
class rrdstat {
$return = `$graph_cmd 2>&1`;
if (strpos($return, 'ERROR') !== false) {
$return = `$graph_cmd 2>&1`;
if (strpos($return, 'ERROR') !== false) {
- trigger_error(
'
rrd graph error: '.$return, E_USER_WARNING);
+ trigger_error(
$this->rrd_file.' -
rrd graph error: '.$return, E_USER_WARNING);
$return = $graph_cmd."\n\n".$return;
}
$return = 'file:'.$fname."\n".$return;
$return = $graph_cmd."\n\n".$return;
}
$return = 'file:'.$fname."\n".$return;