[Nagios-devel] nagios 3.2.1 vs 3.2.3 status.cgi major performance

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
Guest

[Nagios-devel] nagios 3.2.1 vs 3.2.3 status.cgi major performance

Post by Guest »

--------------010904040709040904060608
Content-Type: text/plain; charset="ISO-8859-15"; format=flowed
Content-Transfer-Encoding: 7bit

We're observing a major performance regression in status.cgi, related to
servicegroup browsing
(/cgi-bin/nagios3/status.cgi?servicegroup=Enviroment&style=detail&&hoststatustypes=2&hostprops=0
links and similar) between nagios 3.2.1 and 3.2.3.

Time to browse a servicegroup increases from seconds in 3.2.1 to
minutes/timeout (having status.cgi on 100% CPU).

Simply reverting to 3.2.1 status.c (patch attached) in 3.2.3 solves the
problem. This is on debian squeezy amd64, packages recompiled from .deb
sources.

I've uploaded servicegroup file here:

http://62.196.71.254/nagios-dev/servicegroups.cfg.gz

More info on request.

Kind regards,
R



--------------010904040709040904060608
Content-Type: text/plain; name="status.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="status.c.diff"
Content-Description: status.c.diff

--- nagios3-3.2.3/cgi/status.c 2010-09-21 17:05:31.000000000 +0200
+++ nagios3-3.2.1/cgi/status.c 2009-09-12 01:55:30.000000000 +0200
@@ -2,8 +2,8 @@
*
* STATUS.C - Nagios Status CGI
*
- * Copyright (c) 1999-2010 Ethan Galstad ([email protected])
- * Last Modified: 08-05-2020
+ * Copyright (c) 1999-2009 Ethan Galstad ([email protected])
+ * Last Modified: 07-03-2009
*
* License:
*
@@ -992,6 +992,7 @@
hoststatus *temp_hoststatus;
host *temp_host;
servicestatus *temp_servicestatus;
+ service *temp_service;
int count_host;


@@ -1010,18 +1011,18 @@
if(display_type==DISPLAY_HOSTS && (show_all_hosts==TRUE || !strcmp(host_name,temp_hoststatus->host_name)))
count_host=1;
else if(display_type==DISPLAY_SERVICEGROUPS){
- if(show_all_servicegroups==TRUE){
+ if(show_all_servicegroups==TRUE)
count_host=1;
- }
else{
-
for(temp_servicestatus=servicestatus_list;temp_servicestatus!=NULL;temp_servicestatus=temp_servicestatus->next){
- if(is_host_member_of_servicegroup(find_servicegroup(servicegroup_name),temp_host)==TRUE){
- count_host=1;
- break;
- }
+ if(strcmp(temp_servicestatus->host_name,temp_hoststatus->host_name))
+ continue;
+ temp_service=find_service(temp_servicestatus->host_name,temp_servicestatus->description);
+ if(is_authorized_for_service(temp_service,&current_authdata)==FALSE)
+ continue;
+ count_host=1;
+ break;
}
-
}
}
else if(display_type==DISPLAY_HOSTGROUPS && (show_all_hostgroups==TRUE || (is_host_member_of_hostgroup(find_hostgroup(hostgroup_name),temp_host)==TRUE)))

--------------010904040709040904060608--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked