$graphfile) { echo(" * $graph: "); foreach (dbFetchRows("SELECT DISTINCT hostname FROM `device_graphs`,`devices` WHERE `devices`.device_id=`device_graphs`.device_id AND graph='$graph'") as $entry) { // get_rrd_path expects a $device array, but it only uses the 'hostname' index, so we get away with this. $filename = get_rrd_path($entry, $graphfile); if (file_exists($filename)) { $info = rrdtool_file_info($filename); $has_min = FALSE; foreach ($info['RRA'] as $rra) { if ($rra['cf'] == 'MIN') { $has_min = TRUE; break; } } if (!$has_min) { shell_exec("scripts/rrdtoolx.py addrra $filename $filename.new RRA:MIN:0.5:6:1440 RRA:MIN:0.5:96:360 RRA:MIN:0.5:288:1440"); rename("$filename.new", $filename); echo("U"); } else { echo('.'); } } } echo(PHP_EOL); } // EOF