prepare($query); if($sth) { $res = $sth->execute(); $numRows = $sth->rows(); PRINT ""; for ($i = 0; $i < $numRows; $i++) { $result = $sth->fetchrow_hash(); $nodename = $result["machine"]; $date1 = $result["date1"]; $date2 = explode(" ", $date1); $priority = $result["priority"]; $message = $result["message"]; if ("$nodename"=="irm") { if (!preg_match("/Monitor alert/", $message)) { continue; } else { $message2 = explode(" ", $message); // $message = str_replace("$message2[0]","Ping failed", "$message"); $nodename = $message2[5]; } } $FINDURL="$USERPREFIX/servers/?field=name&phrasetype=exact&contains=$nodename&sort=name&index=1"; if (preg_match("/host-b/", $nodename)) { $nodeip=str_replace("host-b-", "", $nodename); $nodeip=str_replace("-", ".", $nodeip); $FINDURL="$USERPREFIX/servers/?field=ip&phrasetype=contains&contains=$nodeip&sort=name&index=1"; } if (is_numeric(str_replace(".", "", $nodename))) { $FINDURL="$USERPREFIX/servers/?field=ip&phrasetype=exact&contains=$nodename&sort=name&index=1"; } PRINT ""; } else { PRINT "$message"; } PRINT ""; } PRINT "
$nodename $date2[1]"; if ("$priority"=="err") { PRINT ""; PRINT "$message
"; } else { PRINT "Could not prepare query: ".$sth->errstr."
\n"; } ?>