From 52990a07d3b073a9143964fa5d69ece982ba9932 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Thu, 18 Sep 2008 14:29:17 +0200 Subject: [PATCH] Changed IUT Type to WEBSERVER Logfile in general, as IIS is supported as well now --- src/classes/logstreamconfig.class.php | 6 ++++++ src/classes/msgparsers/msgparser.apache2.class.php | 2 +- src/classes/msgparsers/msgparser.iis.class.php | 2 +- src/include/constants_errors.php | 1 + src/include/constants_filters.php | 2 +- src/include/constants_general.php | 4 ++-- src/include/functions_common.php | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/classes/logstreamconfig.class.php b/src/classes/logstreamconfig.class.php index dafc055..e8cf61c 100644 --- a/src/classes/logstreamconfig.class.php +++ b/src/classes/logstreamconfig.class.php @@ -131,6 +131,12 @@ abstract class LogStreamConfig { public function ProcessMsgParsers($szMsg, &$arrArguments) { + // Abort msgparsers if we have less then 5 seconds of processing time! + global $content, $gl_starttime; + $scriptruntime = intval(microtime_float() - $gl_starttime); + if ( $scriptruntime > ($content['MaxExecutionTime']-5) ) + return ERROR_MSG_SCANABORTED; + // Process if set! if ( $this->_msgParserObjList != null ) { diff --git a/src/classes/msgparsers/msgparser.apache2.class.php b/src/classes/msgparsers/msgparser.apache2.class.php index 11cc3b7..7013a8e 100644 --- a/src/classes/msgparsers/msgparser.apache2.class.php +++ b/src/classes/msgparsers/msgparser.apache2.class.php @@ -136,7 +136,7 @@ class MsgParser_apache2 extends MsgParser { } // Set IUT Property if success! - $arrArguments[SYSLOG_MESSAGETYPE] = IUT_APACHELOG; + $arrArguments[SYSLOG_MESSAGETYPE] = IUT_WEBSERVERLOG; // If we reached this position, return success! return SUCCESS; diff --git a/src/classes/msgparsers/msgparser.iis.class.php b/src/classes/msgparsers/msgparser.iis.class.php index d15eb33..9f5d45f 100644 --- a/src/classes/msgparsers/msgparser.iis.class.php +++ b/src/classes/msgparsers/msgparser.iis.class.php @@ -145,7 +145,7 @@ class MsgParser_iis extends MsgParser { } // Set IUT Property if success! - $arrArguments[SYSLOG_MESSAGETYPE] = IUT_APACHELOG; + $arrArguments[SYSLOG_MESSAGETYPE] = IUT_WEBSERVERLOG; // If we reached this position, return success! return SUCCESS; diff --git a/src/include/constants_errors.php b/src/include/constants_errors.php index 7d26187..b47aba6 100644 --- a/src/include/constants_errors.php +++ b/src/include/constants_errors.php @@ -63,5 +63,6 @@ define('ERROR_DB_DBFIELDNOTFOUND', 19); define('ERROR_MSG_NOMATCH', 18); define('ERROR_CHARTS_NOTCONFIGURED', 20); define('ERROR_MSG_SKIPMESSAGE', 21); +define('ERROR_MSG_SCANABORTED', 22); ?> diff --git a/src/include/constants_filters.php b/src/include/constants_filters.php index 459951d..1e35741 100644 --- a/src/include/constants_filters.php +++ b/src/include/constants_filters.php @@ -111,6 +111,6 @@ $content['filter_severity_list'][] = array( "ID" => SYSLOG_DEBUG, "DisplayName" $content['filter_messagetype_list'][] = array( "ID" => IUT_Syslog, "DisplayName" => "Syslog", "selected" => "" ); $content['filter_messagetype_list'][] = array( "ID" => IUT_NT_EventReport, "DisplayName" => "WinEventLog", "selected" => "" ); $content['filter_messagetype_list'][] = array( "ID" => IUT_File_Monitor, "DisplayName" => "File Monitor", "selected" => "" ); -$content['filter_messagetype_list'][] = array( "ID" => IUT_APACHELOG, "DisplayName" => "Apache Webserver Logfile", "selected" => "" ); +$content['filter_messagetype_list'][] = array( "ID" => IUT_WEBSERVERLOG, "DisplayName" => "Webserver Logfile", "selected" => "" ); ?> \ No newline at end of file diff --git a/src/include/constants_general.php b/src/include/constants_general.php index c0eb746..821339c 100644 --- a/src/include/constants_general.php +++ b/src/include/constants_general.php @@ -178,7 +178,7 @@ define('IUT_IMAPProbe', '21'); define('IUT_NNTPProbe', '22'); define('IUT_WEVTMONV2', '23'); define('IUT_SMTPLISTENER', '24'); -define('IUT_APACHELOG', '10001'); +define('IUT_WEBSERVERLOG', '10001'); $msgtype_colors[IUT_Unknown] = "#D0FBDC"; $msgtype_colors[IUT_Syslog] = "#D0FBF1"; $msgtype_colors[IUT_Heartbeat] = "#D0EEFB"; @@ -201,7 +201,7 @@ $msgtype_colors[IUT_IMAPProbe] = "#D0FBE8"; $msgtype_colors[IUT_NNTPProbe] = "#D0F7FB"; $msgtype_colors[IUT_WEVTMONV2] = "#CCE4D2"; $msgtype_colors[IUT_SMTPLISTENER] = "#CCE4DE"; -$msgtype_colors[IUT_APACHELOG] = "#E1FBD0"; +$msgtype_colors[IUT_WEBSERVERLOG] = "#E1FBD0"; // --- ?> \ No newline at end of file diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 539eb10..3bb90c4 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1113,7 +1113,7 @@ function ReverseResolveIP( $szIP, $prepend, $append ) { global $gl_starttime, $content; - // Substract 5 savety seconds! + // Substract 5 seconds we need to finish processing! $scriptruntime = intval(microtime_float() - $gl_starttime); if ( $scriptruntime > ($content['MaxExecutionTime']-5) ) return "";