Number of warning and critcal alerts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Number of warning and critcal alerts

Post 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?
Nagios XI 5.8.1
https://outsideit.net
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Number of warning and critcal alerts

Post 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...
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Number of warning and critcal alerts

Post 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
Nagios XI 5.8.1
https://outsideit.net
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Number of warning and critcal alerts

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Number of warning and critcal alerts

Post 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
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Number of warning and critcal alerts

Post 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
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Number of warning and critcal alerts

Post 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
Nagios XI 5.8.1
https://outsideit.net
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Number of warning and critcal alerts

Post 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
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Number of warning and critcal alerts

Post by WillemDH »

Scott,

I was able to create the reports. Thanks for the update.

Thread can be closed.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Number of warning and critcal alerts

Post by cmerchant »

We'll go ahead and close this thread. Thanks.
Locked