8
# Reserve option to override port setting with:
9
# rpm -ba|--rebuild --define 'nsport 5666'
10
%{?port:%define nsport %{port}}
12
# Macro that print mesages to syslog at package (un)install time
13
%define nnmmsg logger -t %{name}/rpm
15
Summary: Host/service/network monitoring agent for Nagios
16
URL: http://www.nagios.org
21
Group: Application/System
22
Source0: %{name}-%{version}.tar.gz
23
BuildRoot: %{_tmppath}/%{name}-buildroot
27
Requires: bash, grep, nagios-plugins
28
PreReq: /usr/bin/logger, chkconfig, sh-utils, shadow-utils, sed, initscripts, fileutils, mktemp
31
Nrpe is a system daemon that will execute various Nagios plugins
32
locally on behalf of a remote (monitoring) host that uses the
33
check_nrpe plugin. Various plugins that can be executed by the
34
daemon are available at:
35
http://sourceforge.net/projects/nagiosplug
37
This package provides the core agent.
40
Group: Application/System
41
Summary: Provides nrpe plugin for Nagios.
42
Requires: nagios-plugins
45
Nrpe is a system daemon that will execute various Nagios plugins
46
locally on behalf of a remote (monitoring) host that uses the
47
check_nrpe plugin. Various plugins that can be executed by the
48
daemon are available at:
49
http://sourceforge.net/projects/nagiosplug
51
This package provides the nrpe plugin for Nagios-related applications.
58
# Create `nagios' group on the system if necessary
59
if grep ^nagios: /etc/group; then
60
: # group already exists
62
/usr/sbin/groupadd %{nsgrp} || %nnmmsg Unexpected error adding group "%{nsgrp}". Aborting install process.
65
# Create `nagios' user on the system if necessary
67
: # user already exists
69
/usr/sbin/useradd -r -d /var/log/nagios -s /bin/sh -c "%{nsusr}" -g %{nsgrp} %{nsusr} || \
70
%nnmmsg Unexpected error adding user "%{nsusr}". Aborting install process.
73
# if LSB standard /etc/init.d does not exist,
74
# create it as a symlink to the first match we find
75
if [ -d /etc/init.d -o -L /etc/init.d ]; then
77
elif [ -d /etc/rc.d/init.d ]; then
78
ln -s /etc/rc.d/init.d /etc/init.d
79
elif [ -d /usr/local/etc/rc.d ]; then
80
ln -s /usr/local/etc/rc.d /etc/init.d
81
elif [ -d /sbin/init.d ]; then
82
ln -s /sbin/init.d /etc/init.d
88
/sbin/service nrpe stop > /dev/null 2>&1
89
/sbin/chkconfig --del nrpe
93
if [ "$1" -ge "1" ]; then
94
/sbin/service nrpe condrestart >/dev/null 2>&1 || :
98
export PATH=$PATH:/usr/sbin
99
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
101
--with-init-dir=/etc/init.d \
102
--with-nrpe-port=%{nsport} \
103
--with-nrpe-user=%{nsusr} \
104
--with-nrpe-group=%{nsgrp} \
105
--prefix=%{_prefix} \
106
--exec-prefix=%{_prefix}/sbin \
107
--bindir=%{_prefix}/sbin \
108
--sbindir=%{_prefix}/lib/nagios/cgi \
109
--libexecdir=%{_prefix}/lib/nagios/plugins \
110
--datadir=%{_prefix}/share/nagios \
111
--sysconfdir=/etc/nagios \
112
--localstatedir=/var/log/nagios \
113
--enable-command-args
118
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
119
install -d -m 0755 ${RPM_BUILD_ROOT}/etc/init.d
120
install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios
121
install -d -m 0755 ${RPM_BUILD_ROOT}/usr/sbin
122
install -d -m 0755 ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins
124
# install templated configuration files
125
cp sample-config/nrpe.cfg ${RPM_BUILD_ROOT}/etc/nagios/nrpe.cfg
126
cp init-script ${RPM_BUILD_ROOT}/etc/init.d/nrpe
127
cp src/nrpe ${RPM_BUILD_ROOT}/usr/sbin
128
cp src/check_nrpe ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins
131
rm -rf $RPM_BUILD_ROOT
135
%defattr(755,root,root)
139
%defattr(644,root,root)
140
%config(noreplace) /etc/nagios/*.cfg
141
%defattr(755,%{nsusr},%{nsgrp})
142
%doc Changelog LEGAL README
145
%defattr(755,root,root)
146
%{_prefix}/lib/nagios/plugins
147
%defattr(755,%{nsusr},%{nsgrp})
148
%doc Changelog LEGAL README
151
* Mon Jan 23 2006 Andreas Kasenides ank<@>cs.ucy.ac.cy
152
- fixed nrpe.cfg relocation to sample-config
153
- replaced Copyright label with License
154
- added --enable-command-args to enable remote arg passing (if desired can be disabled by commenting out)
156
* Wed Nov 12 2003 Ingimar Robertsson <iar@skyrr.is>
157
- Added adding of nagios group if it does not exist.
159
* Tue Jan 07 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
160
- Removed the lines which removed the nagios user and group from the system
161
- changed the patch release version from 3 to 1
163
* Mon Jan 06 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
164
- Removed patch files required for nrpe 1.5
165
- Update spec file for version 1.6 (1.6-1)
167
* Sat Dec 28 2002 James 'Showkilr' Peterson <showkilr@showkilr.com>
168
- First RPM build (1.5-1)