File nagios-2.12-nagiosQL.patch of Package nagios

diff -ruN nagios-2.12-orig/configure.in nagios-2.12/configure.in
--- nagios-2.12-orig/configure.in	2008-05-19 17:04:31.000000000 +0000
+++ nagios-2.12/configure.in	2008-07-17 17:24:37.560619027 +0000
@@ -163,6 +163,13 @@
 fi 
 AC_SUBST(HTTPD_CONF)
 
+AC_ARG_WITH(nagiosQL,--with-nagiosQL=<yes> creates DIR's needed by nagiosQL (default=no),nagiosQL=$withval,nagiosQL=no)
+AC_SUBST(nagiosQL)
+if test x$withval = xyes; then
+	NAGIOSQL_OPTS="-o $command_user -g $nagios_grp"
+	AC_SUBST(NAGIOSQL_OPTS)
+fi
+
 dnl Check for location of mail program
 MAIL_PROG=no
 AC_ARG_WITH(mail,--with-mail=<path_to_mail> sets path to equivalent program to mail,MAIL_PROG=$withval,MAIL_PROG=no) 
diff -ruN nagios-2.12-orig/Makefile.in nagios-2.12/Makefile.in
--- nagios-2.12-orig/Makefile.in	2007-04-23 15:44:25.000000000 +0000
+++ nagios-2.12/Makefile.in	2008-07-17 17:24:37.592620416 +0000
@@ -29,6 +29,8 @@
 INSTALL=@INSTALL@
 INSTALL_OPTS=@INSTALL_OPTS@
 COMMAND_OPTS=@COMMAND_OPTS@
+NAGIOSQL_OPTS=@NAGIOSQL_OPTS@
+USE_NAGIOSQL=@nagiosQL@
 HTTPD_CONF=@HTTPD_CONF@
 INIT_DIR=@init_dir@
 INIT_OPTS=-o root -g root
@@ -213,12 +215,25 @@
 
 
 install-config:
-	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/nagios.cfg $(DESTDIR)$(CFGDIR)/nagios.cfg
-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/cgi.cfg $(DESTDIR)$(CFGDIR)/cgi.cfg
-	$(INSTALL) -b -m 660 $(INSTALL_OPTS) sample-config/resource.cfg $(DESTDIR)$(CFGDIR)/resource.cfg
-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/template-object/localhost.cfg $(DESTDIR)$(CFGDIR)/localhost.cfg
-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/template-object/commands.cfg $(DESTDIR)$(CFGDIR)/commands.cfg
+	if [ $(USE_NAGIOSQL) = yes ]; then \
+		$(INSTALL) -m 775 $(NAGIOSQL_OPTS) -d $(DESTDIR)$(CFGDIR)/hosts; \
+		$(INSTALL) -m 775 $(NAGIOSQL_OPTS) -d $(DESTDIR)$(CFGDIR)/services; \
+		$(INSTALL) -m 775 $(NAGIOSQL_OPTS) -d $(DESTDIR)$(CFGDIR)/backup/hosts; \
+		$(INSTALL) -m 775 $(NAGIOSQL_OPTS) -d $(DESTDIR)$(CFGDIR)/backup/services; \
+		$(INSTALL) -m 775 $(NAGIOSQL_OPTS) -d $(DESTDIR)$(CFGDIR); \
+		$(INSTALL) -m 664 $(NAGIOSQL_OPTS) sample-config/nagios.cfg $(DESTDIR)$(CFGDIR)/nagios.cfg-sample; \
+		$(INSTALL) -m 664 $(NAGIOSQL_OPTS) sample-config/cgi.cfg $(DESTDIR)$(CFGDIR)/cgi.cfg-sample; \
+		$(INSTALL) -m 660 $(NAGIOSQL_OPTS) sample-config/resource.cfg $(DESTDIR)$(CFGDIR)/resource.cfg-sample; \
+		$(INSTALL) -m 664 $(NAGIOSQL_OPTS) sample-config/template-object/localhost.cfg $(DESTDIR)$(CFGDIR)/localhost.cfg-sample; \
+		$(INSTALL) -m 664 $(NAGIOSQL_OPTS) sample-config/template-object/commands.cfg $(DESTDIR)$(CFGDIR)/commands.cfg-sample;\
+	else \
+		$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR); \
+		$(INSTALL) -m 664 $(INSTALL_OPTS) sample-config/nagios.cfg $(DESTDIR)$(CFGDIR)/nagios.cfg-sample; \
+		$(INSTALL) -m 664 $(INSTALL_OPTS) sample-config/cgi.cfg $(DESTDIR)$(CFGDIR)/cgi.cfg-sample; \
+		$(INSTALL) -m 660 $(INSTALL_OPTS) sample-config/resource.cfg $(DESTDIR)$(CFGDIR)/resource.cfg-sample; \
+		$(INSTALL) -m 664 $(INSTALL_OPTS) sample-config/template-object/localhost.cfg $(DESTDIR)$(CFGDIR)/localhost.cfg-sample; \
+		$(INSTALL) -m 664 $(INSTALL_OPTS) sample-config/template-object/commands.cfg $(DESTDIR)$(CFGDIR)/commands.cfg-sample; \
+	fi
 
 	@echo ""
 	@echo "*** Sample config file installed ***"
diff -ruN nagios-2.12-orig/sample-config/nagios.cfg.in nagios-2.12/sample-config/nagios.cfg.in
--- nagios-2.12-orig/sample-config/nagios.cfg.in	2006-12-22 01:43:20.000000000 +0000
+++ nagios-2.12/sample-config/nagios.cfg.in	2008-07-17 17:28:50.891627936 +0000
@@ -31,24 +31,30 @@
 # separate from host and contact definitions...
 
 # Command definitions
-cfg_file=@sysconfdir@/commands.cfg
+cfg_file=@sysconfdir@/checkcommands.cfg
 
 # Host and service definitions for monitoring this machine
-cfg_file=@sysconfdir@/localhost.cfg
+#cfg_file=@sysconfdir@/localhost.cfg
 
 
 # You can split other types of object definitions across several
 # config files if you wish (as done here), or keep them all in a
 # single config file.
 
-#cfg_file=@sysconfdir@/contactgroups.cfg
-#cfg_file=@sysconfdir@/contacts.cfg
-#cfg_file=@sysconfdir@/dependencies.cfg
-#cfg_file=@sysconfdir@/escalations.cfg
-#cfg_file=@sysconfdir@/hostgroups.cfg
+cfg_file=@sysconfdir@/contactgroups.cfg
+cfg_file=@sysconfdir@/contacts.cfg
+cfg_file=@sysconfdir@/hostdependencies.cfg
+cfg_file=@sysconfdir@/hostescalations.cfg
+cfg_file=@sysconfdir@/hostextinfo.cfg
+cfg_file=@sysconfdir@/hostgroups.cfg
+cfg_file=@sysconfdir@/misccommands.cfg
 #cfg_file=@sysconfdir@/hosts.cfg
 #cfg_file=@sysconfdir@/services.cfg
-#cfg_file=@sysconfdir@/timeperiods.cfg
+cfg_file=@sysconfdir@/servicedependencies.cfg
+cfg_file=@sysconfdir@/serviceescalations.cfg
+cfg_file=@sysconfdir@/serviceextinfo.cfg
+cfg_file=@sysconfdir@/servicegroups.cfg
+cfg_file=@sysconfdir@/timeperiods.cfg
 
 # Extended host/service info definitions are now stored along with
 # other object definitions:
@@ -63,6 +69,8 @@
 #cfg_dir=@sysconfdir@/printers
 #cfg_dir=@sysconfdir@/switches
 #cfg_dir=@sysconfdir@/routers
+cfg_dir=@sysconfdir@/hosts
+cfg_dir=@sysconfdir@/services
 
 
 
@@ -124,7 +132,7 @@
 # you will have to enable this.  Setting this value to 0 disables command
 # checking (the default), other values enable it.
 
-check_external_commands=0
+check_external_commands=1
 
 
 
openSUSE Build Service is sponsored by