Folks
A little off topic but maybe someone can help.
Using pnp4nagios php template to loop through all rrds of a certain
type, which works fine.
However I would like to get the Grand Total of all rrds
I know CDEF is the answer and can do this using php hard coding but just
cannot find out how to get this to work inside a php foreach loop
e.g
CDEF:total=var1,var2,+,var3,+
The php code I have been using is:
foreach($services as $key=>$val){
#
# get the data for a given Host/Service
$data = $this->tplGetData($val['host'],$val['service']);
#
$hostname = rrd::cut($data['MACRO']['HOSTNAME']);
$def[0] .= rrd::def("var$key" , $data['DS'][0]['RRDFILE'],
$data['DS'][0]['DS'] );
$def[0] .= rrd::line1("var$key", rrd::color($key), $hostname);
$def[0] .= rrd::gprint("var$key", array("LAST", "MAX"));
}
?>
Matthew
_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users