[csw-devel] SF.net SVN: gar:[5399] csw/mgar/pkg/ndoutils/trunk

j_arndt at users.sourceforge.net j_arndt at users.sourceforge.net
Mon Jun 29 12:46:49 CEST 2009


Revision: 5399
          http://gar.svn.sourceforge.net/gar/?rev=5399&view=rev
Author:   j_arndt
Date:     2009-06-29 10:46:47 +0000 (Mon, 29 Jun 2009)

Log Message:
-----------
ndoutils: changed file system layout to opencsw standard, minor changes to install and start scripts

Modified Paths:
--------------
    csw/mgar/pkg/ndoutils/trunk/Makefile
    csw/mgar/pkg/ndoutils/trunk/checksums
    csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.gspec
    csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.postinstall
    csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.prototype
    csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.postinstall
    csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.prototype
    csw/mgar/pkg/ndoutils/trunk/files/config.diff
    csw/mgar/pkg/ndoutils/trunk/files/cswndoutils

Modified: csw/mgar/pkg/ndoutils/trunk/Makefile
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/Makefile	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/Makefile	2009-06-29 10:46:47 UTC (rev 5399)
@@ -17,8 +17,8 @@
 DISTFILES += $(call admfiles,CSWndoutils3x, prototype postinstall)
 DISTFILES += cswndoutils
 
-PATCHFILES += config.diff
-PATCHFILES += installdb.diff
+#PATCHFILES += config.diff
+#PATCHFILES += installdb.diff
 
 # We define upstream file regex so we can be notifed of new upstream software release
 #UFILES_REGEX = -(\d+(?:\.\d+)*).tar.gz
@@ -51,6 +51,7 @@
 CFGDIR = $(prefix)/nagios/ndoutils/etc
 BINDIR = $(prefix)/nagios/ndoutils/bin
 DOCDIR = $(prefix)/share/doc/ndoutils
+VARDIR = /var/opt/csw/ndoutils
 CONTRIBDIR = $(prefix)/nagios/ndoutils/contrib
 DOCS = Changelog README REQUIREMENTS TODO UPGRADING 
 
@@ -62,12 +63,12 @@
 	@ginstall -m 755 -d $(DESTDIR)/$(CFGDIR)
 	@ginstall -m 755 -d $(DESTDIR)/$(BINDIR)
 	@ginstall -m 755 -d $(DESTDIR)/$(DOCDIR)
+	@ginstall -m 755 -d $(DESTDIR)/$(VARDIR)
 	@ginstall -m 755 -d $(DESTDIR)/$(localstatedir)
 	@ginstall -m 755 -d $(DESTDIR)/$(CONTRIBDIR)/db
 	@ginstall -m 644 $(WORKSRC)/config/ndo2db.cfg $(DESTDIR)/$(CFGDIR)/ndo2db.cfg.CSW
 	@ginstall -m 644 $(WORKSRC)/config/ndomod.cfg $(DESTDIR)/$(CFGDIR)/ndomod.cfg.CSW
-	@ginstall -m 644 $(WORKSRC)/config/nagios2.cfg $(DESTDIR)/$(CFGDIR)/nagios2.cfg.CSW
-	@ginstall -m 644 $(WORKSRC)/config/nagios3.cfg $(DESTDIR)/$(CFGDIR)/nagios3.cfg.CSW
+	@ginstall -m 644 $(WORKSRC)/config/nagios.cfg $(DESTDIR)/$(CFGDIR)/nagios.cfg-sample
 	@ginstall -m 644 $(WORKSRC)/config/misccommands.cfg $(DESTDIR)/$(CFGDIR)/ndomisccommands.cfg.CSW
 	@ginstall -m 755 $(WORKSRC)/src/ndo2db-2x $(DESTDIR)/$(BINDIR)
 	@ginstall -m 755 $(WORKSRC)/src/ndo2db-3x $(DESTDIR)/$(BINDIR)

Modified: csw/mgar/pkg/ndoutils/trunk/checksums
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/checksums	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/checksums	2009-06-29 10:46:47 UTC (rev 5399)
@@ -1,10 +1,8 @@
-a454f7434f401bd48047cc42b045ff8b  download/ndoutils-1.4b7.tar.gz
-cde137a94e5ab14705407a9b55e2a947  download/CSWndoutils2x.gspec
-eb253a3c37b6f9240aa2625ae67fd832  download/CSWndoutils2x.prototype
-b9897c5e7715f5b188655b7e9bdc451b  download/CSWndoutils2x.postinstall
+b0f05504f28223ede6d986f64d4f2d8f  download/CSWndoutils2x.gspec
+86e430bdcd2e3681fa73b2280b435406  download/CSWndoutils2x.postinstall
+112f43af18ab868bfc9cf8dad8e11c55  download/CSWndoutils2x.prototype
 5b1fa6c2971d0f13d1e56ab7bb9939bd  download/CSWndoutils3x.gspec
-eb253a3c37b6f9240aa2625ae67fd832  download/CSWndoutils3x.prototype
-18c01d48f73ba5384d9b011edf6bc91e  download/CSWndoutils3x.postinstall
-4da9261cd9a7d499454625aa229f0cef  download/cswndoutils
-28d9fb431e6f6ebb6ff49f0b918d0795  download/config.diff
-a1d5f59d751be796f367a1eb8b0db7c3  download/installdb.diff
+86e430bdcd2e3681fa73b2280b435406  download/CSWndoutils3x.postinstall
+70ab91abfc5447c5bf9c0ab74b52a94c  download/CSWndoutils3x.prototype
+842170f59e6f5092554ca7a3b3ce6d95  download/cswndoutils
+a454f7434f401bd48047cc42b045ff8b  download/ndoutils-1.4b7.tar.gz

Modified: csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.gspec
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.gspec	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.gspec	2009-06-29 10:46:47 UTC (rev 5399)
@@ -1,3 +1,3 @@
-%var            bitname ndotuils2x
+%var            bitname ndoutils2x
 %var           	pkgname CSWndoutils2x
 %include        url file://%{PKGLIB}/csw_dyndepend.gspec

Modified: csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.postinstall
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.postinstall	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.postinstall	2009-06-29 10:46:47 UTC (rev 5399)
@@ -2,24 +2,27 @@
 
 cat << EOF
 
- To initialize the database follow these steps:"
+ To initialize the database follow these steps:
 
- Setup a database in your MySQL-Server:"
+ - Setup a database in your MySQL-Server:
 
- CREATE DATABASE nagios;"
- GRANT CREATE, SELECT, INSERT, UPDATE, DELETE ON nagios.* TO 'nagios' \\"
- IDENTIFIED BY 'nagios';"
+   CREATE DATABASE nagios;
+   GRANT CREATE, SELECT, INSERT, UPDATE, DELETE ON nagios.* TO 'nagios' \\
+   IDENTIFIED BY 'nagios';
 
- (user / password are the defaults - if you change them keep in mind, "
- that you have to change the configuration of apps depending on"
- ndoutils too, i.e., NagVis)"
+   (user / password are the defaults - if you change them keep in mind,
+   that you have to change the configuration of apps depending on
+   ndoutils too, i.e., NagVis)
 
- Run the perl script installdb to initialize the database with the"
- necessary tables:"
+ - Run the perl script installdb to fill the database with the
+   necessary tables:
 
- cd /opt/csw/nagios/ndoutils/contrib/db/"
- ./installdb"
+   cd /opt/csw/nagios/ndoutils/contrib/db/
+   ./installdb
 
- Restart the NDO-Service
+ - (Re)start the NDO-Service
 
+ - Change your nagios.cfg -> /opt/csw/nagios/ndoutils/etc/nagios.cfg-sample
+ 
+ - (Re)start nagios
 EOF

Modified: csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.prototype
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.prototype	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils2x.prototype	2009-06-29 10:46:47 UTC (rev 5399)
@@ -1,12 +1,13 @@
 f none /opt/csw/nagios/ndoutils/bin/file2sock 0755 nagios nagios
 f none /opt/csw/nagios/ndoutils/bin/log2ndo 0755 nagios nagios
-f none /opt/csw/nagios/ndoutils/bin/ndo2db-3x 0755 nagios nagios
-f none /opt/csw/nagios/ndoutils/bin/ndomod-3x.o 0755 nagios nagios
+f none /opt/csw/nagios/ndoutils/bin/ndo2db-2x 0755 nagios nagios
+f none /opt/csw/nagios/ndoutils/bin/ndomod-2x.o 0755 nagios nagios
 d none /opt/csw/nagios/ndoutils/etc 0755 nagios nagios
+d none /var/opt/csw/ndoutils 0755 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndo2db.cfg.CSW 0644 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndomod.cfg.CSW 0644 nagios nagios
-f cswpreserveconf /opt/csw/nagios/ndoutils/etc/nagios3.cfg.CSW 0644 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndomisccommands.cfg.CSW 0644 nagios nagios
+f none /opt/csw/nagios/ndoutils/etc/nagios.cfg-sample 0644 nagios nagios
 d none /opt/csw/share/doc/ndoutils 0755 root bin
 f none /opt/csw/share/doc/ndoutils/Changelog 0644 root bin
 f none /opt/csw/share/doc/ndoutils/NDOUTILS_DB_Model.pdf 0644 root bin

Modified: csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.postinstall
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.postinstall	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.postinstall	2009-06-29 10:46:47 UTC (rev 5399)
@@ -20,10 +20,9 @@
    cd /opt/csw/nagios/ndoutils/contrib/db/
    ./installdb
 
- !!! Before starting NDOutils make sure, that the user running NDOutils
- (default: "nagios") has a valid login shell. The default for "nagios" is
- /bin/false which won't work.
-
  - (Re)start the NDO-Service
 
+ - Change your nagios.cfg -> /opt/csw/nagios/ndoutils/etc/nagios.cfg-sample
+ 
+ - (Re)start nagios
 EOF

Modified: csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.prototype
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.prototype	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/CSWndoutils3x.prototype	2009-06-29 10:46:47 UTC (rev 5399)
@@ -3,10 +3,11 @@
 f none /opt/csw/nagios/ndoutils/bin/ndo2db-3x 0755 nagios nagios
 f none /opt/csw/nagios/ndoutils/bin/ndomod-3x.o 0755 nagios nagios
 d none /opt/csw/nagios/ndoutils/etc 0755 nagios nagios
+d none /var/opt/csw/ndoutils 0755 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndo2db.cfg.CSW 0644 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndomod.cfg.CSW 0644 nagios nagios
-f cswpreserveconf /opt/csw/nagios/ndoutils/etc/nagios3.cfg.CSW 0644 nagios nagios
 f cswpreserveconf /opt/csw/nagios/ndoutils/etc/ndomisccommands.cfg.CSW 0644 nagios nagios
+f none /opt/csw/nagios/ndoutils/etc/nagios.cfg-sample 0644 nagios nagios
 d none /opt/csw/share/doc/ndoutils 0755 root bin
 f none /opt/csw/share/doc/ndoutils/Changelog 0644 root bin
 f none /opt/csw/share/doc/ndoutils/NDOUTILS_DB_Model.pdf 0644 root bin

Modified: csw/mgar/pkg/ndoutils/trunk/files/config.diff
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/config.diff	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/config.diff	2009-06-29 10:46:47 UTC (rev 5399)
@@ -1,73 +1,35 @@
 diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/misccommands.cfg ndoutils-1.4b7/config/misccommands.cfg
 --- ndoutils-1.4b7.orig/config/misccommands.cfg	2007-01-08 01:35:58.000000000 +0100
-+++ ndoutils-1.4b7/config/misccommands.cfg	2009-03-25 19:26:16.530574647 +0100
++++ ndoutils-1.4b7/config/misccommands.cfg	2009-06-29 12:35:20.907885672 +0200
 @@ -7,5 +7,5 @@
  
  define command{
  	command_name	rotate_ndo_log
 -	command_line	/bin/mv /usr/local/nagios/var/ndo.dat /usr/local/nagios/var/ndo.`date +%s`
-+	command_line	/bin/mv /opt/csw/nagios/ndoutils/var/ndo.dat /opt/csw/nagios/ndoutils/var/ndo.`date +%s`
++	command_line	/bin/mv /var/opt/csw/ndoutils/ndo.dat /var/opt/csw/ndoutils/ndo.`date +%s`
          }
-diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/nagios2.cfg ndoutils-1.4b7/config/nagios2.cfg
---- ndoutils-1.4b7.orig/config/nagios2.cfg	1970-01-01 01:00:00.000000000 +0100
-+++ ndoutils-1.4b7/config/nagios2.cfg	2009-03-25 19:28:01.481126866 +0100
-@@ -0,0 +1,11 @@
-+# SAMPLE NAGIOS CONFIG SNIPPET FOR NDOMOD
-+#
-+# In order to have Nagios run the NDOMOD event broker module, you'll need
-+# to place a statement like the one found below in your main Nagios
-+# configuration file (nagios.cfg).  Adjust the paths, etc. to suit your needs.
-+
-+# Uncomment the line below if you're running Nagios 2.x
-+broker_module=/opt/csw/nagios/ndoutils/bin/ndomod-2x.o config_file=/opt/csw/nagios/ndoutils/etc/ndomod.cfg
-+
-+# Uncomment the line below if you're running Nagios 3.x
-+#broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
-diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/nagios3.cfg ndoutils-1.4b7/config/nagios3.cfg
---- ndoutils-1.4b7.orig/config/nagios3.cfg	1970-01-01 01:00:00.000000000 +0100
-+++ ndoutils-1.4b7/config/nagios3.cfg	2009-03-25 19:28:33.346051027 +0100
-@@ -0,0 +1,11 @@
-+# SAMPLE NAGIOS CONFIG SNIPPET FOR NDOMOD
-+#
-+# In order to have Nagios run the NDOMOD event broker module, you'll need
-+# to place a statement like the one found below in your main Nagios
-+# configuration file (nagios.cfg).  Adjust the paths, etc. to suit your needs.
-+
-+# Uncomment the line below if you're running Nagios 2.x
-+#broker_module=/usr/local/nagios/bin/ndomod-2x.o config_file=/usr/local/nagios/etc/ndomod.cfg
-+
-+# Uncomment the line below if you're running Nagios 3.x
-+broker_module=/opt/csw/nagios/ndoutils/bin/ndomod-3x.o config_file=/opt/csw/nagios/ndoutils/etc/ndomod.cfg
-diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/ndomod.cfg ndoutils-1.4b7/config/ndomod.cfg
---- ndoutils-1.4b7.orig/config/ndomod.cfg	2007-09-27 18:47:44.000000000 +0200
-+++ ndoutils-1.4b7/config/ndomod.cfg	2009-03-25 19:33:19.422465176 +0100
-@@ -37,7 +37,7 @@
+diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/nagios.cfg ndoutils-1.4b7/config/nagios.cfg
+--- ndoutils-1.4b7.orig/config/nagios.cfg	2007-01-08 01:35:58.000000000 +0100
++++ ndoutils-1.4b7/config/nagios.cfg	2009-06-29 12:36:01.020559826 +0200
+@@ -5,7 +5,7 @@
+ # configuration file (nagios.cfg).  Adjust the paths, etc. to suit your needs.
  
- #output=/usr/local/nagios/var/ndo.dat
- #output=127.0.0.1
--output=/usr/local/nagios/var/ndo.sock
-+output=/opt/csw/nagios/ndoutils/var/ndo.sock
+ # Uncomment the line below if you're running Nagios 2.x
+-broker_module=/usr/local/nagios/bin/ndomod-2x.o config_file=/usr/local/nagios/etc/ndomod.cfg
++#broker_module=/opt/csw/nagios/ndoutils/bin/ndomod-2x.o config_file=/opt/csw/nagios/ndoutils/etc/ndomod.cfg
  
- 
- 
-@@ -68,7 +68,7 @@
- # Nagios (re)starts, the NDO NEB module will read the contents of this
- # file and send it to the NDO2DB daemon for processing.
- 
--buffer_file=/usr/local/nagios/var/ndomod.tmp
-+buffer_file=/opt/csw/nagios/ndoutils/var/ndomod.tmp
- 
- 
-
+ # Uncomment the line below if you're running Nagios 3.x
+-#broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
++#broker_module=/opt/csw/nagios/ndoutils/bin/ndomod-3x.o config_file=/opt/csw/nagios/ndoutils/etc/ndomod.cfg
 diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/ndo2db.cfg ndoutils-1.4b7/config/ndo2db.cfg
 --- ndoutils-1.4b7.orig/config/ndo2db.cfg	2007-10-31 19:17:04.000000000 +0100
-+++ ndoutils-1.4b7/config/ndo2db.cfg	2009-03-25 22:57:22.528212535 +0100
++++ ndoutils-1.4b7/config/ndo2db.cfg	2009-06-29 12:35:20.910744030 +0200
 @@ -32,7 +32,7 @@
  # This option is only valid if the socket type specified above
  # is "unix".
  
 -socket_name=/usr/local/nagios/var/ndo.sock
-+socket_name=/opt/csw/nagios/ndoutils/var/ndo.sock
++socket_name=/var/opt/csw/ndoutils/ndo.sock
  
  
  
@@ -87,7 +49,31 @@
  # This option determines where the daemon should write debugging information.
  
 -debug_file=@localstatedir@/ndo2db.debug
-+debug_file=/opt/csw/nagios/ndoutils/var/ndo2db.debug
++debug_file=/var/opt/csw/ndoutils/ndo2db.debug
  
  
  
+diff --speed-large-files --minimal -Nru ndoutils-1.4b7.orig/config/ndomod.cfg ndoutils-1.4b7/config/ndomod.cfg
+--- ndoutils-1.4b7.orig/config/ndomod.cfg	2007-09-27 18:47:44.000000000 +0200
++++ ndoutils-1.4b7/config/ndomod.cfg	2009-06-29 12:35:20.912629356 +0200
+@@ -35,9 +35,9 @@
+ # of fully qualified domain name of the host that the module should
+ # connect to for sending output.
+ 
+-#output=/usr/local/nagios/var/ndo.dat
++#output=/var/opt/csw/ndoutils/ndo.dat
+ #output=127.0.0.1
+-output=/usr/local/nagios/var/ndo.sock
++output=/var/opt/csw/ndoutils/ndo.sock
+ 
+ 
+ 
+@@ -68,7 +68,7 @@
+ # Nagios (re)starts, the NDO NEB module will read the contents of this
+ # file and send it to the NDO2DB daemon for processing.
+ 
+-buffer_file=/usr/local/nagios/var/ndomod.tmp
++buffer_file=/var/opt/csw/ndoutils/ndomod.tmp
+ 
+ 
+ 

Modified: csw/mgar/pkg/ndoutils/trunk/files/cswndoutils
===================================================================
--- csw/mgar/pkg/ndoutils/trunk/files/cswndoutils	2009-06-29 08:51:03 UTC (rev 5398)
+++ csw/mgar/pkg/ndoutils/trunk/files/cswndoutils	2009-06-29 10:46:47 UTC (rev 5399)
@@ -33,22 +33,28 @@
 fi
 
 NDO_USER=nagios
+SOCK_FILE=/var/opt/csw/ndoutils/ndo.sock
 
 case "$1" in
 'start')
-	su - $NDO_USER -c "$BIN_DIR/$BIN_FILE -c $CONFIG_FILE"
+	$BIN_DIR/$BIN_FILE -c $CONFIG_FILE
+	
+	if [ -f $SOCK_FILE ]
+	then
+		rm $SOCK_FILE
+	fi
 	;;
 'stop') 
-	su - $NDO_USER -c "pkill $BIN_FILE"
+	pkill $BIN_FILE
 	sleep 1
-	su - $NDO_USER -c "pkill -9 $BIN_FILE"
+	pkill -9 $BIN_FILE
 	;;
 'restart')
-	su - $NDO_USER -c "pkill $BIN_FILE"
+	pkill $BIN_FILE
 	sleep 1
-	su - $NDO_USER -c "pkill -9 $BIN_FILE"
+	pkill -9 $BIN_FILE
 	sleep 1
-	su - $NDO_USER -c "$BIN_DIR/$BIN_FILE -c $CONFIG_FILE"
+	$BIN_DIR/$BIN_FILE -c $CONFIG_FILE
 	;;
 *)
         echo "Usage: $0 { start | stop | restart }"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list