do
{
- echo "Processing logs...\n";
+ //echo "Processing logs...\n";
process_log ();
service_check();
//mail_notifications();
for ($obj = 0; $obj < $dbms->num_rows($obj_result); $obj++)
{
$object = $dbms->fetch_object($obj_result, $obj);
- echo "Gathering statistics for object " . $object->objectid . "\n";
+ // echo "Gathering statistics for object " . $object->objectid . "\n";
GatherStatistics($object->objectid);
}
$last_log = $dbms->db_result_row[0];
}
- echo "Last processed logid = $last_log \n";
+ //echo "Last processed logid = $last_log \n";
//Query the log-table
$log_limit = $last_log + BATCHSIZE;
$notif = 'abuses exceeded';
if (!isset($notifications[$logentry->objectid][$notif][$source_ip]))
{
- echo "Creating notification $notif for object " . $logentry->objectid . ".\n";
+ //echo "Creating notification $notif for object " . $logentry->objectid . ".\n";
$remark = "Abuses from IP address $source_ip exceeded the limit.";
$notifid = $dbms->new_notification($logentry->objectid, $notif, $remark);
$notifications[$logentry->objectid][$notif][$source_ip] = $notifid;
// Add log entries from previously detected abuses
- echo " Add log entries from previously detected abuses\n";
+ //echo " Add log entries from previously detected abuses\n";
$abuses = $dbms->query("SELECT logid FROM log_abuse WHERE objectid = '" .
$logentry->objectid . "' AND source = '$source_ip'");
for ($abusenr = 0; $abusenr < $dbms->num_rows($abuses); $abusenr++)
VALUES ('log_servicecheck', '0')");
}
- echo "Running service check from log id $last_log.\n";
+ //echo "Running service check from log id $last_log.\n";
// Query the log-table
$log_limit = $last_log + BATCHSIZE;
return preg_replace($pattern, $replacement, $string);
}
?>
-