- $update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
- $return = `$update_cmd 2>&1`;
+ $return = null;
+ if (count($upvals)) {
+ $update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
+ $return = `$update_cmd 2>&1`;
+ }
if (strpos($return, 'ERROR') !== false) {
trigger_error($this->rrd_file.' - rrd update error: '.$return, E_USER_WARNING);
if (strpos($return, 'ERROR') !== false) {
trigger_error($this->rrd_file.' - rrd update error: '.$return, E_USER_WARNING);
$duration = isset($gconf['duration'])?$gconf['duration']:396*86400; // 365+31 days
$slice = isset($gconf['slice'])?$gconf['slice']:86400; // 1 day
// vertical lines at month borders
$duration = isset($gconf['duration'])?$gconf['duration']:396*86400; // 365+31 days
$slice = isset($gconf['slice'])?$gconf['slice']:86400; // 1 day
// vertical lines at month borders
- $addSpecial .= ' VRULE:'.strtotime(date('Y-01-01')).'#FF0000';
- $addSpecial .= ' VRULE:'.strtotime(date('Y-01-01').' -1 year').'#FF0000';
+ $addSpecial .= ' VRULE:'.strtotime(date('Y-01-01 12:00:00')).'#FF0000';
+ $addSpecial .= ' VRULE:'.strtotime(date('Y-01-01 12:00:00').' -1 year').'#FF0000';
if (!isset($gconf['show_legend'])) { $gconf['show_legend'] = true; }
}
if (isset($erow['stack'])) { $grow['stack'] = ($erow['stack'] == true); }
if (!isset($gconf['show_legend'])) { $gconf['show_legend'] = true; }
}
if (isset($erow['stack'])) { $grow['stack'] = ($erow['stack'] == true); }
// XXX: use lines below once we have rrdtol 1.2
// $graphrows[] = array('dType'=>'VDEF', 'name'=>$grow['name'].'_last', 'rpn_expr'=>$grow['name'].',LAST');
// $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'].'_last', 'text'=>'%3.2lf%s');
// XXX: use lines below once we have rrdtol 1.2
// $graphrows[] = array('dType'=>'VDEF', 'name'=>$grow['name'].'_last', 'rpn_expr'=>$grow['name'].',LAST');
// $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'].'_last', 'text'=>'%3.2lf%s');