CGI files that use Livestatus

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
delboy1966
Posts: 94
Joined: Thu Oct 22, 2015 5:26 am

CGI files that use Livestatus

Post by delboy1966 »

I have found that as we add more hosts and service checks to Nagios and more people are using the Web GUI that the Web GUI doesn't pull and display data as quickly as it used to.
Even though I have tried to enhance performance as much as possible and we have worker nodes doing checks etc, its still isn't as fast as it used to be.
Its not a massive delay, sometimes the worst it gets is having to wait about 4/5 seconds for a page to load when calling service information using the extinfo.cgi.
I guess because its pulling data from the status.dat file which is constantly being written to and read from, I currently have this on a RamDisk.

I compared this to some custom reports I wrote that were requested by management, they pull as much data as the Nagios cgi pages but are far more quicker.
My CGI pages get their data directly from the Livestatus module, so it set me wondering how fast pages like extinfo.cgi would be if they pulled data using the Livestatus module.
So I wrote a new script to display the data that gets displayed calling "extinfo.cgi?type=2&host=<host name>&service=<service name>" , but my script used the Livestatus module to get the data.
I was amazed that the script I wrote displayed all the data on other page in a split second, compared to 2 to 3 seconds calling the same data using extinfo.cgi.

So I was wondering if anyone had rewrote the Nagios CGI scripts to use the Livestatus module or if there were any plans to actual do this within the Nagios Project itself for future releases.
Maybe make both sets of CGI scripts available, in case people didn't use the Livestatus module.

If not I think I'll be rewriting some more of the Nagios CGI scripts to use Livestatus.

Thanks
Tony
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: CGI files that use Livestatus

Post by mcapra »

The current milestones for Nagios Core 5 are available here:
https://github.com/NagiosEnterprises/na ... ilestone/4

The official roadmap for Nagios Core 5 is available here:
https://www.nagios.com/roadmaps/

Per all of that, and this specific GitHub issue:
https://github.com/NagiosEnterprises/na ... issues/143

Most of the CGIs, and the GUI generally, are getting serious overhauls with Nagios Core 5.
Former Nagios employee
https://www.mcapra.com/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: CGI files that use Livestatus

Post by dwhitfield »

mcapra wrote:Most of the CGIs, and the GUI generally, are getting serious overhauls with Nagios Core 5.
Unfortunately though, no release date. I can't really say if it's better to go ahead and start your rewrite or wait for Core 5.

Suppose this is selfish of me, but I think a better use of your time might be to help with Core 5 development and once it is out you or someone else in the community could get the Core 5 CGIs working with livestatus.

The flip side is that people still use Core 3. I'm sure people will be using Core 4 for years to come.
delboy1966
Posts: 94
Joined: Thu Oct 22, 2015 5:26 am

Re: CGI files that use Livestatus

Post by delboy1966 »

Getting the CGIs working with Livestatus would be great as they pages load so much quicker.

Thus far I've only got extinfo.cgi working with Livestatus and it works well.
There is no snag with using livestatus, in that it doesn't seem to give you some Nagios data via it.

1. Stuff like the page reload time set in nagios.cfg
2. Although you can find who is authorised to view hosts/services using the AuthUser option. It doesn't give you the readonly user or those authorised for hosts/services in cgi.cfg.

I've got round it by parsing the files and pulling the data out.

Tony
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: CGI files that use Livestatus

Post by dwhitfield »

delboy1966 wrote: There is no snag with using livestatus, in that it doesn't seem to give you some Nagios data via it.
I'm not sure I understand the above line. Could you explain a bit more about it. That sounds like a snag to me.
delboy1966
Posts: 94
Joined: Thu Oct 22, 2015 5:26 am

Re: CGI files that use Livestatus

Post by delboy1966 »

The Livestatus module doesn't give you Nagios process, performance data and no information regarding settings in nagios.cfg and cgi.cfg.

Its restricted to giving you host, service information.

For instance rewriting the extinfo.cgi for type=3 (Program-Wide Performance Information) you can't use the Livestatus moudle.
I had to use nagiostats to get that information, although using nagiostats doesn't give you "Since program start" values for active/passives services and active/passive host checks, which makes it impossible to work out the percentages for each values returned.

Tony
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: CGI files that use Livestatus

Post by dwhitfield »

I'm still not sure if you are asking us a question. If you'd like to get involved in development, or have feature requests, the place to do that is github: https://github.com/NagiosEnterprises/na ... ilestone/4

If you do have a support question, could you please rephrase it? Thanks!
delboy1966
Posts: 94
Joined: Thu Oct 22, 2015 5:26 am

Re: CGI files that use Livestatus

Post by delboy1966 »

I guess I am just passing comment on what I have found, and maybe hoping someone has done most of the leg work and has the CGIs working with Livestatus.

I have logged a feature request at Github now.

Thanks
Tony
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: CGI files that use Livestatus

Post by dwhitfield »

Excellent. We can leave this open for any community input.
Locked