Ajax refresh rate

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Ajax refresh rate

Post by SteveBeauchemin »

I would like to change the web browser refresh rate for my site.

In the normal Nagios GUI - that shows Host / Service / ... / Status Information - I would like to control the speed at which the items on the page are refreshed. I find that if I increase the refresh rates in NagVis it reduces the overall server load. It reduces the speed at which my /var/log/httpd/*_log files scroll by. and makes the Nagios host a little happier.

I made these changes in my NagVis configuration - in each of the sections bracketed here

Code: Select all

vi /usr/local/nagvis/etc/nagvis.ini.php
[global]
refreshtime=120
[worker]
interval=30
updateobjectstates=60
This reduced the log file scrolling quite a bit, and reduced my system load caused by http refreshes.

I would like to do basically the same thing with the Nagios XI GUI. When someone leaves the page open, and gets the ajax refreshes, I want to set a larger time interval.

Is there some .php edit or .js edit I can do? Is jquery.timers a place to look?

(Dashlet timers already increased long ago)

Thanks

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Ajax refresh rate

Post by avandemore »

Have you looked at the settings in XI > Admin > Performance Settings?

More details about it are described here: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Previous Nagios employee
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ajax refresh rate

Post by ssax »

Actually, just saw that you already adjusted them, which items are still being run all the time? They all should be adjustable on that page.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Ajax refresh rate

Post by SteveBeauchemin »

Normal GUI red yellow green stuff... like these
snap.PNG
End User refresh rate stuff.

Steve B
You do not have the required permissions to view the files attached to this post.
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ajax refresh rate

Post by ssax »

Please attach the entries that are still scrolling in the /var/log/httpd/*_log files.


Thank you
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Ajax refresh rate

Post by SteveBeauchemin »

From the log

Code: Select all

cd /var/log/httpd
tail -f *_log
The data is...

Code: Select all

==> ssl_access_log <==
IP.180 - - [02/Jun/2017:14:10:00 -0500] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_servicestatus_table%22%2C%22args%22%3A%7B%22host%22%3A%22%22%2C%22hostgroup%22%3A%22%22%2C%22servicegroup%22%3A%22%22%2C%22sortby%22%3A%22%22%2C%22sortorder%22%3A%22asc%22%2C%22records%22%3A%2215%22%2C%22page%22%3A%221%22%2C%22search%22%3A%22fwarincn01%22%2C%22hostattr%22%3A%220%22%2C%22serviceattr%22%3A%220%22%2C%22hoststatustypes%22%3A%220%22%2C%22servicestatustypes%22%3A%220%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 200 19014

==> ssl_request_log <==
[02/Jun/2017:14:10:00 -0500] IP.180 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_servicestatus_table%22%2C%22args%22%3A%7B%22host%22%3A%22%22%2C%22hostgroup%22%3A%22%22%2C%22servicegroup%22%3A%22%22%2C%22sortby%22%3A%22%22%2C%22sortorder%22%3A%22asc%22%2C%22records%22%3A%2215%22%2C%22page%22%3A%221%22%2C%22search%22%3A%22fwarincn01%22%2C%22hostattr%22%3A%220%22%2C%22serviceattr%22%3A%220%22%2C%22hoststatustypes%22%3A%220%22%2C%22servicestatustypes%22%3A%220%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 19014

==> ssl_access_log <==
IP.180 - - [02/Jun/2017:14:10:06 -0500] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_detailed_info_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22crulnxicore01.rockwellcollins.com%22%2C%22host_id%22%3A%2289595%22%2C%22display%22%3A%22simple%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 200 660

==> ssl_request_log <==
[02/Jun/2017:14:10:06 -0500] IP.180 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_detailed_info_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22crulnxicore01.rockwellcollins.com%22%2C%22host_id%22%3A%2289595%22%2C%22display%22%3A%22simple%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 660

==> access_log <==
::1 - - [02/Jun/2017:14:10:07 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips PHP/5.4.16 (internal dummy connection)"

==> ssl_access_log <==
IP.180 - - [02/Jun/2017:14:10:06 -0500] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_state_summary_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22crulnxicore01.rockwellcollins.com%22%2C%22host_id%22%3A%2289595%22%2C%22display%22%3A%22simple%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 200 342

==> ssl_request_log <==
[02/Jun/2017:14:10:06 -0500] IP.180 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_state_summary_html%22%2C%22args%22%3A%7B%22hostname%22%3A%22crulnxicore01.rockwellcollins.com%22%2C%22host_id%22%3A%2289595%22%2C%22display%22%3A%22simple%22%7D%7D&nsp=fcc2b44c0dabdd573c9d6f3e0b2e893a2ff7f60e60f21ef41b7684f8b7c066bd HTTP/1.1" 342

==> ssl_access_log <==
IP.53 - - [02/Jun/2017:14:10:07 -0500] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_component_states_html%22%2C%22args%22%3A%22%22%7D&nsp=5e75b360d98f149bfe6c016bb329587151bb872298d75606da32c0e72c690f31 HTTP/1.1" 200 5339

==> ssl_request_log <==
[02/Jun/2017:14:10:07 -0500] IP.53 TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_component_states_html%22%2C%22args%22%3A%22%22%7D&nsp=5e75b360d98f149bfe6c016bb329587151bb872298d75606da32c0e72c690f31 HTTP/1.1" 5339

==> access_log <==
::1 - - [02/Jun/2017:14:10:08 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips PHP/5.4.16 (internal dummy connection)"

==> ssl_access_log <==
IP.25 - - [02/Jun/2017:14:10:09 -0500] "GET /nagiosxi/ajaxhelper.php?cmd=getxicoreajax&opts=%7B%22func%22%3A%22get_host_status_summary_html%22%2C%22args%22%3A%7B%22host%22%3A%22%22%2C%22hostgroup%22%3A%22%22%2C%22servicegroup%22%3A%22%22%2C%22hostattr%22%3A%220%22%2C%22serviceattr%22%3A%220%22%2C%22hoststatustypes%22%3A%220%22%2C%22servicestatustypes%22%3A%220%22%2C%22show%22%3A%22services%22%7D%7D&nsp=5f9fc948e3a611423f3fc87c053ac158218c325be45d36f1a925f486e17721e5 HTTP/1.1" 200 2090

I think the end users could live with a less frenetic refresh in their web browsers. I want some control.

Thanks

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ajax refresh rate

Post by ssax »

Hmm, I see some hard-coded times, let me see if I can provide a workaround, I will update you shortly.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Ajax refresh rate

Post by ssax »

*** Note: This will get reverted if you upgrade and will need to be reimplemented.
*** Make sure that you have known-good backups/vm snapshots before making any modifications

I will submit a feature request for this but what you'll need to do is:

Make a backup of these files:

Code: Select all

/usr/local/nagiosxi/html/includes/components/xicore/status-object-detail.inc.php
/usr/local/nagiosxi/html/includes/components/xicore/status-utils.inc.php
/usr/local/nagiosxi/html/includes/components/xicore/status.php
In each one of those files, search for everyTime and change every occurrence to how many seconds you'd like (change the first number before the *):

30 Seconds:

Code: Select all

...blah.everyTime(30*1000, blah...
60 Seconds:

Code: Select all

...blah.everyTime(60*1000, blah...
Thank you
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Ajax refresh rate

Post by SteveBeauchemin »

Sean,

This is exactly what I was looking for. I will be testing over the next couple weeks to see if anyone notices any differences. If I increase the refresh rates, and no one cares but me, then all is well. My goal is to squeeze out as much performance from the testing side of the Nagios engine as possible. User screen refreshes being a little slower for 95% of the end users is not going to be a problem.

What could be more awesome? You ask? I'll tell you. If I could control by contact or contact group what refresh speeds I dole out. I would set every normal user to a higher delay. Then I would change the Data Center users back to normal. The Data Center folks at my site watch the screen 24 x 7 x 365. To them, I would give normal untouched refresh. Everyone else can get the slow refresh. Not that I am asking for this as a request. I am not. I am just saying that a control to do that would be very nice.

Anyway, Thanks for the data. I will post my actual numbers in a week or so. Showing a before and after of my settings. I do not know if I will have any perf graphs to show that indicate my system improvement. Even if it is just improved in my imagination, I still appreciate it.

Thanks :D :D :D

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Ajax refresh rate

Post by avandemore »

Thanks will leave the thread open in case you have further feedback in the near future.
Previous Nagios employee
Locked