.+?)_temp_\d+$/', $NAME[$i], $matches) || preg_match('/^e(?P.+?)t\d+$/', $NAME[$i], $matches)) { $this_id = $matches['id']; if ($enclosure_id != $this_id) { $e = 0; ++$count; $enclosure_id = $this_id; } # Long label $NAME[$i] = preg_replace('/^enclosure_.+?_temp_(\d+)$/', 'Probe $1', $NAME[$i]); # Short label $NAME[$i] = preg_replace('/^e.+?t(\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 \"Celsius\" --title \"$def_title: Enclosure $enclosure_id Temperatures\" "; if(isset($def[$count])){ $def[$count] .= "DEF:var$i=$rrdfile:$DS[$i]:AVERAGE " ; } else { $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 C last \" "; $def[$count] .= "GPRINT:var$i:MAX:\"%6.0lf C max \" "; $def[$count] .= "GPRINT:var$i:AVERAGE:\"%6.2lf C avg \\n\" "; } } ?>