Added error codes for report

This commit is contained in:
Andre Lorbach 2009-11-17 17:34:09 +01:00
parent b9e4957110
commit c9231c9181
3 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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);
?>

View File

@ -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 );
}