Page 1 of 2

notifications tab

Posted: Fri Apr 21, 2017 10:16 am
by btemple
When running a notifications report from the home tab the query takes an extended time to complete. Do you have any suggestions on how to speed this up ?

Re: notifications tab

Posted: Fri Apr 21, 2017 12:50 pm
by cdienger
What is an extended time in this situation? 1 minute, 2, 5? How many notifications total are listed when it eventually returns?

Are you applying any filters to limit the results to specific time period, host, groups, etc? Those are always options if you know kind of what you're looking for and should speed things up a bit.

Re: notifications tab

Posted: Fri Apr 21, 2017 2:37 pm
by btemple
when you launch the notifcations tab it just starts the default query I would say it takes about 5 minutes to finish if it doesn't crash the browser. When I look at top it looks like

mysqld hits 100% and stays - I have ran db repair without resolving the issue

When I close my browser mysqld goes back to 8 -10 %

Re: notifications tab

Posted: Mon Apr 24, 2017 9:59 am
by cdienger
I'll need to poke around a bit to see if there's something we can do to improve the performance of the default query, but in the meantime I believe I have a work around for you to try:

Open /usr/local/nagiosxi/html/reports/notifications.php and find the section that looks like:

Code: Select all

function display_notifications()
{
    global $request;

    // Makes sure user has appropriate license level
    licensed_feature_check();

    // Get values passed in GET/POST request
    $page = grab_request_var("page", 0);
    $reportperiod = grab_request_var("reportperiod", "last24hours");
    $startdate = grab_request_var("startdate", "");
    $enddate = grab_request_var("enddate", "");
    $search = grab_request_var("search", "");
    $host = grab_request_var("host", "");
    $service = grab_request_var("service", "");
    $hostgroup = grab_request_var("hostgroup", "");
    $servicegroup = grab_request_var("servicegroup", "");
     ...
This is the default query that is run. Edit one of the lines to restrict the default search. For example:

Code: Select all

$search = grab_request_var("search", "localhost");
Save the changes to the file, restart the service with service nagios restat, test, and let us know if this helps.

PM me a system profile as well so that I can get a better idea of your Nagios setup. Profiles can be generated and downloaded under Admin > System Config > System Profile.

Re: notifications tab

Posted: Mon Apr 24, 2017 4:08 pm
by cdienger
Received the profile but didn't see anything unusual. Please run the following to export a copy of the notifications table and PM the resulting notifications.sql file:

mysqldump -uroot -pnagiosxi nagios nagios_notifications > notifications.sql

Re: notifications tab

Posted: Tue Apr 25, 2017 1:18 pm
by btemple
please see attched pm too big

Re: notifications tab

Posted: Tue Apr 25, 2017 2:29 pm
by cdienger
Thanks for that! I loaded the table and the amount of entries(~60,000) wasn't causing any problems on a very modest test system. Reviewing the profile again I see that there is frequently a very high load on the machine due to processing performance data. I would recommend following https://assets.nagios.com/downloads/nag ... giosXI.pdf to setup a RAM disk to help with performance. The guide goes into a lot of detail, but the installation is pretty quick and is summed up with:

cd /tmp
wget https://assets.nagios.com/downloads/nag ... ramdisk.sh
chmod +x install_ramdisk.sh
./install_ramdisk.sh

Re: notifications tab

Posted: Tue Apr 25, 2017 4:30 pm
by btemple
Ok we will give it a shot thank you

Re: notifications tab

Posted: Tue Apr 25, 2017 4:33 pm
by cdienger
No problem. Look forward to your update.

Re: notifications tab

Posted: Thu Apr 27, 2017 3:00 pm
by btemple
unfortunaley not better on the notifications link. What is odd is that i ran a "event log" query and the result 4.000 + records came back in like 5- 10 seconds