[csw-devel] SF.net SVN: gar:[5458] csw/mgar/pkg/nrpe/trunk
j_arndt at users.sourceforge.net
j_arndt at users.sourceforge.net
Tue Jun 30 21:29:56 CEST 2009
Revision: 5458
http://gar.svn.sourceforge.net/gar/?rev=5458&view=rev
Author: j_arndt
Date: 2009-06-30 19:29:56 +0000 (Tue, 30 Jun 2009)
Log Message:
-----------
nrpe: fixed start / stop scripts again, packages contains now additional nrpe binaries for submitting up to 8 kB of data
Modified Paths:
--------------
csw/mgar/pkg/nrpe/trunk/Makefile
csw/mgar/pkg/nrpe/trunk/checksums
csw/mgar/pkg/nrpe/trunk/files/CSWnrpe.prototype
csw/mgar/pkg/nrpe/trunk/files/CSWnrpeplugin.prototype
csw/mgar/pkg/nrpe/trunk/files/cswnrpe
Added Paths:
-----------
csw/mgar/pkg/nrpe/trunk/files/README_8k
Modified: csw/mgar/pkg/nrpe/trunk/Makefile
===================================================================
--- csw/mgar/pkg/nrpe/trunk/Makefile 2009-06-30 18:57:56 UTC (rev 5457)
+++ csw/mgar/pkg/nrpe/trunk/Makefile 2009-06-30 19:29:56 UTC (rev 5458)
@@ -14,13 +14,22 @@
DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz
DISTFILES += $(call admfiles,CSWnrpe, prototype checkinstall preinstall preremove )
DISTFILES += cswnrpe
+DISTFILES += README_8k
DISTFILES += $(call admfiles,CSWnrpeplugin, prototype )
+PATCHFILES = patch.diff configure.diff
+
+PATCHFILES_isa-sparcv8-size-8k = common.h.diff
+PATCHFILES_isa-i386-size-8k = common.h.diff
+
REQUIRED_PKGS_CSWnrpe = CSWosslrt CSWtcpwrap CSWcswclassutils
REQUIRED_PKGS_CSWnrpeplugin = CSWosslrt
SPKG_CLASSES_CSWnrpe = none cswpreserveconf cswinitsmf
+EXTRA_MODULATORS = SIZE
+MODULATIONS_SIZE = 1k 8k
+
NOISALIST = 1
CONFIGURE_ARGS = $(DIRPATHS)
@@ -32,9 +41,9 @@
CONFIGURE_ARGS += --prefix=/opt/csw
CONFIGURE_ARGS += --exec-prefix=/opt/csw
-PATCHFILES = patch.diff # Removal of LOG_AUTHPRIV and LOG_FTP
+#PATCHFILES = patch.diff # Removal of LOG_AUTHPRIV and LOG_FTP
# Solaris doesn't have these log facilities
-PATCHFILES += configure.diff
+#PATCHFILES += configure.diff
#PATCHFILES += common.h.diff # Enable packet size of 8192 bytes
sysconfdir = $(prefix)/etc
@@ -45,6 +54,12 @@
TEST_TARGET = all
INSTALL_SCRIPTS = custom
+MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
+MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only
+
+MERGE_SCRIPTS_isa-i386-size-1k = copy-all
+MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only
+
include gar/category.mk
DOCDIR=$(datadir)/doc/nrpe
@@ -57,8 +72,9 @@
ginstall -m 755 -d $(DESTDIR)$(LIBEXECDIR)
ginstall -m 755 -d $(DESTDIR)$(BINDIR)
ginstall -m 755 $(WORKSRC)/src/check_nrpe $(DESTDIR)$(LIBEXECDIR)
- ginstall -m 755 $(WORKSRC)/src/nrpe $(DESTDIR)$(BINDIR)
+ ginstall -m 755 $(WORKSRC)/src/nrpe $(DESTDIR)$(BINDIR)/nrpe_1k
ginstall -m 644 $(WORKSRC)/docs/NRPE.pdf $(DESTDIR)$(DOCDIR)
+ ginstall -m 644 $(FILEDIR)/README_8k $(DESTDIR)$(DOCDIR)
ginstall -m 644 $(WORKSRC)/LEGAL $(DESTDIR)$(DOCDIR)
ginstall -m 644 $(WORKSRC)/README $(DESTDIR)$(DOCDIR)
ginstall -m 644 $(WORKSRC)/README.SSL $(DESTDIR)$(DOCDIR)
@@ -68,3 +84,9 @@
ginstall -d $(DESTDIR)/etc/opt/csw/init.d
ginstall -m 755 $(FILEDIR)/cswnrpe $(DESTDIR)/etc/opt/csw/init.d/cswnrpe
@$(MAKECOOKIE)
+
+merge-copy-nrpe-only:
+ cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
+ cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
+ @$(MAKECOOKIE)
+
Modified: csw/mgar/pkg/nrpe/trunk/checksums
===================================================================
--- csw/mgar/pkg/nrpe/trunk/checksums 2009-06-30 18:57:56 UTC (rev 5457)
+++ csw/mgar/pkg/nrpe/trunk/checksums 2009-06-30 19:29:56 UTC (rev 5458)
@@ -2,10 +2,12 @@
1c656040abd280f9228b42df744d93eb download/CSWnrpe.gspec
53eea7ed36535bb6cbe1d6fe0aae3508 download/CSWnrpe.preinstall
393872a95d2b9ec90363664c31074415 download/CSWnrpe.preremove
-ab50f565dba01e9c891f7fd0fc585fda download/CSWnrpe.prototype
+ff0be2f6b8d7fa72875d570fff53c3e6 download/CSWnrpe.prototype
2b35d5e0d57bcb3aff096040e0d06b8b download/CSWnrpeplugin.gspec
-e22a7817c7665e79bcbad7e091375be9 download/CSWnrpeplugin.prototype
+6eafe4b86758d91ac3fc4c0e759f25a0 download/CSWnrpeplugin.prototype
+3bb2fbb228a6e2d0a99d981d82610d9a download/README_8k
+36b85dd37d47a3813bfef5dee5804b61 download/common.h.diff
4b51476c782d2c5764d10f8ed530ada0 download/configure.diff
-3276723a3d0c30b489f1a8c93bcbb048 download/cswnrpe
+0e9afe89caf7b60817165842c6e36780 download/cswnrpe
b2d75e2962f1e3151ef58794d60c9e97 download/nrpe-2.12.tar.gz
5b02d4385daaea2a8c13903539aa6189 download/patch.diff
Modified: csw/mgar/pkg/nrpe/trunk/files/CSWnrpe.prototype
===================================================================
--- csw/mgar/pkg/nrpe/trunk/files/CSWnrpe.prototype 2009-06-30 18:57:56 UTC (rev 5457)
+++ csw/mgar/pkg/nrpe/trunk/files/CSWnrpe.prototype 2009-06-30 19:29:56 UTC (rev 5458)
@@ -1,11 +1,14 @@
d none /opt/csw/bin 0755 root bin
-f none /opt/csw/bin/nrpe 0775 root bin
+f none /opt/csw/bin/nrpe_1k 0775 root bin
+f none /opt/csw/bin/nrpe_8k 0775 root bin
+s none /opt/csw/bin/nrpe=/opt/csw/bin/nrpe_1k
d none /opt/csw/etc 0755 root bin
f cswpreserveconf /opt/csw/etc/nrpe.cfg.CSW 0644 root bin
d none /opt/csw/share/doc/nrpe 0755 root bin
f none /opt/csw/share/doc/nrpe/NRPE.pdf 0644 root bin
f none /opt/csw/share/doc/nrpe/LEGAL 0644 root bin
f none /opt/csw/share/doc/nrpe/README 0644 root bin
+f none /opt/csw/share/doc/nrpe/README_8k 0644 root bin
f none /opt/csw/share/doc/nrpe/README.SSL 0644 root bin
f none /opt/csw/share/doc/nrpe/SECURITY 0644 root bin
f cswinitsmf /etc/opt/csw/init.d/cswnrpe 0755 root bin
Modified: csw/mgar/pkg/nrpe/trunk/files/CSWnrpeplugin.prototype
===================================================================
--- csw/mgar/pkg/nrpe/trunk/files/CSWnrpeplugin.prototype 2009-06-30 18:57:56 UTC (rev 5457)
+++ csw/mgar/pkg/nrpe/trunk/files/CSWnrpeplugin.prototype 2009-06-30 19:29:56 UTC (rev 5458)
@@ -1,4 +1,7 @@
d none /opt/csw/libexec/nagios-plugins 0755 root bin
f none /opt/csw/libexec/nagios-plugins/check_nrpe 0775 root bin
+f none /opt/csw/libexec/nagios-plugins/check_nrpe_8k 0775 root bin
+d none /opt/csw/share/doc/nrpe 0755 root bin
+f none /opt/csw/share/doc/nrpe/README_8k 0644 root bin
i depend=CSWnrpeplugin.depend
i pkginfo=CSWnrpeplugin.pkginfo
Added: csw/mgar/pkg/nrpe/trunk/files/README_8k
===================================================================
--- csw/mgar/pkg/nrpe/trunk/files/README_8k (rev 0)
+++ csw/mgar/pkg/nrpe/trunk/files/README_8k 2009-06-30 19:29:56 UTC (rev 5458)
@@ -0,0 +1,58 @@
+(1) General
+
+In this package two types of nrpe binaries are included:
+- binaries which support sending / receiving 1 kB of data
+- binaries which support sending / receiving 8 kB of data
+
+The version for 1 kB of data (default in most distributions) contains:
+- binary for the agent: nrpe_1k
+- binary for the Nagios plugin: check_nrpe
+
+The version for 8 kB of data contains:
+- binary for the agent: nrpe_8k
+- binary for Nagios plugin: check_nrpe_8k
+
+
+(2) On the Nagios side:
+
+Example service configuration:
+
+define service{
+ .
+ .
+ .
+ ; for up to 8 kB of data
+ check_command check_nrpe_8k!<arguments>
+}
+
+define service{
+ .
+ .
+ .
+ ; for up to 1 kB of data
+ check_command check_nrpe!<arguments>
+}
+
+Example Nagios command config:
+
+# 'check_nrpe' command definition
+define command{
+ command_name check_nrpe
+ command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
+ }
+
+# 'check_nrpe_8k' command definition
+define command{
+ command_name check_nrpe_8k
+ command_line $USER1$/check_nrpe_8k -H $HOSTADDRESS$ -c $ARG1$
+ }
+
+
+(3) On the agent side:
+
+/opt/csw/bin/nrpe is by default a link to /opt/csw/bin/nrpe_1k. If you want to
+submit more then 1 kB of data just set the link to /opt/csw/bin/nrpe_8k and
+restart the NRPE service.
+
+Don't forget to set the check command in your service configuration on the
+Nagios side accordingly (see (2)).
Modified: csw/mgar/pkg/nrpe/trunk/files/cswnrpe
===================================================================
--- csw/mgar/pkg/nrpe/trunk/files/cswnrpe 2009-06-30 18:57:56 UTC (rev 5457)
+++ csw/mgar/pkg/nrpe/trunk/files/cswnrpe 2009-06-30 19:29:56 UTC (rev 5458)
@@ -32,53 +32,45 @@
pidfile=`awk -F'=' '/^[ \t]*pid_file/ {print $2}' $CONFIG_FILE`
NRPE_USER=`awk -F'=' '/^[ \t]*nrpe_user/ { print $2 }' $CONFIG_FILE`
-case "$1" in
-'restart')
- #
- # stop
- #
+start_nrpe ()
+{
+ if [ -f $CONFIG_FILE ]; then
+ wait 1
+ $BIN_FILE -c $CONFIG_FILE -d
+ fi
+}
+stop_nrpe ()
+{
if [ -f "$pidfile" ]; then
- [ -n "`pgrep -x -u 0,1,$NRPE_USER nrpe`" ] && /usr/bin/kill `head -1 $pidfile`
+ if [ `uname -r` = 5.8 -o `uname -r` = 5.9 ]
+ then
+ [ -n "`pgrep -x -u 0,1,$NRPE_USER -f \"$BIN_FILE -c $CONFIGFILE -d\"`" ] && /usr/bin/kill `head -1 $pidfile`
+ else
+ [ -n "`pgrep -x -u 0,1,$NRPE_USER -z \`zonename\` -f \"$BIN_FILE -c $CONFIG_FILE -d\"`" ] && /usr/bin/kill `head -1 $pidfile`
+ fi
rm "$pidfile"
else
if [ `uname -r` = 5.8 -o `uname -r` = 5.9 ]
then
- /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER nrpe`
+ /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER -f "$BIN_FILE -c $CONFIGFILE -d"`
else
- /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER -z \`zonename\` nrpe`
+ /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER -z \`zonename\` -f "$BIN_FILE -c $CONFIG_FILE -d"`
fi
fi
-
- #
- # start
- #
+}
- if [ -f $CONFIG_FILE ]; then
- wait 1
- $BIN_FILE -c $CONFIG_FILE -d
- fi
+case "$1" in
+'restart')
+ stop_nrpe
+ start_nrpe
;;
'start')
- if [ -f $CONFIG_FILE ]; then
- $BIN_FILE -c $CONFIG_FILE -d
- fi
- ;;
-
+ start_nrpe
+ ;;
'stop')
- # remove pid file
- if [ -f "$pidfile" ]; then
- [ -n "`pgrep -x -u 0,1,$NRPE_USER nrpe`" ] && /usr/bin/kill `head -1 $pidfile`
- rm "$pidfile"
- else
- if [ `uname -r` = 5.8 -o `uname -r` = 5.9 ]
- then
- /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER nrpe`
- else
- /usr/bin/kill `pgrep -x -u 0,1,$NRPE_USER -z \`zonename\` nrpe`
- fi
- fi
+ stop_nrpe
;;
*)
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