2 # - /etc/nagios - owned by nagios and nagios-nrpe. obsolete eachother?
3 # put /etc/nagios to nagios-dirs? (-base?)
4 # - /usr/lib/nagios/plugins - not owned by nagios-nrpe, but it doesn't
5 # require nagios which packages that dir. create nagios-dirs (-base)
10 Summary: Nagios remote plugin execution service/plugin
11 Summary(pl): Demon i wtyczka zdalnego wywo³ywania wtyczek Nagios
17 Source0: http://dl.sourceforge.net/nagios/nrpe-%{version}.tar.gz
18 # Source0-md5: 70ef9502a3b7e49fa520dbceabfa04d0
20 URL: http://www.nagios.org/
21 BuildRequires: autoconf
22 BuildRequires: automake
23 BuildRequires: rpmbuild(macros) >= 1.159
24 BuildRequires: openssl-tools
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /bin/id
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
29 Requires(post,postun): /sbin/chkconfig
30 Requires: nagios-plugins
31 Provides: group(%{nsgrp})
32 Provides: user(%{nsusr})
34 Obsoletes: netsaint-nrpe
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define _sysconfdir /etc/nagios
38 %define _datadir %{_prefix}/share/%{name}
39 %define _plugindir %{_libdir}/nagios/plugins
40 %define _localstatedir %{_var}/log/nagios
44 Nagios nrpe allows you to remotely execute plugins on other hosts
45 and report the plugin output back to the monitoring host.
48 Nagios npre pozwala zdalnie uruchamiaæ wtyczki na innych hostach,
49 a wynik ich dzia³ania zwracaæ z powrotem do hosta monitoruj±cego.
52 Summary: check_nrpe plugin for Nagios
53 Summary(pl): Wtyczka check_nrpe dla Nagiosa
57 check_nrpe plugin for Nagios. This plugin allows running plugins on
58 remote machines using nrpe service.
60 %description plugin -l pl
61 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie
62 wtyczek na innych komputerach za pomoc± demona nrpe.
65 %setup -q -n nrpe-%{version}
72 --with-init-dir=/etc/rc.d/init.d \
73 --with-nrpe-port=%{nsport} \
74 --with-nrpe-user=%{nsusr} \
75 --with-nrpe-grp=%{nsgrp} \
77 --exec-prefix=%{_sbindir} \
78 --bindir=%{_sbindir} \
79 --libexecdir=%{_plugindir} \
80 --datadir=%{_prefix}/share/nagios \
81 --sysconfdir=%{_sysconfdir} \
82 --localstatedir=%{_localstatedir}
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_libdir}/nagios/plugins,%{_sbindir}} \
89 $RPM_BUILD_ROOT%{_localstatedir}
91 install nrpe.cfg $RPM_BUILD_ROOT/etc/nagios/nrpe.cfg
92 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
93 install src/nrpe $RPM_BUILD_ROOT%{_sbindir}
94 install src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
97 rm -rf $RPM_BUILD_ROOT
100 if [ -n "`getgid %{nsgrp}`" ]; then
101 if [ "`getgid %{nsgrp}`" != "72" ]; then
102 echo "Error: group %{nsgrp} doesn't have gid=72. Correct this before installing %{name}." 1>&2
106 if [ -n "`getgid netsaint`" ] && [ "`getgid netsaint`" = "72" ]; then
107 /usr/sbin/groupmod -n %{nsgrp} netsaint
109 /usr/sbin/groupadd -g 72 -f %{nsgrp}
112 if [ -n "`id -u %{nsusr} 2>/dev/null`" ]; then
113 if [ "`id -u %{nsusr}`" != "72" ]; then
114 echo "Error: user %{nsusr} doesn't have uid=72. Correct this before installing %{name}." 1>&2
118 if [ -n "`id -u netsaint 2>/dev/null`" ] && [ "`id -u netsaint`" = "72" ]; then
119 /usr/sbin/usermod -d /tmp -l %{nsusr} netsaint
121 /usr/sbin/useradd -u 72 -d %{_libdir}/%{nsusr} -s /bin/false -c "%{name} User" -g %{nsgrp} %{nsusr} 1>&2
126 /sbin/chkconfig --add nrpe
127 if [ -f /var/lock/subsys/nrpe ]; then
128 /etc/rc.d/init.d/nrpe restart 1>&2
132 if [ "$1" = "0" ] ; then
133 if [ -f /var/lock/subsys/nrpe ]; then
134 /etc/rc.d/init.d/nrpe stop 1>&2
136 /sbin/chkconfig --del nrpe
140 if [ "$1" = "0" ]; then
142 %groupremove %{nsgrp}
146 %defattr(644,root,root,755)
147 %doc Changelog LEGAL README* SECURITY
148 %attr(754,root,root) /etc/rc.d/init.d/nrpe
149 %attr(751,root,%{nsgrp}) %dir %{_sysconfdir}
150 %attr(644,root,%{nsgrp}) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/nrpe.cfg
151 %attr(755,root,root) %{_sbindir}/nrpe
152 %dir %{_libdir}/nagios
155 %defattr(644,root,root,755)
157 %attr(755,root,root) %{_plugindir}/*