I'm wondering if anyone has been able to successfully implement this or
a similar patch to Nagios-1.1. The patch fails for me with hunk failed
errors. If anyone has a copy of a different patch that works, could you
send a copy my way?
Thanks,
Jason Lancaster
David Parrish wrote:
> Attached is another patch to Nagios 1.1 which hugely speeds up the CGIs.
> This is a big benefit when monitoring a lot (~ 7000) of services, but there
> will be a benefit for a smaller number too.
>
> Profiling shows that most of the time taken to run the CGI is in loading
> the list of services and sticking them into a sorted list.
>
> This patch turns loading the service list into a 2 step process:
>
> 1. Load the services into a binary tree (glib)
> 2. Flatten the tree down into the sorted list.
>
> Before, the CGI took between 3-10 seconds to run, now it takes 0.2 seconds.
>
> FYI I didn't write this patch, my boss did. I'm just submitting it.
>
>
>
> ------------------------------------------------------------------------
>
> Index: base/Makefile.in
> ===================================================================
> RCS file: /home/cvs/repos/nagios_source/base/Makefile.in,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 Makefile.in
> --- base/Makefile.in 23 Jun 2003 01:56:10 -0000 1.1.1.1
> +++ base/Makefile.in 5 Sep 2003 01:45:51 -0000
> @@ -10,9 +10,9 @@
> SRC_XDATA=../xdata
>
> CC=@CC@
> -CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE
> +CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE `glib-config --cflags`
> #CFLAGS=-O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DHAVE_CONFIG_H -DNSCORE
> -LDFLAGS=@LDFLAGS@ @LIBS@
> +LDFLAGS=@LDFLAGS@ @LIBS@ `glib-config --libs`
>
> prefix=@prefix@
> exec_prefix=@exec_prefix@
> Index: cgi/Makefile.in
> ===================================================================
> RCS file: /home/cvs/repos/nagios_source/cgi/Makefile.in,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 Makefile.in
> --- cgi/Makefile.in 23 Jun 2003 01:56:10 -0000 1.1.1.1
> +++ cgi/Makefile.in 5 Sep 2003 01:45:51 -0000
> @@ -25,9 +25,9 @@
>
> CP=@CP@
> CC=@CC@
> -CFLAGS=@CFLAGS@ @DEFS@ -DNSCGI
> +CFLAGS=@CFLAGS@ @DEFS@ -DNSCGI `glib-config --cflags`
> #CFLAGS=-O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DHAVE_CONFIG_H -DNSCGI
> -LDFLAGS=@LDFLAGS@ @LIBS@
> +LDFLAGS=@LDFLAGS@ @LIBS@ `glib-config --libs`
>
> CGIS=avail.cgi cmd.cgi config.cgi extinfo.cgi history.cgi notifications.cgi outages.cgi showlog.cgi status.cgi statuswml.cgi summary.cgi tac.cgi $(CGIEXTRAS)
>
> Index: common/common.h
> ===================================================================
> RCS file: /home/cvs/repos/nagios_source/common/common.h,v
> retrieving revision 1.1.1.2
> diff -u -r1.1.1.2 common.h
> --- common/common.h 23 Jun 2003 01:57:24 -0000 1.1.1.2
> +++ common/common.h 5 Sep 2003 01:45:51 -0000
> @@ -208,8 +208,12 @@
> #define OK 0
> #define ERROR -2 /* value was changed from -1 so as to not interfere with STATUS_UNKNOWN plugin result */
>
> +#ifndef TRUE
> #define TRUE 1
> +#endif
> +#ifndef FALSE
> #define FALSE 0
> +#endif
>
>
> /****************** HOST CONFIG FILE READING OPTIONS ********************/
> Index: common/config.h.in
> ===================================================================
> RCS file: /home/cvs/repos/nagios_source/common/config.h.in,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 config.h.in
> --- common/config.h.in 23 Jun 2003 01:56:10 -0000 1.1.1.1
> +++ common/config.h.in 5 Sep 2003 01:45:51 -0000
> @@ -214,3 +214,7 @@
> #include
> #endif
>
> +#define HAVE_GLIB_H 1
> +#ifdef HAVE_GLIB_H
> +#include
> +#endif
> Index: common/objects.c
> ===================================================================
> RCS file: /home/cvs/repos/nagios_source/common/objects.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 objects.c
> --- common/objects.c 23 Jun 2003 01:56:10 -0000 1.1.1.1
> +++ common/objects.c 5 Sep 2003 01:45:51 -0000
> @@ -59,6 +59,8 @@
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]