diff --git a/src/classes/reports/report.eventlog.monilog.class.php b/src/classes/reports/report.eventlog.monilog.class.php index 201ce53..a07ad02 100644 --- a/src/classes/reports/report.eventlog.monilog.class.php +++ b/src/classes/reports/report.eventlog.monilog.class.php @@ -236,12 +236,12 @@ class Report_monilog extends Report { $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['ItemCount']++; // Set FirstEvent date if necessary! - if ( $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP] < $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'] ) - $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'] = $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP]; + if ( $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP] < $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'][EVTIME_TIMESTAMP] ) + $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'] = $logArray[SYSLOG_DATE]; // Set LastEvent date if necessary! - if ( $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP] > $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'] ) - $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'] = $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP]; + if ( $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP] > $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'][EVTIME_TIMESTAMP] ) + $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'] = $logArray[SYSLOG_DATE]; } else { @@ -253,9 +253,8 @@ class Report_monilog extends Report { // Set Counter and First/Last Event date $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['ItemCount'] = 1; - $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'] = $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP]; - $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'] = $logArray[SYSLOG_DATE][EVTIME_TIMESTAMP]; -//GetFormatedDate + $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['FirstEvent_Date'] = $logArray[SYSLOG_DATE]; + $content["report_consdata"][ $logArray[SYSLOG_HOST] ]['cons_events'][ $strChecksum ]['LastEvent_Date'] = $logArray[SYSLOG_DATE]; } } @@ -279,6 +278,17 @@ class Report_monilog extends Report { array_pop($tmpConsolidatedComputer['cons_events']); } while ( count($tmpConsolidatedComputer['cons_events']) > $this->_maxEventsPerHost ); } + + + // PostProcess Events! + foreach( $tmpConsolidatedComputer["cons_events"] as &$tmpMyEvent ) + { + $tmpMyEvent['FirstEvent_Date_Formatted'] = GetFormatedDate( $tmpMyEvent['FirstEvent_Date'] ); + $tmpMyEvent['LastEvent_Date_Formatted'] = GetFormatedDate( $tmpMyEvent['LastEvent_Date'] ); + $tmpMyEvent['syslogseverity_text'] = $content['filter_severity_list'][ $tmpMyEvent['syslogseverity'] ]["DisplayName"]; + } + + } } diff --git a/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.lang.en.php b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.lang.en.php new file mode 100644 index 0000000..d5cec98 --- /dev/null +++ b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.lang.en.php @@ -0,0 +1,48 @@ + www.phplogcon.org <- + * ----------------------------------------------------------------- + * + * Copyright (C) 2008 Adiscon GmbH. + * + * This file is part of phpLogCon. + * + * PhpLogCon is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PhpLogCon is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with phpLogCon. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this + * distribution. + ********************************************************************* +*/ +global $content; + +// Global Stuff +$content['ln_report_event_summary'] = "Event Summary"; +$content['ln_report_computer_summary'] = "Computer Summary"; +$content['ln_report_consolidation'] = "Events Consolidated per Host"; +$content['ln_report_summary'] = "Report Summary"; +$content['ln_report_number'] = "No."; +$content['ln_report_firstevent'] = "First Event"; +$content['ln_report_lastevent'] = "Last Event"; +$content['ln_report_process'] = "Process"; +$content['ln_report_severity'] = "Type"; +$content['ln_report_eventid'] = "Event ID"; +$content['ln_report_description'] = "Description"; +$content['ln_report_count'] = "Count"; +$content['ln_report_'] = ""; +$content['ln_report_'] = ""; +$content['ln_report_'] = ""; +$content['ln_report_'] = ""; + +?> \ No newline at end of file diff --git a/src/classes/reports/report.eventlog.monilog.template.html b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.html similarity index 58% rename from src/classes/reports/report.eventlog.monilog.template.html rename to src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.html index 6d0c30d..5029771 100644 --- a/src/classes/reports/report.eventlog.monilog.template.html +++ b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.html @@ -3,9 +3,12 @@ {report_title} + + - @@ -24,7 +27,7 @@ - + @@ -32,7 +35,7 @@
{report_summary}{ln_report_summary}
- + @@ -44,7 +47,7 @@
{report_event_summary}{ln_report_event_summary}
- +
{report_computer_summary}{ln_report_computer_summary}
@@ -61,7 +64,7 @@ - +
{report_consolidation}{ln_report_consolidation}
@@ -73,26 +76,26 @@ - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - + diff --git a/src/classes/reports/report.eventlog.monilog.template.pdf b/src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.pdf similarity index 100% rename from src/classes/reports/report.eventlog.monilog.template.pdf rename to src/classes/reports/report.eventlog.monilog/report.eventlog.monilog.template.pdf diff --git a/src/include/functions_common.php b/src/include/functions_common.php index dc078b6..c9d7f10 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1066,7 +1066,7 @@ function VerifyLanguage( $mylang ) return false; } -function IncludeLanguageFile( $langfile ) +function IncludeLanguageFile( $langfile, $failOnError = true ) { global $LANG, $LANG_EN; @@ -1078,7 +1078,12 @@ function IncludeLanguageFile( $langfile ) if ( file_exists($langengfile) ) include( $langengfile ); else - DieWithErrorMsg( "FATAL Error initialzing sublanguage system. Please make sure that all files have been uploaded correctly." ); + { + if ( $failOnError ) + DieWithErrorMsg( "FATAL Error initialzing sublanguage system. Please make sure that all files have been uploaded correctly." ); + else + return false; + } // If nto english, load the additional translations if ( $LANG != "en" ) @@ -1086,7 +1091,12 @@ function IncludeLanguageFile( $langfile ) if ( file_exists( $langfile ) ) include( $langfile ); else - OutputDebugMessage("FATAL Error reading the configured language $LANG. Please make sure that all files have been uploaded correctly.", DEBUG_ERROR); + { + if ( $failOnError ) + OutputDebugMessage("FATAL Error reading the configured language $LANG. Please make sure that all files have been uploaded correctly.", DEBUG_ERROR); + else + return false; + } } } diff --git a/src/reportgenerator.php b/src/reportgenerator.php index c1ee758..8d41b90 100644 --- a/src/reportgenerator.php +++ b/src/reportgenerator.php @@ -204,10 +204,14 @@ if ( !$content['error_occured'] ) else { // --- Perform report output + $reportIncludePath = $gl_root_path . 'classes/reports/' . $myReportObj->_reportFileBasicName . "/"; + + // Include Custom language file if available + IncludeLanguageFile( $reportIncludePath . $myReportObj->_reportFileBasicName . ".lang.en.php" ); // Init template Parser $page = new Template(); - $page -> set_path ( $gl_root_path . 'classes/reports/' ); + $page -> set_path ( $reportIncludePath ); // Parse template $page -> parser($content, $myReportObj->GetBaseFileName());
{report_number}{report_firstevent}{report_lastevent}{report_process}{report_severity}{report_eventid}{report_description}{report_count}{ln_report_number}{ln_report_firstevent}{ln_report_lastevent}{ln_report_process}{ln_report_severity}{ln_report_eventid}{ln_report_description}{ln_report_count}
{ZAEHLER}{FirstEvent_Date}{LastEvent_Date}{sourceproc}{syslogseverity}{id}{msg}{ZAEHLER}{FirstEvent_Date_Formatted}{LastEvent_Date_Formatted}{sourceproc}{syslogseverity_text}{id}{msg} {ItemCount}{ItemCount} {ItemCount}