Hello community,

here is the log from the commit of package nrpe for openSUSE:Factory checked in 
at 2013-01-20 08:08:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nrpe (Old)
 and      /work/SRC/openSUSE:Factory/.nrpe.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nrpe", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2013-01-09 19:40:42.352580873 +0100
+++ /work/SRC/openSUSE:Factory/.nrpe.new/nrpe.changes   2013-01-20 
08:08:58.000000000 +0100
@@ -0,0 +1,384 @@
+-------------------------------------------------------------------
+Tue Jan 15 10:28:26 UTC 2013 - [email protected]
+
+- also fix old xinetd config and SuSEFirewall2
+- save the status of the old nagios-nrpe daemon via %%triggerun in
+  /var/adm/update-scripts/nrpe and restart the service, if needed, 
+  after the renamed package has been installed (same, if the 
+  service is started via xinetd)
+
+-------------------------------------------------------------------
+Sat Dec 22 18:29:39 UTC 2012 - [email protected]
+
+- update to 2.14:
+  + Added configure option to allow bash command substitutions, 
+    disabled by default [bug #400] (Eric Stanley)
+  + Patched to shutdown SSL connection completely (Jari Takkala)
+- enable bash command substitution in binary (disabled by config)
+- renamed the main package to nrpe to follow upstream 
+  (Provide/Obsolete the old package name)
+- placed nrpe.cfg in /etc now to allow running with Icinga only
+- add include directory /etc/nrpe.d to make future updates easier
+- increase check_procs warning (250) and critical (300) levels
+- use new rpm macro nagios_user_group_add for user-/groupadd
+- refreshed patches
+
+-------------------------------------------------------------------
+Tue Nov 20 07:55:32 UTC 2012 - [email protected]
+
+- Fix useradd invocation: -o is useless without -u and newer
+  versions of pwdutils/shadowutils fail on this now.
+
+-------------------------------------------------------------------
+Thu Oct 11 12:35:28 UTC 2012 - [email protected]
+
+- the plugin can also be used with icinga 
+  -> recommend monitoring_daemon instead
+
+-------------------------------------------------------------------
+Sun Feb 26 03:20:19 UTC 2012 - [email protected]
+
+- update to 2.13:
+  + Applied Kaspersky Labs supplied patch for extending 
+    allowed_hosts (Konstantin Malov)
+  + Fixed bug in allowed_hosts parsing (Eric Stanley)
+- rebased patches
+- simplify (and disable) nrpe-more_random.patch 
+- added nrpe-implicit_declaration.patch
+- use macros from nagios-rpm-macros
+
+-------------------------------------------------------------------
+Mon May 30 14:43:59 UTC 2011 - [email protected]
+
+- specfile cleanup using spec-cleaner (add comments to patches)
+
+-------------------------------------------------------------------
+Thu Feb 10 01:03:41 CET 2011 - [email protected]
+
+- add directory to filelist to fix build 
+
+-------------------------------------------------------------------
+Mon Feb  7 21:08:55 UTC 2011 - [email protected]
+
+- also package nrpe_check_control from contrib
+
+-------------------------------------------------------------------
+Tue Dec  7 21:42:01 UTC 2010 - [email protected]
+
+- prereq init scripts syslog and network
+
+-------------------------------------------------------------------
+Wed Sep 22 21:22:36 CEST 2010 - [email protected]
+
+- use /var/lib/nagios as home directory (same as nagios package)
+
+-------------------------------------------------------------------
+Sat Jul 10 07:31:13 UTC 2010 - [email protected]
+
+- fix missing operand for dirname in init script
+
+-------------------------------------------------------------------
+Mon May 24 07:58:16 UTC 2010 - [email protected]
+
+- add netcfg to PreReq to have /etc/services installed 
+  (fixes bnc #608164 )
+
+-------------------------------------------------------------------
+Wed May  5 15:45:05 UTC 2010 - [email protected]
+
+- set default values in init script
+
+-------------------------------------------------------------------
+Mon May  3 09:36:34 UTC 2010 - [email protected]
+
+- fix file ownership in /etc
+- added nrpe manpage from debian
+- added adapted patches from Debian:
+  + nrpe-more_random.patch (overwrite the buffer with better 
+                            randomness)
+  + nrpe-improved_help.patch (list additional commandline options)
+  + nrpe-weird_output.patch (null the buffer before using it)
+  + nrpe-drop_privileges_before_writing_pidfile.patch (name says all)
+- added the following patches to fix compilation warnings:
+  + nrpe-return_value.patch
+  + nrpe-uninitialized_variable.patch
+  + nrpe-unused_variable.patch
+
+-------------------------------------------------------------------
+Thu Apr 29 15:28:38 UTC 2010 - [email protected]
+
+- use /var/run/nrpe/nrpe.pid for pidfile; nagios can be run as 
+  different user/group which might cause conflicts
+- clean up the init skript and implement automatic movement/ 
+  creation of the pid directory
+- package /var/run/nrpe/nrpe.pid as ghost
+
+-------------------------------------------------------------------
+Sat Mar  6 20:59:09 UTC 2010 - [email protected]
+
+- cleanup subpackages
+  o nagios-nrpe is default package and provides NRPE daemon
+    obsoletes: client
+  o nagios-plugins-nrpe provides the check plugin to be installed
+    with the nagios host
+    obsoletes: server
+- cleanup spec
+  o sort TAGS
+  o removed/added define
+    - nsusr == nrpeusr
+    - nsgrp == nrpegrp
+    - added cmdgrp
+    - redefine _libexecdir
+  o added PreReq
+  o fix pre{,un}/post{,un} sections
+    - no restart_on_update x{,inetd}, cause xinet file is
+      installed 'disabled' by default
+    - service port is needed with server, not with plugin  
+    - no restart_on_update nagios when nrpe plugin is update
+      there is also no restart_on_update when nagios_plugins
+      are updated
+  o fix nrpe.cfg
+    o PID_File => /var/run/nagios/nrpe.pid
+- SOURCE mods
+  o reworked patches (Makefile,xinetd)
+  o replaced rcnrpe with nrpe.init
+  o added README.SuSE
+
+-------------------------------------------------------------------
+Wed Dec 23 08:21:50 UTC 2009 - [email protected]
+
+- Use -fno-strict-aliasing to CFLAGS since the code is not clean.
+- Own /etc/nagios directory.
+- Add _GNU_SOURCE to CFLAGS to get prototype of asprintf.
+
+-------------------------------------------------------------------
+Mon Dec  1 16:37:30 CET 2008 - [email protected]
+
+- disable buffersize patch per default: breaks compatibility
+- run try-restart only if the service is installed
+
+-------------------------------------------------------------------
+Thu Nov 27 19:28:38 CET 2008 - [email protected]
+
+- Added nagios-nrpe-buffersize.patch: support long check output 
+  of plugins, which is possible since Nagios 3.0
+
+-------------------------------------------------------------------
+Mon Oct 13 07:37:34 CEST 2008 - [email protected]
+
+- added cron to Should-Start/Should-Stop, so nrpe starts even on 
+  curious systems
+- added nagios-nrpe-SuSEfirewall2 
+- use --with-log_facility=daemon 
+
+-------------------------------------------------------------------
+Wed Sep 10 13:33:25 CEST 2008 - [email protected]
+
+- disable nrpe in xinetd per default
+- use a more stupid way to get the port in etc/services
+
+-------------------------------------------------------------------
+Mon Jul 28 18:48:28 CEST 2008 - [email protected]
+
+- move the Requires from the main- into the subpackage
+
+-------------------------------------------------------------------
+Tue Mar 11 12:15:08 CET 2008 - [email protected]
+
+- update to 2.12:
+  + Fix for unterminated multiline plugin (garbage) output 
+    (Krzysztof Oledzki). Needed for nagios 3.0
+- own the docu directory
+- added rpmlintrc
+
+-------------------------------------------------------------------
+Tue Jan 29 19:39:35 CET 2008 - [email protected]
+
+- Update to 2.11:
++++ 187 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:Factory/.nrpe.new/nrpe.changes

New:
----
  README.SuSE
  nagios-nrpe-SuSEfirewall2
  nagios-nrpe-buffersize.patch
  nagios-nrpe-rpmlintrc
  nrpe-2.14.tar.bz2
  nrpe-drop_privileges_before_writing_pidfile.patch
  nrpe-implicit_declaration.patch
  nrpe-improved_help.patch
  nrpe-more_random.patch
  nrpe-uninitialized_variable.patch
  nrpe-weird_output.patch
  nrpe-xinetd.patch
  nrpe.8
  nrpe.changes
  nrpe.init
  nrpe.spec
  nrpe_check_control.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nrpe.spec ++++++
#
# spec file for package nrpe
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


#       default
%define nagios3only 0
# Macro that print mesages to syslog at package (un)install time
%define nnmmsg logger -t %{name}/rpm
%define nrpeport 5666

Name:           nrpe
Version:        2.14
Release:        0
Summary:        Nagios Remote Plug-In Executor
License:        GPL-2.0+
Group:          System/Monitoring
Url:            http://www.nagios.org/
Source0:        nrpe-%{version}.tar.bz2
Source1:        nrpe.init
Source2:        nagios-nrpe-rpmlintrc
Source3:        nagios-nrpe-SuSEfirewall2
Source4:        nrpe.8
Source10:       README.SuSE
# PATCH-FIX-openSUSE place the service disabled in the directory
Patch1:         nrpe-xinetd.patch
# PATCH-FIX-openSUSE adapts NRPE to support the standard buffersize of Nagios 
3.x
Patch2:         nagios-nrpe-buffersize.patch
# PATCH-FIX-UPSTREAM produce more randomness and do not reduce entropy on Linux 
kernels
Patch3:         nrpe-more_random.patch
# PATCH-FIX-UPSTREAM improve help output of nrpe and check_nrpe
Patch4:         nrpe-improved_help.patch
# PATCH-FIX-UPSTREAM null buffer before using it
Patch5:         nrpe-weird_output.patch
# PATCH-FIX-UPSTREAM drop privileges before writing the pidfile for more safety
Patch6:         nrpe-drop_privileges_before_writing_pidfile.patch
# PATCH-FIX-UPSTREAM fix compiler warnings
Patch9:         nrpe-uninitialized_variable.patch
# PATCH-FIX-openSUSE fix pathnames for nrpe_check_control command
Patch10:        nrpe_check_control.patch
# PATCH-FIX-UPSTREAM using implicit definitions of functions
Patch11:        nrpe-implicit_declaration.patch
PreReq:         %fillup_prereq
PreReq:         %insserv_prereq
PreReq:         /bin/logger
PreReq:         coreutils
PreReq:         grep
PreReq:         netcfg
PreReq:         pwdutils
PreReq:         sed
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1130
PreReq:         sysvinit(network)
PreReq:         sysvinit(syslog)
%endif
#
BuildRequires:  nagios-plugins-common
BuildRequires:  nagios-rpm-macros
BuildRequires:  tcpd-devel
#
%if 0%{?suse_version} > 1000
BuildRequires:  krb5-devel
%else
BuildRequires:  heimdal-devel
%endif
#
%if 0%{?suse_version} > 1020
BuildRequires:  libopenssl-devel
BuildRequires:  openssl
%else
BuildRequires:  openssl-devel
%endif
#
%if 0%{?suse_version} > 1020
Recommends:     inet-daemon
Recommends:     nagios-plugins
%else
Requires:       inet-daemon
Requires:       nagios-plugins
%endif
#
Provides:       nagios-nrpe = %{version}
Obsoletes:      nagios-nrpe < 2.14
Provides:       nagios-nrpe-client = %{version}
Obsoletes:      nagios-nrpe-client < 2.14

%description
NRPE can be used to run nagios plug-ins on a remote machine for
executing local checks.
This package contains the software for NRPE server.
It could be run by inet-daemon or as stand-alone daemon

%package doc
Summary:        Nagios Remote Plug-In Executor documentation
Group:          Documentation/Other
Provides:       nagios-nrpe-doc = %{version}
Obsoletes:      nagios-nrpe-doc < 2.14

%description doc
This package contains the README files, OpenOffice and PDF
documentation for the remote plugin executor (NRPE) for nagios.

%package -n nagios-plugins-nrpe
Summary:        Nagios NRPE plugin
Group:          System/Monitoring
%if 0%{?suse_version} > 1020
Recommends:     monitoring_daemon
%endif
Provides:       nagios-nrpe-server = %{version}
Obsoletes:      nagios-nrpe-server < 2.14

%description -n nagios-plugins-nrpe
This package contains the plug-in for the host runing the Nagios
daemon.

It is used to contact the NRPE process on remote hosts. The plugin
requests that a plugin be executed on the remote host and wait for the
NRPE process to execute the plugin and return the result.

The plugin then uses the output and return code from the plugin
execution on the remote host for its own output and return code.

%prep
%setup -q
%patch1 -p0
%if %{nagios3only}
%patch2 -p0
%endif
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch9 -p0
%patch10 -p0
%patch11 -p0
cp -a %{SOURCE10} .
chmod -x contrib/README.nrpe_check_control
%if 0%{?suse_version} > 01110
# increase the number of 'allowed' processes on newer systems:
sed -i "s|check_procs -w 150 -c 200|check_procs -w 250 -c 300|g" 
sample-config/nrpe.cfg.in  
%endif
# add the new include directory
sed -i 
"s|#include_dir=<someotherdirectory>|#include_dir=<someotherdirectory>\ninclude_dir=/etc/nrpe.d|g"
 sample-config/nrpe.cfg.in

%build
%configure \
        --sbindir=%{nagios_cgidir} \
        --libexecdir=%{nagios_plugindir} \
        --datadir=%{nagios_datadir} \
        --sysconfdir=%{_sysconfdir} \
        --localstatedir=%{nagios_logdir} \
        --exec-prefix=%{_sbindir} \
        --bindir=%{_sbindir} \
        --with-log_facility=daemon \
        --with-kerberos-inc=%{_includedir} \
        --with-nagios-user=%{nagios_user} \
        --with-nagios-group=%{nagios_group} \
        --with-nrpe-user=%{nagios_user} \
        --with-nrpe-group=%{nagios_group} \
        --with-nrpe-port=%nrpeport \
        --enable-command-args \
        --enable-bash-command-substitution \
        --enable-ssl
make %{?_smp_mflags} all

gcc %{optflags} -o contrib/nrpe_check_control contrib/nrpe_check_control.c

%install
install -d %{buildroot}%{_sysconfdir}/xinetd.d
install -d %{buildroot}%{_localstatedir}/run/%{name}
install -d %{buildroot}%{_sysconfdir}/nrpe.d
make install install-daemon install-daemon-config install-xinetd \
    DESTDIR=%{buildroot} \
    INSTALL_OPTS="" \
    COMMAND_OPTS="" \
    CGICFGDIR="%{_sysconfdir}" \
    NAGIOS_INSTALL_OPTS="" \
    NRPE_INSTALL_OPTS="" \
    INIT_OPTS=""

install -Dm 644 %{SOURCE4} %{buildroot}%{_mandir}/man8/nrpe.8
install -Dm 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/nrpe
ln -s -f ../../etc/init.d/nrpe %{buildroot}%{_sbindir}/rcnrpe

# install SuSEfirewall2 script
%if 0%{?suse_version} > 1020
install -Dm644 %{SOURCE3} 
%{buildroot}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nrpe
%endif

# fix pid_file in nrpe.cfg
sed -i -e "s,^\(pid_file=\).*,\1/var/run/%{name}/nrpe.pid," 
%{buildroot}/%{_sysconfdir}/nrpe.cfg

# create directory and pidfile (package them as ghost)
mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
touch %{buildroot}%{_localstatedir}/run/%{name}/nrpe.pid

# create home directory of nagios user
mkdir -p %{buildroot}%{nagios_localstatedir}

# create contrib plugin
install -m0755 contrib/nrpe_check_control 
%{buildroot}%{nagios_plugindir}/nrpe_check_control
cat > nrpe_check_control.cfg <<'EOF'
define command {
    command_name    nrpe_check_control
    command_line    %{nagios_plugindir}/nrpe_check_control $SERVICESTATE$ 
$SERVICESTATETYPE$ $SERVICEATTEMPT$ "$HOSTNAME$"
}
EOF
install -Dm0644 nrpe_check_control.cfg 
%{buildroot}%{nagios_sysconfdir}/objects/nrpe_check_control.cfg

%pre
# Create user and group on the system if necessary
%nagios_user_group_add
# check if the port for nrpe is already defined in /etc/services
if grep -q %nrpeport /etc/services ; then
    : OK - port already defined
else
    %nnmmsg "Adding port %nrpeport to /etc/services"
        echo "nrpe            %nrpeport/tcp # Nagios nrpe" >> etc/services
fi

%preun
%stop_on_removal %{name}

%post
%{fillup_and_insserv -fy %{name}}

%triggerun -- nagios-nrpe < 2.14
STATUS='/var/adm/update-scripts/nrpe'
if [ -x %{_sysconfdir}/init.d/nrpe ]; then
    %{_sysconfdir}/init.d/nrpe status >/dev/null
    if test $? = 0; then
        echo "%{_sysconfdir}/init.d/nrpe restart" >> "$STATUS"
    else
        touch "$STATUS"
    fi
    chmod +x "$STATUS"
fi
if [ -x %{_sysconfdir}/init.d/xinetd ]; then
    %{_sysconfdir}/init.d/xinetd status >/dev/null
    if test $? = 0; then
        echo "%{_sysconfdir}/init.d/xinetd try-restart" >> "$STATUS"
    else
        touch "$STATUS"
    fi
    chmod +x "$STATUS"
fi

%triggerpostun -- nagios-nrpe < 2.14 
# Move /etc/nagios/nrpe.cfg to /etc/nrpe.cfg when updating from an old version
# and inform the admin about the rename.
if test -e %{nagios_sysconfdir}/nrpe.cfg.rpmsave -a ! -e 
%{_sysconfdir}/nrpe.cfg.rpmnew; then
    mv %{_sysconfdir}/nrpe.cfg %{_sysconfdir}/nrpe.cfg.rpmnew
    mv %{nagios_sysconfdir}/nrpe.cfg.rpmsave %{_sysconfdir}/nrpe.cfg
    echo "# %{nagios_sysconfdir}/nrpe.cfg has been moved to 
%{_sysconfdir}/nrpe.cfg" > %{nagios_sysconfdir}/nrpe.cfg
    echo "# This file can be removed." >> %{nagios_sysconfdir}/nrpe.cfg
    echo "include=%{_sysconfdir}/nrpe.cfg" >> %{nagios_sysconfdir}/nrpe.cfg
fi
sed -i "s|%{nagios_sysconfdir}/nrpe.cfg|%{_sysconfdir}/nrpe.cfg|g" 
%{_sysconfdir}/xinetd.d/nrpe || :
sed -i "s|nrpe-service|%{name}|g" %{_sysconfdir}/sysconfig/SuSEfirewall2 || :
if [ -e /var/adm/update-scripts/nrpe ]; then
    /bin/sh /var/adm/update-scripts/nrpe
    rm /var/adm/update-scripts/nrpe
fi

%postun
%restart_on_update nrpe
%insserv_cleanup

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README.SuSE README.SSL SECURITY
%{_mandir}/man8/nrpe.8*
%dir %{_sysconfdir}/nrpe.d
%config(noreplace) %{_sysconfdir}/nrpe.cfg
%config(noreplace) %{_sysconfdir}/xinetd.d/nrpe
%if 0%{?suse_version} > 1020
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nrpe
%endif
%{_sysconfdir}/init.d/nrpe
%{_sbindir}/nrpe
%{_sbindir}/rcnrpe
%ghost %dir %{_localstatedir}/run/%{name}
%ghost %{_localstatedir}/run/%{name}/nrpe.pid

%files doc
%defattr(0644,root,root,0755)
%doc Changelog LEGAL README README.SSL README.SuSE SECURITY docs/*.pdf

%files -n nagios-plugins-nrpe
%defattr(-,root,root)
%doc contrib/README.nrpe_check_control
%dir %{nagios_libdir}
%dir %{nagios_sysconfdir}
%dir %{nagios_sysconfdir}/objects
%config(noreplace) %{nagios_sysconfdir}/objects/nrpe_check_control.cfg
%{nagios_plugindir}/check_nrpe
%{nagios_plugindir}/nrpe_check_control

%changelog
++++++ README.SuSE ++++++
README.SuSE for nagios-nrpe
===========================

= New place for nrpe.cfg =

To allow the use of either Icinga or Nagios, the nrpe.cfg is now 
located in /etc/ directly. If you make use of the include_dir 
directive, please use the new directory /etc/nrpe.d/ for this.

= Package rename =

The packages
- nagios-nrpe-client
- nagios-nrpe-server
are marked as obsolete:

While seeing the client/server pkg normal user would be misled to
install which package where.
When seeing "server" package you're thinking about a server-daemon
and when seeing "client" you're thinking client which is talking
with the server (NRPE).
But it was just the other way round. :(

Now:
- nagios-nrpe (obsoletes nagios-nrpe-client) and provides the NRPE
  daemon which should be installed on the remote box which should
  be monitored.

- nagios-plugins-nrpe (obsoletes nagios-nrpe-server) and provides
  "check_nrpe" which should be installed on the server hosting nagios.
  
- nagios-nrpe-doc contains documentation and can be installed where 
  ever you want

Have a lot of fun!
++++++ nagios-nrpe-SuSEfirewall2 ++++++
## Name: NRPE Service
## Description: Opens port for NRPE Service to allow connects from Nagios.

# space separated list of allowed TCP ports
TCP="5666"

# space separated list of allowed UDP ports
UDP=""

# space separated list of allowed RPC services
RPC=""

# space separated list of allowed IP protocols
IP=""

# space separated list of allowed UDP broadcast ports
BROADCAST=""
++++++ nagios-nrpe-buffersize.patch ++++++
# Up with Version 3.0, Nagios supports long hostoutputs.
# This patch adapts nrpe to support the standard buffersize 
# of Nagios 3.0 - so plugins can send (very) long output via
# NRPE to the Nagios Server.
Index: include/common.h
===================================================================
--- include/common.h.orig
+++ include/common.h
@@ -41,7 +41,7 @@
 #define DEFAULT_SOCKET_TIMEOUT 10      /* timeout after 10 seconds */
 #define DEFAULT_CONNECTION_TIMEOUT 300 /* timeout if daemon is waiting for 
connection more than this time */
 
-#define MAX_INPUT_BUFFER       2048    /* max size of most buffers we use */
+#define MAX_INPUT_BUFFER       8192    /* max size of most buffers we use */
 #define MAX_FILENAME_LENGTH     256
 
 #define MAX_HOST_ADDRESS_LENGTH        256     /* max size of a host address */
@@ -60,7 +60,7 @@
 #define NRPE_PACKET_VERSION_2   2               
 #define NRPE_PACKET_VERSION_1  1               /* older packet version 
identifiers (no longer supported) */
 
-#define MAX_PACKETBUFFER_LENGTH        1024            /* max amount of data 
we'll send in one query/response */
+#define MAX_PACKETBUFFER_LENGTH        8192            /* max amount of data 
we'll send in one query/response */
 
 typedef struct packet_struct{
        int16_t   packet_version;
++++++ nagios-nrpe-rpmlintrc ++++++
# the init script is called like the original one...
addFilter("W: incoherent-init-script-name nrpe")
# RPM doesn't allow to package the -doc package as noarch
addFilter("W: no-binary")
# better PreRequire grep as we need it for /etc/services...
addFilter("W: useless-explicit-requires grep")
++++++ nrpe-drop_privileges_before_writing_pidfile.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -307,13 +307,13 @@ int main(int argc, char **argv){
                /* log info to syslog facility */
                syslog(LOG_NOTICE,"Starting up daemon");
 
+               /* drop privileges */
+               drop_privileges(nrpe_user,nrpe_group);
+
                /* write pid file */
                if(write_pid_file()==ERROR)
                        return STATE_CRITICAL;
 
-               /* drop privileges */
-               drop_privileges(nrpe_user,nrpe_group);
-
                /* make sure we're not root */
                check_privileges();
 
++++++ nrpe-implicit_declaration.patch ++++++
Index: contrib/nrpe_check_control.c
===================================================================
--- contrib/nrpe_check_control.c.orig
+++ contrib/nrpe_check_control.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
++++++ nrpe-improved_help.patch ++++++
Index: src/check_nrpe.c
===================================================================
--- src/check_nrpe.c.orig
+++ src/check_nrpe.c
@@ -96,6 +96,9 @@ int main(int argc, char **argv){
                printf(" [arglist]  = Optional arguments that should be passed 
to the command.  Multiple\n");
                printf("              arguments should be separated by a space. 
 If provided, this must be\n");
                printf("              the last option supplied on the command 
line.\n");
+        printf(" -h, --help       Print this short help.\n");
+        printf(" -l,--license Print licensing information.\n");
+        printf(" -n,--no-ssl  Do not initial an ssl handshake with the server, 
talk in plaintext.\n");
                printf("\n");
                printf("Note:\n");
                printf("This plugin requires that you have the NRPE daemon 
running on the remote host.\n");
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -148,14 +148,17 @@ int main(int argc, char **argv){
 
        else if(result!=OK || show_help==TRUE){
 
-               printf("Usage: nrpe [-n] -c <config_file> <mode>\n");
+               printf("Usage: nrpe [-n] -c <config_file> <mode> [--help] 
[--license] [--no-ssl]\n");
                printf("\n");
                printf("Options:\n");
                printf(" -n            = Do not use SSL\n");
                printf(" <config_file> = Name of config file to use\n");
                printf(" <mode>        = One of the following operating 
modes:\n");  
-               printf("   -i          =    Run as a service under inetd or 
xinetd\n");
-               printf("   -d          =    Run as a standalone daemon\n");
+        printf(" -i, --inetd     Run as a service under inetd or xinetd\n");
+        printf(" -d, --daemon    Run as a standalone daemon\n");
+        printf(" -h, --help    = Print this short help.\n");
+        printf(" -l, --license = Print licensing information.\n");
+        printf(" -n, --no-ssl  = Do not initial an ssl handshake with the 
server, talk in plain text.\n");
                /* Updates help section to indicate how to start under SRC on 
AIX */
                printf("   -d -s       =    Run as a subsystem under AIX\n");   
     
                printf("\n");
++++++ nrpe-more_random.patch ++++++
Index: src/utils.c
===================================================================
--- src/utils.c.orig
+++ src/utils.c
@@ -99,7 +99,7 @@ void randomize_buffer(char *buffer,int b
 
        /* else fallback to using the current time as the seed */
        else
-               seed=(int)time(NULL);
+               seed=(int)time(NULL)*311-getpid()*359+getppid()*382;
 
        srand(seed);
        for(x=0;x<buffer_size;x++)
++++++ nrpe-uninitialized_variable.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -794,6 +794,8 @@ void wait_for_connections(void){
 #ifdef HAVE_LIBWRAP
        struct request_info req;
 #endif
+       /* default: failed */
+       new_sd=-1;
 
        /* create a socket for listening */
        sock=socket(AF_INET,SOCK_STREAM,0);
++++++ nrpe-weird_output.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -1194,6 +1194,9 @@ void handle_connection(int sock){
        /* disable connection alarm - a new alarm will be setup during 
my_system */
        alarm(0);
 
+       /* null buffer before using it - Debian Patch by <luk@luknote> */
+       memset(buffer,0,sizeof(buffer));
+
        /* if this is the version check command, just spew it out */
        if(!strcmp(command_name,NRPE_HELLO_COMMAND)){
 
++++++ nrpe-xinetd.patch ++++++
Index: sample-config/nrpe.xinetd.in
===================================================================
--- sample-config/nrpe.xinetd.in.orig
+++ sample-config/nrpe.xinetd.in
@@ -1,16 +1,17 @@
-# default: on
+# default: off
 # description: NRPE (Nagios Remote Plugin Executor)
 service nrpe
 {
                flags           = REUSE
-        socket_type     = stream    
-       port            = @nrpe_port@    
+        socket_type     = stream
+        type            = UNLISTED
+        port            = @nrpe_port@
                wait            = no
         user            = @nrpe_user@
-       group           = @nrpe_group@
+        group           = @nrpe_group@
                server          = @bindir@/nrpe
         server_args     = -c @sysconfdir@/nrpe.cfg --inetd
                log_on_failure  += USERID
-        disable         = no
-       only_from       = 127.0.0.1
+        disable         = yes
+        # only_from       = 127.0.0.1
 }
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -56,7 +56,7 @@ install:
        cd $(SRC_BASE) && $(MAKE) $@
 
 install-xinetd:
-       $(INSTALL) -m 644 sample-config/nrpe.xinetd /etc/xinetd.d/nrpe 
+       $(INSTALL) -m 644 sample-config/nrpe.xinetd 
$(DESTDIR)/etc/xinetd.d/nrpe 
 
 install-daemon-config:
        $(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
++++++ nrpe.8 ++++++
.\"                                      Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH NAGIOS-NRPE 8 "January 14, 2004"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh        disable hyphenation
.\" .hy        enable hyphenation
.\" .ad l      left justify
.\" .ad b      justify to both left and right margins
.\" .nf        disable filling
.\" .fi        enable filling
.\" .br        insert line break
.\" .sp <n>    insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
nrpe \- Nagios Remote Plugin Executor - Server
.SH SYNOPSIS
.B nagios-nrpe
\fI-c <config_file> <mode>\fR
.SH DESCRIPTION
.PP
The purpose of this addon is to allow you to execute Nagios plugins on a
remote host in as transparent a manner as possible.
.PP
This program runs as a background process on the remote host and processes
command execution requests from the check_nrpe plugin on the Nagios host.
.SH OPTIONS
.IP
<config_file> = Name of config file to use
.IP
<mode>        = One of the following two operating modes:
.TP
\fB\-i\fR
=    Run as a service under inetd or xinetd
.TP
\fB\-d\fR
=    Run as a standalone daemon
.PP
Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios.  It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
.SH AUTHOR
This manual page was written by Jason Thomas <[email protected]>,
for the Debian project (but may be used by others).
++++++ nrpe.init ++++++
#!/bin/bash
#
# Copyright (c) 2010 SUSE Linux Products GmbH
# Authors: Lars Vogdt (2010-2012)
#
# /etc/init.d/nrpe
#   and its symbolic link
# /usr/sbin/rcnrpe
#
### BEGIN INIT INFO
# Provides:          nagios-nrpe
# Required-Start:    $remote_fs $syslog $network
# Should-Start:      cron
# Required-Stop:     $remote_fs $syslog
# Should-Stop:       cron
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: NRPE Nagios Remote Plugin Executor
# Description:       Start NRPE to allow remote execution of
#       Nagios plugins.
### END INIT INFO

NRPE_BIN="/usr/sbin/nrpe"
NRPE_CONFIG="/etc/nrpe.cfg"
DEFAULT_PIDFILE="/var/run/nrpe/nrpe.pid"

test -x $NRPE_BIN || { echo "$NRPE_BIN not installed";
    if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

test -r $NRPE_CONFIG || { echo "$NRPE_CONFIG not existing";
    if [ "$1" = "stop" ]; then exit 0;
        else exit 6; fi; }

function get_value() {
    if [ -n "$2" ]; then
        set -- `grep ^$1 "$2" | sed 's@=@ @' | tr -d '[:cntrl:]'`
    else
        set -- `grep ^$1 "$NRPE_CONFIG" | sed 's@=@ @' | tr -d '[:cntrl:]'`
    fi
    shift # remove first ARG => search-string
    echo $*
}

# Shell functions sourced from /etc/rc.status:
. /etc/rc.status
# Reset status of this service
rc_reset

case "$1" in
    start)
                echo -n "Starting Nagios NRPE "
                pid_file="$(get_value pid_file)"
                nrpe_group="$(get_value nrpe_group)"
                nrpe_user="$(get_value nrpe_user)"
                : ${pid_file=:=$DEFAULT_PIDFILE}
                : ${nrpe_group:=nagios}
                : ${nrpe_user:=nagios}
                if [ -z "$pid_file" ]; then
                        PIDDIR=$(dirname $pid_file)
                else
                        PIDDIR=$(dirname $DEFAULT_PIDFILE)
                fi
                case "$PIDDIR" in 
                        /var/run)
                                if [ x"$nrpe_user" != x"root" ]; then
                                        DATESTRING=$(date +"%Y%m%d")
                                        mv -f "$NRPE_CONFIG"  
"$NRPE_CONFIG-$DATESTRING"
                                        sed -e 
"s|^pid_file.*|pid_file=$DEFAULT_PIDFILE|g" "$NRPE_CONFIG-$DATESTRING" > 
"$NRPE_CONFIG" 
                                        /bin/logger -t rcnrpe "Configured 
$pid_file in $NRPE_CONFIG moved to $DEFAULT_PIDFILE. Backup is 
$NRPE_CONFIG-$DATESTRING"
                                        echo
                                        echo "Configured $pid_file in 
$NRPE_CONFIG moved to $DEFAULT_PIDFILE. Backup is $NRPE_CONFIG-$DATESTRING"
                                        test -f "$pid_file" && rm "$pid_file"
                                        install -d -m755 -o$nrpe_user 
-g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
                                else
                                        test -d "$PIDDIR" || mkdir -p "$PIDDIR"
                                fi
                        ;;
                        *)
                                test -d $(dirname "$DEFAULT_PIDFILE") || 
install -d -m755 -o$nrpe_user -g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
                        ;;
                esac
                /sbin/startproc $NRPE_BIN -c $NRPE_CONFIG -d
                rc_status -v
        ;;
        stop)
                echo -n "Shutting down Nagios NRPE "
                /sbin/killproc -TERM $NRPE_BIN
                rc_status -v
        ;;
    try-restart|condrestart)
                if test "$1" = "condrestart"; then
                                echo "${attn} Use try-restart 
${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
                fi
                $0 status
                if test $? = 0; then
                                $0 restart
                else
                        rc_reset        # Not running is not a failure.
                fi
                rc_status
        ;;
    restart)
                $0 stop
                $0 start
                rc_status
        ;;
    reload|force-reload)
                echo -n "Reload service Nagios NRPE "
                /sbin/killproc -HUP $NRPE_BIN
                rc_status -v
        ;;
    status)
                echo -n "Checking for service Nagios NRPE "
                /sbin/checkproc $NRPE_BIN
                rc_status -v
        ;;
    *)
                echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload}"
                exit 1
        ;;
esac
rc_exit
++++++ nrpe_check_control.patch ++++++
Index: contrib/nrpe_check_control.c
===================================================================
--- contrib/nrpe_check_control.c.orig
+++ contrib/nrpe_check_control.c
@@ -5,8 +5,8 @@
 #define MAX_CHARS      1024
 #define SERVICE_COUNT  12
 
-#define COMMAND_FILE   "/usr/local/nagios/var/rw/nagios.cmd"
-#define SERVICES_FILE  "/usr/local/nagios/etc/services.cfg"
+#define COMMAND_FILE   "/var/spool/nagios/nagios.cmd"
+#define SERVICES_FILE  "/etc/nagios/services.cfg"
 
 int main(int argc, char *argv[])
 {
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to