'Security:'); foreach ($no_servers as $host) { if ($host == $no_servers[0]) { array_push($no_hosts, "host NOT LIKE '$host' "); } else { array_push($no_hosts, "AND host NOT LIKE '$host' "); } }; foreach ($no_messages as $messages) { if ($messages == $no_messages [0]) array_push($no_msgs, "msg NOT LIKE '%$messages%' "); else array_push($no_msgs, "AND msg NOT LIKE '%$messages%' "); }; foreach ($no_host_and_msgs as $host => $message) { array_push($no_hosts, "AND host NOT LIKE '$host' "); array_push($addon_tmp_array, "(SELECT host,level,datetime AS time,msg FROM $tablename WHERE host='$host' AND datetime >= DATE_SUB(NOW(), INTERVAL 12 HOUR) AND msg NOT LIKE '%$message%' AND (level='err' OR level='crit' OR level='kern' OR level='warning') ORDER BY seq DESC LIMIT 500)"); }; # $query_string = "SELECT * FROM $tablename ORDER by seq DESC limit 100"; # $query_string = "SELECT host,level,datetime,msg FROM $tablename WHERE level='err' OR level='crit' OR level='kern' OR level='warning' ORDER BY seq desc limit 100"; $no_hosts = join(" ",$no_hosts); $no_msgs = join(" ",$no_msgs); $addon_str = join(" UNION ", $addon_tmp_array); $query_string = "(SELECT host,level,datetime AS time,msg FROM $tablename WHERE $no_hosts AND $no_msgs AND datetime >= DATE_SUB(NOW(), INTERVAL 12 HOUR) AND (level != 'info' AND level != 'notice') ORDER BY seq DESC LIMIT 500) UNION $addon_str ORDER BY time DESC LIMIT 100"; $result_id = mysql_query($query_string, $conn); $column_count = mysql_num_fields($result_id); print(""); print(""); $antal = 1; $dark =0; while ($row = mysql_fetch_row($result_id)) { $antal++; print(""); for ($column_num = 0; $column_num < $column_count; $column_num++) if($dark) print("\n"); else print("\n"); print("\n"); if($dark) $dark=0; else $dark=1; if($antal > 101)break; } print("
$row[$column_num]$row[$column_num]
\n"); mysql_close($conn); } ///// /* AuthCheck("30"); $page = $_SERVER["PHP_SELF"]; if (isset($_GET["timer"])) $timer = 60; //$timer = $_GET["timer"]; else $timer = 60; */ ?> "; ?> IRM Logs