.+?)_temp_\d+$/', $NAME[$i], $matches)){ $this_id = $matches['id']; if ($enclosure_id != $this_id) { $e = 0; ++$count; $enclosure_id = $this_id; } $NAME[$i] = preg_replace('/^enclosure_.+?_temp_(\d+)$/', 'Probe $1', $NAME[$i]); $ds_name[$count] = "Enclosure $enclosure_id Temperatures"; $warnThresh = "INF"; $critThresh = "INF"; if ($WARN[$i] != "") { $warnThresh = $WARN[$i]; } if ($CRIT[$i] != "") { $critThresh = $CRIT[$i]; } $opt[$count] = "--slope-mode --vertical-label \"Celcius\" --title \"$def_title: Enclosure $enclosure_id Temperatures\" "; $def[$count] .= "DEF:var$i=$rrdfile:$DS[$i]:AVERAGE " ; $def[$count] .= "LINE:var$i#".$colors[$e++].":\"$NAME[$i]\" " ; $def[$count] .= "GPRINT:var$i:LAST:\"%6.0lf $UNIT[$i] last \" "; $def[$count] .= "GPRINT:var$i:MAX:\"%6.0lf $UNIT[$i] max \" "; $def[$count] .= "GPRINT:var$i:AVERAGE:\"%6.2lf $UNIT[$i] avg \\n\" "; } } ?>