# Reserve option to override port setting with: # rpm -ba|--rebuild --define 'nsport 5666' %{!?nsport:%define nsport 5666} Summary: Host/service/network monitoring agent for Nagios. URL: http://www.nagios.org Name: nrpe Version: 2.0 Release: 4.%{mysig} License: GPL Group: Application/System Source0: %{name}-%{version}.tar.gz Patch0: nrpe-2.0-init.patch Prefix: %{_prefix} Prefix: /etc/init.d Prefix: /etc/nagios PreReq: chkconfig, sh-utils, shadow-utils, sed, initscripts, fileutils, mktemp, /sbin/nologin Requires: bash grep nagios-plugins BuildRoot: %{_tmppath}/%{name}-buildroot %description Nrpe is a system daemon that will execute various Nagios plugins locally on behalf of a remote (monitoring) host that uses the check_nrpe plugin. Various plugins that can be executed by the daemon are available at: http://sourceforge.net/projects/nagiosplug This package provides the core agent (standalone daemon). %package plugin Group: Application/System Summary: Provides nrpe plugin for Nagios. Requires: nagios %description plugin Nrpe is a system daemon that will execute various Nagios plugins locally on behalf of a remote (monitoring) host that uses the check_nrpe plugin. Various plugins that can be executed by the daemon are available at: http://sourceforge.net/projects/nagiosplug This package provides the nrpe plugin for Nagios-related applications. %prep %setup -q %patch -p1 -b .nodefrun %build export PATH=$PATH:/usr/sbin CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ ./configure \ --with-init-dir=/etc/init.d \ --with-nrpe-port=%{nsport} \ --with-nrpe-user=nrpe \ --with-nrpe-group=nrpe \ --prefix=%{_prefix} \ --exec-prefix=%{_prefix}/sbin \ --bindir=%{_prefix}/sbin \ --sbindir=%{_prefix}/lib/nagios/cgi \ --libexecdir=%{_prefix}/lib/nagios/plugins \ --datadir=%{_prefix}/share/nagios \ --sysconfdir=/etc/nagios \ --localstatedir=/var/log/nagios make all %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT install -d -m 0755 ${RPM_BUILD_ROOT}/etc/init.d install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios install -d -m 0755 ${RPM_BUILD_ROOT}/usr/sbin install -d -m 0755 ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins # install templated configuration files install -m 644 nrpe.cfg ${RPM_BUILD_ROOT}/etc/nagios/nrpe.cfg install -m 755 init-script ${RPM_BUILD_ROOT}/etc/init.d/nrpe install -m 755 src/nrpe ${RPM_BUILD_ROOT}/usr/sbin install -m 755 src/check_nrpe ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %pre if ! /usr/bin/id -g nrpe > /dev/null 2>&1; then /usr/sbin/groupadd -r -f nrpe 2>&1 || : fi if ! /usr/bin/id nrpe > /dev/null 2>&1; then /usr/sbin/useradd -r -d / -s /sbin/nologin -c nrpe -g nrpe nrpe || : fi %post /sbin/chkconfig --add nrpe %preun if [ $1 = 0 ]; then /sbin/service nrpe stop > /dev/null 2>&1 /sbin/chkconfig --del nrpe fi %postun if [ $1 -eq 0 ]; then /usr/sbin/groupdel nrpe || : /usr/sbin/userdel nrpe || : fi if [ $1 -ge 1 ]; then /sbin/service nrpe condrestart >/dev/null 2>&1 || : fi %files %defattr(-,root,root) /etc/init.d/nrpe %{_prefix}/sbin/nrpe /etc/nagios/* %config(noreplace) /etc/nagios/*.cfg %doc %attr(644,root,root) Changelog LEGAL README nrpe.xinetd %files plugin %defattr(-,root,root) %{_prefix}/lib/nagios/plugins/* %doc Changelog LEGAL README %changelog * Wed Aug 10 2005 Milan Kerslager 2.0-4.ker.rhel4 - use own user nrpe instead of nagios user (nrpe does not need nagios package to run, only nagios-plugins package which does not require nagios user) * Wed Feb 23 2005 Milan Kerslager 2.0-2.ker.rhel4 - rebuild for RHEL4 - nrpe-plugin requires nagios instead of nagios-plugins * Mon Mar 15 2004 Milan Kerslager 2.0-1.ker.rhel3 - build for RHEL3 - nodefrun patch - SPEC script fixes * Tue Jan 07 2003 James 'Showkilr' Peterson - Removed the lines which removed the nagios user and group from the system - changed the patch release version from 3 to 1 * Mon Jan 06 2003 James 'Showkilr' Peterson - Removed patch files required for nrpe 1.5 - Update spec file for version 1.6 (1.6-1) * Sat Dec 28 2002 James 'Showkilr' Peterson - First RPM build (1.5-1)