[csw-devel] SF.net SVN: gar:[3719] csw/mgar/pkg/nagios/trunk

j_arndt at users.sourceforge.net j_arndt at users.sourceforge.net
Wed Mar 11 18:58:59 CET 2009


Revision: 3719
          http://gar.svn.sourceforge.net/gar/?rev=3719&view=rev
Author:   j_arndt
Date:     2009-03-11 17:58:59 +0000 (Wed, 11 Mar 2009)

Log Message:
-----------
nagios: removed prototype filter because of static prototype file, changed FMRI from network to application, file cleanup

Modified Paths:
--------------
    csw/mgar/pkg/nagios/trunk/Makefile
    csw/mgar/pkg/nagios/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/nagios/trunk/files/cswnagios

Removed Paths:
-------------
    csw/mgar/pkg/nagios/trunk/files/CSWnagios.depend
    csw/mgar/pkg/nagios/trunk/files/CSWnagios.postinstall
    csw/mgar/pkg/nagios/trunk/files/doc.diff
    csw/mgar/pkg/nagios/trunk/files/webconf.diff

Modified: csw/mgar/pkg/nagios/trunk/Makefile
===================================================================
--- csw/mgar/pkg/nagios/trunk/Makefile	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/Makefile	2009-03-11 17:58:59 UTC (rev 3719)
@@ -26,8 +26,6 @@
 
 SPKG_CLASSES = none cswinitsmf
 
-PROTOTYPE_FILTER  = awk '$$$$3 ~ /\/init.d\/cswnagios$$$$/ { $$$$2 = "cswinitsmf" } { print }'
-
 CONFIGURE_ARGS = $(DIRPATHS)
 CONFIGURE_ARGS += --prefix=/opt/csw/nagios
 CONFIGURE_ARGS += --exec-prefix=/opt/csw/nagios

Modified: csw/mgar/pkg/nagios/trunk/checksums
===================================================================
--- csw/mgar/pkg/nagios/trunk/checksums	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/checksums	2009-03-11 17:58:59 UTC (rev 3719)
@@ -4,7 +4,7 @@
 47cc36016f5518dfd5614b870f56e944  download/CSWnagios.preinstall
 92437323de0cceaa58c6238ec9e6c954  download/CSWnagios.preremove
 92467193beb7d39c7a56a520731cfb5c  download/CSWnagios.prototype
-eee3268b11eb94d797f0f606d53cfb97  download/cswnagios
+d3b39178a60cf866a243d4d8f8eabb9b  download/cswnagios
 0ef601e30d01a511822dd27df6b0e531  download/patch.diff
 4faa5ec86586be23dfbbd9165f50046d  download/configure.diff
 f3161bcb7c65f89707ee37b0a8d861d5  download/install-opts.diff

Deleted: csw/mgar/pkg/nagios/trunk/files/CSWnagios.depend
===================================================================
--- csw/mgar/pkg/nagios/trunk/files/CSWnagios.depend	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/files/CSWnagios.depend	2009-03-11 17:58:59 UTC (rev 3719)
@@ -1,14 +0,0 @@
-P	CSWapache      apache - apache webserver with mod_ssl included
-P	CSWgd          gd - libgd, Graphics creation library and utilities
-P	CSWggettext    ggettext - GNU gettext
-P	CSWglib2       glib2 - The low-level core lib for GNOME and GTK+
-P	CSWiconv       libiconv - GNU iconv library
-P	CSWjpeg        jpeg - JPEG library and tools by the Independent JPEG Group
-P	CSWlibtool     libtool - Generic library support script
-P	CSWlibtoolrt   libtool_rt - Generic library support runtime libraries
-P	CSWosslrt      openssl_rt - Openssl runtime libraries
-P	CSWperl        perl - A high-level, general-purpose programming language.
-P	CSWpng         png - library for Portable Network Graphics format (PNG)
-P	CSWzlib        zlib - Zlib Data Compression Library
-P	CSWnagiosp     nagiosp - Plugins for Nagios
-P	CSWnrpeplugin  nrpeplugin - plugin for checking nrpe daemons

Deleted: csw/mgar/pkg/nagios/trunk/files/CSWnagios.postinstall
===================================================================
--- csw/mgar/pkg/nagios/trunk/files/CSWnagios.postinstall	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/files/CSWnagios.postinstall	2009-03-11 17:58:59 UTC (rev 3719)
@@ -1,99 +0,0 @@
-# postinstall for nagios package
-# 2007-01-19 Add csw.conf support
-# 2007-09-11 Fix PKG_INSTALL_ROOT usage.  BASEDIR is not used for non
-#            relocatable packages.
-#
-
-# daemons are started by default
-enable_daemon=yes
-
-# Source csw.conf, if it exists
-if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
-  . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
-fi
-if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
-  . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
-fi
-
-# If defined, autoenable for the specific daemon name takes precedence
-if [ "$autoenable_nagios" = "no" ] ; then
-  enable_daemon=no
-elif [ "$autoenable_daemons" = "no" -a ! -n "$autoenable_nagios" ] ; then
-  enable_daemon=no
-fi
-
-# Set variable for the availability of SMF
-smf=no
-if [ -f /usr/sbin/svccfg -a -f $BASEDIR/usr/sbin/svcadm ]
-  then
-  smf=yes
-fi
-
-# Stop nagios if it is running
-if pgrep nagios >/dev/null 2>&1 ; then
-    echo "## Stopping nagios"
-        if [ $smf = yes ]; then
-            /usr/sbin/svcadm disable svc:/application/cswnagios >/dev/null 2>&1
-        else
-            /etc/init.d/cswnagios stop >/dev/null 2>&1
-        fi
-        while pgrep nagios > /dev/null
-          do
-          sleep 1
-        done
-fi
-
-if [ $smf = yes ]; then
-    # Register with SMF
-    echo "Configuring service in SMF"
-    /usr/sbin/svccfg import /opt/csw/var/svc/manifest/application/nagios.xml >/dev/null 2>&1
-    /usr/sbin/svcadm disable svc:application/cswnagios >/dev/null 2>&1
-    echo "nagios is using Service Management Facility.  The FMRI is:"
-    echo "  svc:/application/cswnagios:default"
-fi
-
-# Start nagios
-if [ "$enable_daemon" = "yes" ] ; then
-  if [ -f $BASEDIR/opt/csw/nagios/etc/nagios.cfg ]; then
-    echo "## Starting nagios"
-    if [ $smf = yes ]; then
-        /usr/sbin/svcadm enable svc:/application/cswnagios >/dev/null 2>&1
-    else
-        /etc/init.d/cswnagios start >/dev/null 2>&1
-    fi
-  else
-    echo "## Not starting nagios - configuration file not found"
-    if [ $smf = yes ] ; then
-        /usr/sbin/svcadm disable svc:/application/cswnagios >/dev/null 2>&1
-    fi
-  fi
-fi
-
-#
-PREFIX=/opt/csw/nagios
-NAGHTTPD=httpd-nagios.conf
-
-if [ -d /opt/csw/apache/conf ]; then
-    APACHE_CONF=/opt/csw/apache/conf
-    cp $PREFIX/etc/$NAGHTTPD $APACHE_CONF
-elif [ -d /etc/apache ]; then
-    APACHE_CONF=/etc/apache
-    cp $PREFIX/etc/$NAGHTTPD $APACHE_CONF
-else
-    APACHE_CONF=$PREFIX/etc
-fi
-
-cat <<EOF
-___________________________________________________________________________
-The Nagios system has been installed but you must update the files in
-$PREFIX/etc/ to reflect your monitoring setup.
-
-Additionally you must make Nagios accessible from your Apache webserver.
-
-The file $APACHE_CONF/$NAGHTTPD lists the exact configuration
-directives required.
-
-Add those lines into your httpd.conf and restart your Apache server.
-___________________________________________________________________________
-EOF
-

Added: csw/mgar/pkg/nagios/trunk/files/cswnagios
===================================================================
--- csw/mgar/pkg/nagios/trunk/files/cswnagios	                        (rev 0)
+++ csw/mgar/pkg/nagios/trunk/files/cswnagios	2009-03-11 17:58:59 UTC (rev 3719)
@@ -0,0 +1,173 @@
+#!/bin/sh
+# 
+# chkconfig: 345 99 01
+# description: Nagios network monitor
+#
+# File : nagios
+#
+# Author : Jorge Sanchez Aymar (jsanchez at lanchile.cl)
+# 
+# Changelog :
+#
+# 1999-07-09 Karl DeBisschop <kdebisschop at infoplease.com>
+#  - setup for autoconf
+#  - add reload function
+# 1999-08-06 Ethan Galstad <nagios at nagios.org>
+#  - Added configuration info for use with RedHat's chkconfig tool
+#    per Fran Boon's suggestion
+# 1999-08-13 Jim Popovitch <jimpop at rocketship.com>
+#  - added variable for nagios/var directory
+#  - cd into nagios/var directory before creating tmp files on startup
+# 1999-08-16 Ethan Galstad <nagios at nagios.org>
+#  - Added test for rc.d directory as suggested by Karl DeBisschop
+# 2000-07-23 Karl DeBisschop <kdebisschop at users.sourceforge.net>
+#  - Clean out redhat macros and other dependencies
+#
+# Description: Starts and stops the Nagios monitor
+#              used to provide network services status.
+#
+# Modified for CSW by Alex Moore 2006-02-27
+# Modified for OpenCSW by Juergen Arndt 2009-03-11
+
+#FMRI application       # FMRI path for service, see http://wiki.opencsw.org/cswclassutils-package#toc0
+
+status_nagios ()
+{
+
+	if test ! -f $NagiosRun; then
+		echo "No lock file found in $NagiosRun"
+		return 1
+	fi
+
+	NagiosPID=`head -n 1 $NagiosRun`
+	if test -x $NagiosCGI/daemonchk.cgi; then
+		if $NagiosCGI/daemonchk.cgi -l $NagiosRun; then
+		        return 0
+		else
+			return 1
+		fi
+	else
+		if ps -p $NagiosPID; then
+		        return 0
+		else
+			return 1
+		fi
+	fi
+
+	return 1
+}
+
+
+killproc_nagios ()
+{
+
+        if [ ! -f $NagiosRun ]; then
+		echo "No lock file found in $NagiosRun"
+		return 1
+	fi
+
+	NagiosPID=`head -n 1 $NagiosRun`
+	kill $2 $NagiosPID
+}
+
+
+# Source function library
+# Solaris doesn't have an rc.d directory, so do a test first
+if [ -f /etc/rc.d/init.d/functions ]; then
+	. /etc/rc.d/init.d/functions
+elif [ -f /etc/init.d/functions ]; then
+	. /etc/init.d/functions
+fi
+
+prefix=/opt/csw/nagios
+exec_prefix=${prefix}
+NagiosBin=${exec_prefix}/bin/nagios
+NagiosCfg=${prefix}/etc/nagios.cfg
+NagiosLog=${prefix}/var/status.log
+NagiosTmp=${prefix}/var/nagios.tmp
+NagiosSav=${prefix}/var/status.sav
+NagiosCmd=${prefix}/var/rw/nagios.cmd
+NagiosVar=${prefix}/var
+NagiosRun=${prefix}/var/nagios.lock
+NagiosLckDir=/var/lock/subsys
+NagiosLckFile=nagios
+NagiosCGI=${exec_prefix}/sbin
+Nagios=nagios
+          
+
+# Check that nagios exists.
+test -f $NagiosBin || exit 0
+
+# Check that nagios.cfg exists.
+test -f $NagiosCfg || exit 0
+          
+# See how we were called.
+case "$1" in
+
+	start)
+		echo "Starting network monitor: nagios"
+		su - $Nagios -c "touch $NagiosVar/nagios.log $NagiosSav"
+		rm -f $NagiosCmd
+		$NagiosBin -d $NagiosCfg
+		if [ -d $NagiosLckDir ]; then touch $NagiosLckDir/$NagiosLckFile; fi
+		sleep 1
+		status_nagios nagios
+		;;
+
+	stop)
+		echo "Stopping network monitor: nagios"
+		killproc_nagios nagios
+		rm -f $NagiosLog $NagiosTmp $NagiosRun $NagiosLckDir/$NagiosLckFile $NagiosCmd
+		;;
+
+	status)
+		status_nagios nagios
+		;;
+
+	restart)
+		printf "Running configuration check..."
+		$NagiosBin -v $NagiosCfg > /dev/null 2>&1;
+		if [ $? -eq 0 ]; then
+			echo "done"
+			$0 stop
+			$0 start
+		else
+			$NagiosBin -v $NagiosCfg
+			echo "failed - aborting restart."
+			exit 1
+		fi
+		;;
+
+	reload|force-reload)
+		printf "Running configuration check..."
+		$NagiosBin -v $NagiosCfg > /dev/null 2>&1;
+		if [ $? -eq 0 ]; then
+			echo "done"
+			if test ! -f $NagiosRun; then
+				$0 start
+			else
+				NagiosPID=`head -n 1 $NagiosRun`
+				if status_nagios > /dev/null; then
+					printf "Reloading nagios configuration..."
+					killproc_nagios nagios -HUP
+					echo "done"
+				else
+					$0 stop
+					$0 start
+				fi
+			fi
+		else
+			$NagiosBin -v $NagiosCfg
+			echo "failed - aborting reload."
+			exit 1
+		fi
+		;;
+
+	*)
+		echo "Usage: nagios {start|stop|restart|reload|force-reload|status}"
+		exit 1
+		;;
+
+esac
+  
+# End of this script

Deleted: csw/mgar/pkg/nagios/trunk/files/doc.diff
===================================================================
--- csw/mgar/pkg/nagios/trunk/files/doc.diff	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/files/doc.diff	2009-03-11 17:58:59 UTC (rev 3719)
@@ -1,24 +0,0 @@
-diff --speed-large-files --minimal -Nru nagios-3.0.6.orig/Makefile.in nagios-3.0.6/Makefile.in
---- nagios-3.0.6.orig/Makefile.in	2008-12-25 14:35:24.040581755 +0100
-+++ nagios-3.0.6/Makefile.in	2008-12-25 14:31:46.669473752 +0100
-@@ -28,6 +28,7 @@
- CGIDIR=@sbindir@
- LIBEXECDIR=@libexecdir@
- HTMLDIR=@datadir@
-+DOCDIR=$(prefix)/../share/doc/nagios
- INSTALL=@INSTALL@
- INSTALL_OPTS=
- COMMAND_OPTS=
-@@ -268,6 +269,12 @@
- 	@echo "*** External command directory configured ***"
- 	@echo ""
- 
-+install-docs:
-+	$(INSTALL) -m 755 -d $(INSTALL_OPTS) -d $(DESTDIR)$(DOCDIR)
-+	$(INSTALL) -m 664 $(INSTALL_OPTS) ./Changelog $(DESTDIR)$(DOCDIR)
-+	$(INSTALL) -m 664 $(INSTALL_OPTS) ./INSTALLING $(DESTDIR)$(DOCDIR)
-+	$(INSTALL) -m 664 $(INSTALL_OPTS) ./README $(DESTDIR)$(DOCDIR)
-+	$(INSTALL) -m 664 $(INSTALL_OPTS) ./UPGRADING $(DESTDIR)$(DOCDIR)
- 
- fullinstall: install install-init install-commandmode install-webconf
- 

Deleted: csw/mgar/pkg/nagios/trunk/files/webconf.diff
===================================================================
--- csw/mgar/pkg/nagios/trunk/files/webconf.diff	2009-03-11 17:43:06 UTC (rev 3718)
+++ csw/mgar/pkg/nagios/trunk/files/webconf.diff	2009-03-11 17:58:59 UTC (rev 3719)
@@ -1,12 +0,0 @@
-diff --speed-large-files --minimal -Nru nagios-3.0.6.orig/Makefile.in nagios-3.0.6/Makefile.in
---- nagios-3.0.6.orig/Makefile.in	2008-12-19 08:48:37.252900900 +0100
-+++ nagios-3.0.6/Makefile.in	2008-12-19 08:48:20.644359694 +0100
-@@ -243,7 +243,7 @@
- 	@echo ""
- 
- install-webconf:
--	$(INSTALL) -m 644 sample-config/httpd.conf $(DESTDIR)$(HTTPD_CONF)/nagios.conf
-+	$(INSTALL) -m 644 sample-config/httpd.conf $(DESTDIR)$(HTTPD_CONF)/httpd-nagios.conf
- 
- 	@echo ""
- 	@echo "*** Nagios/Apache conf file installed ***"


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