Page 1 of 1

[Nagios-devel] waste of cpu in status summary

Posted: Wed Oct 27, 2010 1:51 pm
by Guest
This is a multi-part message in MIME format.
--------------040502050801010604030702
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Dear list,

introduced with http://nagios.cvs.sourceforge.net/viewv ... 81&r2=1.82
the servicegroup summary calculation has been corrected, but unfortunately a useless loop over all
services for every host has been left over. This leads to very long loading page times. The Servicegroup summary for all
groups took around 8seconds but the summary for a single group took over 8 minutes.
Please have a look at the attached patch (diff is against the 3.2.3 release) which removes the useless loop.
The patch is sponsored by TomTom, so if you want to give kudos to someone, then TomTom are the ones you are looking for.

Regards,
Sven

--
Sven Nierlein [email protected]
ConSol* GmbH http://www.consol.de
Franziskanerstrasse 38 Tel.:089/45841-439
81669 Muenchen Fax.:089/45841-115

--------------040502050801010604030702
Content-Type: text/x-patch; name="0001-fix_cpu_usage_of_status_summary.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="0001-fix_cpu_usage_of_status_summary.patch"

--- cgi/status.c-2010-10-27 2010-10-27 14:41:46.000000000 +0200
+++ cgi/status.c 2010-10-27 14:50:36.000000000 +0200
@@ -1013,17 +1013,10 @@
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;
- }
- }
-
- }
- }
+ else if(is_host_member_of_servicegroup(find_servicegroup(servicegroup_name),temp_host)==TRUE){
+ count_host=1;
+ }
+ }
else if(display_type==DISPLAY_HOSTGROUPS && (show_all_hostgroups==TRUE || (is_host_member_of_hostgroup(find_hostgroup(hostgroup_name),temp_host)==TRUE)))
count_host=1;



--------------040502050801010604030702--





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