+ if (isset($gconf['special']) && count($gconf['special'])) {
+ foreach ($gconf['special'] as $crow) {
+ $srow = array();
+ $srow['sType'] = isset($crow['sType'])?$crow['sType']:'COMMENT';
+ if ($grow['sType'] != 'COMMENT') {
+ // XXX: use line below and remove cf var once we have rrdtol 1.2
+ // $srow['name'] = $crow['name'].(isset($crow['cf'])?'_'.$crow['cf']:'');
+ $srow['name'] = $crow['name'];
+ $srow['cf'] = isset($crow['cf'])?$crow['cf']:'AVERAGE';
+ if (isset($crow['cf'])) {
+ // XXX: use line below once we have rrdtol 1.2
+ // $graphrows[] = array('dType'=>'VDEF', 'name'=>$srow['name'].'_'.$crow['cf'], 'rpn_expr'=>$srow['name'].','.$crow['cf']);
+ }
+ elseif (isset($crow['rpn_expr'])) {
+ // XXX: does only work with rrdtool 1.2
+ $graphrows[] = array('dType'=>'VDEF', 'name'=>$srow['name'], 'rpn_expr'=>$crow['rpn_expr']);
+ }
+ }
+ $srow['text'] = isset($crow['text'])?$crow['text']:'';
+ $specialrows[] = $srow;
+ }
+ }
+ else {
+ foreach ($graphrows as $grow) {
+ if (isset($grow['gType']) && strlen($grow['gType'])) {
+ $textprefix = isset($grow['legend'])?$grow['legend']:$grow['name'];
+ // 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');
+ $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'], 'cf'=>'MAX', 'text'=>$textprefix.'|Maximum|%.2lf%s');
+ $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'], 'cf'=>'AVERAGE', 'text'=>$textprefix.'|Average|%.2lf%s');
+ $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'], 'cf'=>'LAST', 'text'=>$textprefix.'|Current|%.2lf%s');
+ }
+ }
+ }
+