Explorar o código

Miscellaneous cleanup

John C. Frickson %!s(int64=10) %!d(string=hai) anos
pai
achega
f1a9863341
Modificáronse 5 ficheiros con 40 adicións e 114 borrados
  1. 5 2
      Makefile.in
  2. 34 34
      README.md
  3. 1 9
      configure
  4. 0 8
      configure.ac
  5. 0 61
      subst.in

+ 5 - 2
Makefile.in

@@ -93,8 +93,11 @@ clean:
 distclean: clean
 distclean: clean
 	cd $(SRC_BASE); $(MAKE) $@; cd ..
 	cd $(SRC_BASE); $(MAKE) $@; cd ..
 	cd package/solaris; $(MAKE) $@; cd ../..
 	cd package/solaris; $(MAKE) $@; cd ../..
-	rm -f config.log config.status config.cache nrpe.cfg nrpe.xinetd subst $(SRC_INCLUDE)/config.h init-script init-script.debian init-script.freebsd init-script.suse
-	rm -f sample-config/*.cfg sample-config/*.xinetd
+	rm -rf autom4te.cache
+	rm -f config.log config.status config.cache sample-config/nrpe.cfg $(SRC_INCLUDE)/config.h 
+	rm -f startup/bsd-init startup/debian-init startup/default-init startup/default-inetd
+	rm -f startup/default-service startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist
+	rm -f startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml
 	rm -f Makefile
 	rm -f Makefile
 
 
 devclean: distclean
 devclean: distclean

+ 34 - 34
README.md

@@ -2,13 +2,13 @@ NRPE README
 ===========
 ===========
 
 
 For installation instructions and information on the design overview
 For installation instructions and information on the design overview
-of the NRPE addon, please read the PDF documentation that is found in 
+of the NRPE addon, please read the PDF documentation that is found in
 this directory: `docs/NRPE.pdf`
 this directory: `docs/NRPE.pdf`
 
 
 
 
 Purpose
 Purpose
 -------
 -------
-The purpose of this addon is to allow you to execute Nagios 
+The purpose of this addon is to allow you to execute Nagios
 plugins on a remote host in as transparent a manner as possible.
 plugins on a remote host in as transparent a manner as possible.
 
 
 
 
@@ -17,13 +17,13 @@ Contents
 
 
 There are two pieces to this addon:
 There are two pieces to this addon:
 
 
-  1) **NRPE**       - This program runs as a background process on the 
+  1) **NRPE**       - This program runs as a background process on the
                       remote host and processes command execution requests
                       remote host and processes command execution requests
                       from the check_nrpe plugin on the Nagios host.
                       from the check_nrpe plugin on the Nagios host.
                       Upon receiving a plugin request from an authorized
                       Upon receiving a plugin request from an authorized
                       host, it will execute the command line associated
                       host, it will execute the command line associated
                       with the command name it received and send the
                       with the command name it received and send the
-                      program output and return code back to the 
+                      program output and return code back to the
                       check_nrpe plugin
                       check_nrpe plugin
 
 
   2) **check_nrpe** - This is a plugin that is run on the Nagios host
   2) **check_nrpe** - This is a plugin that is run on the Nagios host
@@ -45,8 +45,8 @@ compiling on your system, please let us know, hopefully with
 fixes. Most users should be able to compile NRPE and the
 fixes. Most users should be able to compile NRPE and the
 check_nrpe plugin with the following commands...
 check_nrpe plugin with the following commands...
 
 
-	./configure
-	make all
+    ./configure
+    make all
 
 
 The binaries will be located in the `src/` directory after you
 The binaries will be located in the `src/` directory after you
 run `make all` and will have to be installed manually somewhere
 run `make all` and will have to be installed manually somewhere
@@ -87,7 +87,7 @@ of TCP wrappers, you need to do the following things:
 1) Add a line to your `/etc/services` file as follows (modify the port
 1) Add a line to your `/etc/services` file as follows (modify the port
    number as you see fit)
    number as you see fit)
 
 
-	nrpe            5666/tcp	# NRPE
+    nrpe            5666/tcp    # NRPE
 
 
 2) Add entries for the NRPE daemon to either your inetd or xinetd
 2) Add entries for the NRPE daemon to either your inetd or xinetd
    configuration files.  Which one your use will depend on which
    configuration files.  Which one your use will depend on which
@@ -103,12 +103,12 @@ of TCP wrappers, you need to do the following things:
    If your system uses the inetd superserver **with** tcpwrappers, add an
    If your system uses the inetd superserver **with** tcpwrappers, add an
    entry to `/etc/inetd.conf` as follows:
    entry to `/etc/inetd.conf` as follows:
 
 
-	nrpe 	stream 	tcp 	nowait 	<user> /usr/sbin/tcpd <nrpebin> -c <nrpecfg> --inetd
+    nrpe   stream   tcp   nowait   <user> /usr/sbin/tcpd <nrpebin> -c <nrpecfg> --inetd
 
 
    If your system uses the inetd superserver **without** tcpwrappers,
    If your system uses the inetd superserver **without** tcpwrappers,
    add an entry to `/etc/inetd.conf` as follows:
    add an entry to `/etc/inetd.conf` as follows:
 
 
-	nrpe 	stream 	tcp 	nowait 	<user> <nrpebin> -c <nrpecfg> --inetd
+    nrpe   stream   tcp   nowait   <user> <nrpebin> -c <nrpecfg> --inetd
 
 
 
 
    - Replace `<user>` with the name of the user that the nrpe server should run as.
    - Replace `<user>` with the name of the user that the nrpe server should run as.
@@ -124,20 +124,20 @@ of TCP wrappers, you need to do the following things:
    want to create a file called `nrpe` in your `/etc/xinetd.d`
    want to create a file called `nrpe` in your `/etc/xinetd.d`
    directory that contains the following entries:
    directory that contains the following entries:
 
 
-	# default: on
-	# description: NRPE
-	service nrpe
-	{
-        	flags           = REUSE
-	        socket_type     = stream        
-        	wait            = no
-	        user            = <user>
-        	server          = <nrpebin>
-	        server_args     = -c <nrpecfg> --inetd
-        	log_on_failure  += USERID
-	        disable         = no
-		only_from       = <ipaddress1> <ipaddress2> ...
-	}
+    # default: on
+    # description: NRPE
+    service nrpe
+    {
+        flags           = REUSE
+        socket_type     = stream
+        wait            = no
+        user            = <user>
+        server          = <nrpebin>
+        server_args     = -c <nrpecfg> --inetd
+        log_on_failure  += USERID
+        disable         = no
+        only_from       = <ipaddress1> <ipaddress2> ...
+    }
 
 
    - Replace `<user>` with the name of the user that the nrpe server should run as.
    - Replace `<user>` with the name of the user that the nrpe server should run as.
    - Replace `<nrpebin>` with the path to the nrpe binary on your system.
    - Replace `<nrpebin>` with the path to the nrpe binary on your system.
@@ -149,13 +149,13 @@ of TCP wrappers, you need to do the following things:
 3) Restart inetd or xinetd will the following command (pick the
 3) Restart inetd or xinetd will the following command (pick the
    on that is appropriate for your system:
    on that is appropriate for your system:
 
 
-	/etc/rc.d/init.d/inet restart
+    /etc/rc.d/init.d/inet restart
 
 
-	/etc/rc.d/init.d/xinetd restart
+    /etc/rc.d/init.d/xinetd restart
 
 
    OpenBSD users can use the following command to restart inetd:
    OpenBSD users can use the following command to restart inetd:
 
 
-	kill -HUP `cat /var/run/inet.pid`
+    kill -HUP `cat /var/run/inet.pid`
 
 
 4) Add entries to your `/etc/hosts.allow` and `/etc/hosts.deny`
 4) Add entries to your `/etc/hosts.allow` and `/etc/hosts.deny`
    file to enable TCP wrapper protection for the nrpe service.
    file to enable TCP wrapper protection for the nrpe service.
@@ -174,8 +174,8 @@ to define a few things in the host config file.  An example
 command definition for the check_nrpe plugin would look like this:
 command definition for the check_nrpe plugin would look like this:
 
 
     define command{
     define command{
-        command_name	check_nrpe
-        command_line	/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
+        command_name    check_nrpe
+        command_line    /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
         }
         }
 
 
 In any service definitions that use the nrpe plugin/daemon to
 In any service definitions that use the nrpe plugin/daemon to
@@ -184,14 +184,14 @@ of the definition to something like this (sample service definition
 is simplified for this example):
 is simplified for this example):
 
 
     define service{
     define service{
-        host_name		someremotehost
-        service_description	someremoteservice
-        check_command		check_nrpe!yourcommand
+        host_name           someremotehost
+        service_description someremoteservice
+        check_command       check_nrpe!yourcommand
         ... etc ...
         ... etc ...
         }
         }
 
 
-where `yourcommand` is a name of a command that you define in 
-your nrpe.cfg file on the remote host (see the docs in the 
+where `yourcommand` is a name of a command that you define in
+your nrpe.cfg file on the remote host (see the docs in the
 sample nrpe.cfg file for more information).
 sample nrpe.cfg file for more information).
 
 
 
 
@@ -200,7 +200,7 @@ Questions?
 
 
 If you have questions about this addon, or problems getting things
 If you have questions about this addon, or problems getting things
 working, first try searching the nagios-users mailing list archives.
 working, first try searching the nagios-users mailing list archives.
-Details on searching the list archives can be found at 
+Details on searching the list archives can be found at
 http://www.nagios.org
 http://www.nagios.org
 
 
 If you don't find an answer there, post a message in the Nagios
 If you don't find an answer there, post a message in the Nagios

+ 1 - 9
configure

@@ -4812,7 +4812,7 @@ fi
 
 
 ac_config_headers="$ac_config_headers include/config.h"
 ac_config_headers="$ac_config_headers include/config.h"
 
 
-ac_config_files="$ac_config_files Makefile subst src/Makefile package/solaris/Makefile nrpe.spec sample-config/nrpe.cfg startup/bsd-init startup/debian-init startup/default-init startup/default-inetd startup/default-service startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml"
+ac_config_files="$ac_config_files Makefile src/Makefile package/solaris/Makefile nrpe.spec sample-config/nrpe.cfg startup/bsd-init startup/debian-init startup/default-init startup/default-inetd startup/default-service startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml"
 
 
 
 
 #sample-config/debian-nrpe-inetd
 #sample-config/debian-nrpe-inetd
@@ -8048,7 +8048,6 @@ do
     "paths") CONFIG_FILES="$CONFIG_FILES paths" ;;
     "paths") CONFIG_FILES="$CONFIG_FILES paths" ;;
     "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
     "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "subst") CONFIG_FILES="$CONFIG_FILES subst" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "package/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES package/solaris/Makefile" ;;
     "package/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES package/solaris/Makefile" ;;
     "nrpe.spec") CONFIG_FILES="$CONFIG_FILES nrpe.spec" ;;
     "nrpe.spec") CONFIG_FILES="$CONFIG_FILES nrpe.spec" ;;
@@ -8650,13 +8649,6 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 fi
 
 
 
 
-#perl subst init-script
-#perl subst init-script.debian
-#perl subst init-script.suse
-#perl subst sample-config/nrpe.cfg
-#perl subst sample-config/nrpe.xinetd
-
-
 echo ""
 echo ""
 echo ""
 echo ""
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" >&5

+ 0 - 8
configure.ac

@@ -94,7 +94,6 @@ fi
 
 
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_FILES([Makefile
 AC_CONFIG_FILES([Makefile
-	subst
 	src/Makefile
 	src/Makefile
 	package/solaris/Makefile
 	package/solaris/Makefile
 	nrpe.spec
 	nrpe.spec
@@ -521,13 +520,6 @@ AC_ARG_ENABLE([bash-command-substitution],
 AC_PATH_PROG(PERL,perl)
 AC_PATH_PROG(PERL,perl)
 AC_OUTPUT()
 AC_OUTPUT()
 
 
-#perl subst init-script
-#perl subst init-script.debian
-#perl subst init-script.suse
-#perl subst sample-config/nrpe.cfg
-#perl subst sample-config/nrpe.xinetd
-
-
 dnl Review options
 dnl Review options
 echo ""
 echo ""
 echo ""
 echo ""

+ 0 - 61
subst.in

@@ -1,61 +0,0 @@
-#!/usr/bin/perl -w
-
-# This script finishes the job started by config.status by replacing the variables
-# of the form ${...} which were inserted into the file(s) by config.status.
-
-# Read all files with a single read statement
-$/ = undef;
-
-# List of variables to replace
-my %configvars = (
-	"prefix" => { "value" => '@prefix@'},
-	"exec_prefix" => { "value" => '@exec_prefix@'},
-);
-
-sub replace_var {
-	my $filep = shift;
-	my $cvp = shift;
-	my $varname = shift;
-
-	return if( $cvp->{ $varname}->{ "replaced"});
-	if( defined( $cvp->{ $varname}->{ "dependency"})) {
-		if( !$cvp->{ $cvp->{ $varname}->{ "dependency"}}->{ "replaced"}) {
-			# If a dependency exists and it is not already replaced, replace it
-			replace_var( $filep, $cvp, $cvp->{ $varname}->{ "dependency"});
-		}
-	}
-	my $replacement = $cvp->{ $varname}->{ "value"};
-	$$filep =~ s/\${$varname}/$replacement/g;
-	$cvp->{ $varname}->{ "replaced"} = 1;
-}
-
-# Figure out the dependencies.
-foreach my $cv ( keys %configvars ) {
-	if( $configvars{ $cv}->{ "value"} =~ /\${([^}]+)}/) {
-		my $dependency = $1;
-		if( exists( $configvars{ $dependency})) {
-			$configvars{ $dependency}->{ "dependency"} = $cv;
-		}
-		$configvars{ $cv}->{ "replaced"} = 0;
-	}
-}
-
-# Process each file
-while ($f = shift @ARGV) {
-
-	# Read in the file
-	open( FILE, $f) || die "Unable to open $f for reading";
-	my $file = <FILE>;
-	close( FILE) || die "Unable to close $f after reading";
-
-	# Replace each of the variables we know about
-	foreach $cv ( keys %configvars ) {
-		replace_var( \$file, \%configvars, $cv);
-	}
-
-	# Write out the replacements
-	open( FILE, ">$f") || die "Unable to open $f for writing";
-	print FILE $file;
-	close( FILE) || die "Unable to close $f after writing";
-
-}