Page 1 of 1
Number of warning and critcal alerts
Posted: Mon Dec 22, 2014 7:06 am
by WillemDH
It seems the eventlog is capped at 100000 records. Last year I was able to retrieve the number of warning and critical alerts, but this year, i have 100000+ records, so it seems the eventlog doesn't go back further then three months. How would I be able to retrieve the number of warning and critical events of this year?
The same goes for notifications. It seems I also can go back further then September. Why is there no data of notifications before September?
Re: Number of warning and critcal alerts
Posted: Mon Dec 22, 2014 11:04 am
by lmiltchev
Check your settings under the "Performance Settings" page. (Admin->Performance Settings)
You can increase these value, but keep in mind the database tables can grow quite large...
Re: Number of warning and critcal alerts
Posted: Mon Dec 22, 2014 4:35 pm
by WillemDH
Ludmill,
Do you have any numbers for this? I know I can go back untill september 15, so I would 350k records. Any ideas what the impact would be? If I enlarge the amount of records, is this instantly or will it only expand from the moment I make it larger? Can I easily set it back to 100k?
Grtz
Willem
Re: Number of warning and critcal alerts
Posted: Mon Dec 22, 2014 5:28 pm
by scottwilkerson
There is a config.inc.php option that can be changed to accomodate this
in /usr/local/nagiosxi/html/config.inc.php change
Code: Select all
$cfg['default_result_records'] = 100000; // max number of records to return by default
to
Code: Select all
$cfg['default_result_records'] = 350000; // max number of records to return by default
If you are generating PDF reports however, there is an additional limiter hardcoded in
/usr/local/nagiosxi/html/reports/eventlog.php
on line 665 change
Code: Select all
$newurl .= "&records=100000"; // Max: 100,000 alert producers
to
Code: Select all
$newurl .= "&records=350000"; // Max: 350,000 alert producers
Re: Number of warning and critcal alerts
Posted: Tue Dec 23, 2014 3:55 am
by WillemDH
Scott,
Thank you. Setting $cfg['default_result_records'] tot 500000 did the trick.
The state changes history now goes back to january. I did notice that there seems to be a difference between the number of records the state change history displays and the number of records I have once exported to csv.
The state change history says:
Code: Select all
Report Covers From: 2014-01-01 00:00:00 To : 2014-12-23 09:31:10
Showing 8.151-8.175 of 270.567 total records
The csv, once imported in Excel only has 203092 records. Any idea what might cause the differnce? +-63k records is not a small difference...
While writing this, I notice that in the csv, some state changes are split over multile lines: See screenshot attached. I saw this in Excel and in Notepad++. This seeems like some sort of bug?
EDIT: I found out why there might be such a difference of records. The csv only starts in 21/02/2014. Is there any limit I need to edit for export to csv?
Grtz
Willem
Re: Number of warning and critcal alerts
Posted: Tue Dec 23, 2014 11:03 am
by scottwilkerson
@WillemDH - While I do not know if it actually could make up a missing 63k items, I did find a bug in the CSV export function that didn't handle custom reports the same way as the displayed item does. Attached is a fixed version, which can be unzipped and placed in /usr/local/nagiosxi/html/reports/
Also, this file attempts to replace \r & \n with spaces which I believe was causing the split to multiple lines
Re: Number of warning and critcal alerts
Posted: Wed Dec 24, 2014 5:27 am
by WillemDH
Scott,
I uploaded your eventlog.php to /usr/local/nagiosxi/html/reports/ and exported another csv, but I still see records split over multiple lines. Just a thought, but I was talking about the state history report, does it also use eventlog.php for exporting to csv?
Grtz
Willem
Re: Number of warning and critcal alerts
Posted: Fri Dec 26, 2014 9:54 am
by scottwilkerson
WillemDH wrote:Scott,
I uploaded your eventlog.php to /usr/local/nagiosxi/html/reports/ and exported another csv, but I still see records split over multiple lines. Just a thought, but I was talking about the state history report, does it also use eventlog.php for exporting to csv?
Grtz
Willem
Oops, I don't know why I thought that was the eventlog.... Here is the same fixes for state history, install the same way
Re: Number of warning and critcal alerts
Posted: Mon Jan 05, 2015 9:53 am
by WillemDH
Scott,
I was able to create the reports. Thanks for the update.
Thread can be closed.
Grtz
Willem
Re: Number of warning and critcal alerts
Posted: Mon Jan 05, 2015 10:09 am
by cmerchant
We'll go ahead and close this thread. Thanks.