469dd71
%define nsport 5666
469dd71
469dd71
Name: nrpe
469dd71
Version: 2.5.2
469dd71
Release: 3%{?dist}
469dd71
Summary: Host/service/network monitoring agent for Nagios
469dd71
469dd71
Group: Applications/System
469dd71
License: GPL
469dd71
URL: http://www.nagios.org
469dd71
Source: http://dl.sourceforge.net/nagios/%{name}-%{version}.tar.gz
469dd71
Patch0: nrpe-initreload.patch
469dd71
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
469dd71
469dd71
BuildRequires: openssl-devel tcp_wrappers
469dd71
469dd71
Requires(pre): %{_sbindir}/useradd
469dd71
Requires(preun): /sbin/service, /sbin/chkconfig
469dd71
Requires(post): /sbin/chkconfig, /sbin/service
469dd71
Requires(postun): /sbin/service
469dd71
469dd71
%description
469dd71
Nrpe is a system daemon that will execute various Nagios plugins
469dd71
locally on behalf of a remote (monitoring) host that uses the
469dd71
check_nrpe plugin.  Various plugins that can be executed by the 
469dd71
daemon are available at:
469dd71
http://sourceforge.net/projects/nagiosplug
469dd71
469dd71
This package provides the core agent.
469dd71
469dd71
%package -n nagios-plugins-nrpe
469dd71
Group: Applications/System
469dd71
Summary: Provides nrpe plugin for Nagios
469dd71
Requires: nagios-plugins
469dd71
Provides: check_nrpe
469dd71
469dd71
%description -n nagios-plugins-nrpe
469dd71
Nrpe is a system daemon that will execute various Nagios plugins
469dd71
locally on behalf of a remote (monitoring) host that uses the
469dd71
check_nrpe plugin.  Various plugins that can be executed by the 
469dd71
daemon are available at:
469dd71
http://sourceforge.net/projects/nagiosplug
469dd71
469dd71
This package provides the nrpe plugin for Nagios-related applications.
469dd71
469dd71
%prep
469dd71
%setup -q
469dd71
%patch0 -p0
469dd71
469dd71
%build
469dd71
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
469dd71
./configure \
469dd71
	--with-init-dir=%{_initrddir} \
469dd71
	--with-nrpe-port=%{nsport} \
469dd71
	--with-nrpe-user=nrpe \
469dd71
	--with-nrpe-group=nrpe \
469dd71
	--bindir=%{_sbindir} \
469dd71
	--libdir=/doesnt/matter/ \
469dd71
	--libexecdir=%{_libdir}/nagios/plugins \
469dd71
	--datadir=%{_datadir}/nagios \
469dd71
	--sysconfdir=%{_sysconfdir}/nagios \
469dd71
	--localstatedir=%{_localstatedir}/log/nagios \
469dd71
	--enable-command-args
469dd71
make %{?_smp_mflags} all
469dd71
sed -i "s/# chkconfig: 2345/# chkconfig: - /" init-script
469dd71
469dd71
%install
469dd71
rm -rf %{buildroot}
469dd71
install -D -m 0755 init-script %{buildroot}/%{_initrddir}/nrpe
469dd71
install -D -m 0644 sample-config/nrpe.cfg %{buildroot}/%{_sysconfdir}/nagios/nrpe.cfg
469dd71
install -D -m 0755 src/nrpe %{buildroot}/%{_sbindir}/nrpe
469dd71
install -D -m 0755 src/check_nrpe %{buildroot}/%{_libdir}/nagios/plugins/check_nrpe
469dd71
469dd71
%clean
469dd71
rm -rf %{buildroot}
469dd71
469dd71
%pre
469dd71
%{_sbindir}/useradd -c "NRPE user for the NRPE service" -d / -r -s /sbin/nologin nrpe 2> /dev/null || :
469dd71
469dd71
%preun
469dd71
if [ $1 = 0 ]; then
469dd71
	/sbin/service %{name} stop > /dev/null 2>&1 || :
469dd71
	/sbin/chkconfig --del %{name} || :
469dd71
fi
469dd71
469dd71
%post
469dd71
/sbin/chkconfig --add %{name} || :
469dd71
469dd71
%postun
469dd71
if [ "$1" -ge "1" ]; then
469dd71
	/sbin/service %{name} condrestart > /dev/null 2>&1 || :
469dd71
fi
469dd71
469dd71
%files
469dd71
%defattr(-,root,root,-)
469dd71
%{_initrddir}/nrpe
469dd71
%{_sbindir}/nrpe
469dd71
%dir %{_sysconfdir}/nagios
469dd71
%config(noreplace) %{_sysconfdir}/nagios/nrpe.cfg
469dd71
%doc Changelog LEGAL README 
469dd71
469dd71
%files -n nagios-plugins-nrpe
469dd71
%defattr(-,root,root,-)
469dd71
%{_libdir}/nagios/*
469dd71
%doc Changelog LEGAL README
469dd71
469dd71
%changelog
469dd71
* Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.5.2-3
469dd71
- no longer owns libdir/nagios
469dd71
- buildrequires tcp_wrappers
469dd71
469dd71
* Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.5.2-2
469dd71
- Specify bogus libdir so rpmlint won't complain
469dd71
469dd71
* Mon Jul 03 2006 Mike McGrath <imlinux@gmail.com> 2.5.2-1
469dd71
- Upstream released new version
469dd71
469dd71
* Mon Mar 12 2006 Mike McGrath <imlinux@gmail.com> 2.4-3
469dd71
- Added description to useradd statement
469dd71
469dd71
* Sun Mar 05 2006 Mike McGrath <imlinux@gmail.com> 2.4-2
469dd71
- Added proper SMP build flags
469dd71
- Added %{?dist} tag
469dd71
- Added reload to nrpe script
469dd71
- Updated to 2.4, changes include: 
469dd71
- Added option to allow week random seed (Gerhard Lausser)
469dd71
- Added optional command line prefix (Sean Finney)
469dd71
- Added ability to reload config file with SIGHUP
469dd71
- Fixed bug with location of dh.h include file
469dd71
- Fixed bug with disconnect message in debug mode
469dd71
469dd71
* Sat Feb 04 2006 Mike McGrath <imlinux@gmail.com> 2.3-1
469dd71
- Created a Fedora friendly spec file
469dd71
469dd71
* Mon Jan 23 2006 Andreas Kasenides ank<@>cs.ucy.ac.cy
469dd71
- fixed nrpe.cfg relocation to sample-config
469dd71
- replaced Copyright label with License
469dd71
- added --enable-command-args to enable remote arg passing (if desired can be disabled by commenting out)
469dd71
469dd71
* Wed Nov 12 2003 Ingimar Robertsson <iar@skyrr.is>
469dd71
- Added adding of nagios group if it does not exist.
469dd71
469dd71
* Tue Jan 07 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
469dd71
- Removed the lines which removed the nagios user and group from the system
469dd71
- changed the patch release version from 3 to 1
469dd71
469dd71
* Mon Jan 06 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
469dd71
- Removed patch files required for nrpe 1.5
469dd71
- Update spec file for version 1.6 (1.6-1)
469dd71
469dd71
* Sat Dec 28 2002 James 'Showkilr' Peterson <showkilr@showkilr.com>
469dd71
- First RPM build (1.5-1)