mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Added error codes for report
This commit is contained in:
parent
b9e4957110
commit
c9231c9181
@ -151,6 +151,8 @@ class Report_monilog extends Report {
|
||||
// Prepent to array
|
||||
array_unshift( $content["report_summary"], $totalItem );
|
||||
}
|
||||
else
|
||||
return ERROR_REPORT_NODATA;
|
||||
|
||||
// Get List of hosts
|
||||
$content["report_computers"] = $this->_streamObj->ConsolidateItemListByField( SYSLOG_HOST, $this->_maxHosts, SYSLOG_HOST, SORTING_ORDER_DESC );
|
||||
@ -159,9 +161,14 @@ class Report_monilog extends Report {
|
||||
$nowtime = microtime_float();
|
||||
$content["report_rendertime"] .= number_format($nowtime - $gl_starttime, 2, '.', '') . "s, ";
|
||||
|
||||
// Create plain hosts list for Consolidate function
|
||||
foreach ( $content["report_computers"] as $tmpComputer )
|
||||
$arrHosts[] = $tmpComputer[SYSLOG_HOST];
|
||||
if ( is_array($content["report_summary"]) && count($content["report_summary"]) > 0 )
|
||||
{
|
||||
// Create plain hosts list for Consolidate function
|
||||
foreach ( $content["report_computers"] as $tmpComputer )
|
||||
$arrHosts[] = $tmpComputer[SYSLOG_HOST];
|
||||
}
|
||||
else
|
||||
return ERROR_REPORT_NODATA;
|
||||
|
||||
// This function will consolidate the Events based per Host!
|
||||
$this->ConsolidateEventsPerHost($arrHosts);
|
||||
@ -169,7 +176,6 @@ class Report_monilog extends Report {
|
||||
// TimeStats
|
||||
$nowtime = microtime_float();
|
||||
$content["report_rendertime"] .= number_format($nowtime - $gl_starttime, 2, '.', '') . "s ";
|
||||
|
||||
// ---
|
||||
}
|
||||
else
|
||||
|
@ -66,5 +66,6 @@ define('ERROR_MSG_NOMATCH', 18);
|
||||
define('ERROR_CHARTS_NOTCONFIGURED', 20);
|
||||
define('ERROR_MSG_SKIPMESSAGE', 21);
|
||||
define('ERROR_MSG_SCANABORTED', 23);
|
||||
define('ERROR_REPORT_NODATA', 24);
|
||||
|
||||
?>
|
@ -1763,6 +1763,9 @@ function GetErrorMessage($errorCode)
|
||||
case ERROR_SOURCENOTFOUND:
|
||||
return $content['LN_GEN_ERROR_SOURCENOTFOUND'];
|
||||
|
||||
case ERROR_REPORT_NODATA:
|
||||
return $content['LN_GEN_ERROR_REPORT_NODATA'];
|
||||
|
||||
default:
|
||||
return GetAndReplaceLangStr( $content['LN_ERROR_UNKNOWN'], $errorCode );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user