]> git.pld-linux.org Git - packages/nagios-nrpe.git/blame_incremental - nagios-nrpe.spec
use common pidfile for status and stop
[packages/nagios-nrpe.git] / nagios-nrpe.spec
... / ...
CommitLineData
1Summary: Nagios remote plugin execution service/plugin
2Summary(pl.UTF-8): Demon i wtyczka zdalnego wywoływania wtyczek Nagios
3Name: nagios-nrpe
4Version: 2.15
5Release: 7
6License: GPL v2
7Group: Networking
8Source0: http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
9# Source0-md5: 3921ddc598312983f604541784b35a50
10Source1: nrpe.init
11Source2: nrpe-command.cfg
12Source3: %{name}.tmpfiles
13Source4: commands.cfg
14Patch0: %{name}-config.patch
15Patch1: nrpe_check_control.patch
16Patch2: CVE-2014-2913-nasty-metacharacters.patch
17URL: http://www.nagios.org/
18BuildRequires: openssl-devel
19BuildRequires: openssl-tools
20BuildRequires: rpmbuild(macros) >= 1.647
21Requires(post,preun): /sbin/chkconfig
22Requires: nagios-common
23Requires: rc-scripts >= 0.4.1.26
24Provides: nagios-core
25Obsoletes: netsaint-nrpe
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%define _sysconfdir /etc/nagios
29%define _datadir %{_prefix}/share/%{name}
30%define _plugindir %{_libdir}/nagios/plugins
31%define _libexecdir %{_plugindir}
32%define _localstatedir %{_var}/log/nagios
33%define nsport 5666
34
35%description
36NPRE (Nagios Remote Plugin Executor) is a system daemon that will
37execute various Nagios plugins locally on behalf of a remote
38(monitoring) host that uses the check_nrpe plugin.
39
40%description -l pl.UTF-8
41NRPE to dodatek do Nagiosa pozwalający na wywoływanie "lokalnych"
42wtyczek (takich jak check_disk, check_procs itp.) na zdalnych
43maszynach. Wtyczka check_nrpe jest wywoływana z poziomu Nagiosa i
44wysyła żądania uruchomienia wtyczek do demona NRPE działającego na
45zdalnej maszynie (jako samodzielny demon lub usługa inetd). Obsługuje
46przekazywanie argumentów poleceń do serwera, a także natywne
47szyfrowanie SSL/TLS (w trybie anonimowego DH).
48
49%package -n nagios-plugin-check_nrpe
50Summary: check_nrpe plugin for Nagios
51Summary(pl.UTF-8): Wtyczka check_nrpe dla Nagiosa
52Group: Networking
53Requires: nagios-common
54Provides: %{name}-plugin = %{version}-%{release}
55Obsoletes: nagios-nrpe-plugin < 2.12-6
56
57%description -n nagios-plugin-check_nrpe
58The check_nrpe plugin is called from Nagios and makes plugin execution
59requests to the NRPE daemon running on the remote host. Supports
60passing command arguments to server, as well as native SSL/TLS
61encryption (anonymous DH mode).
62
63%description -n nagios-plugin-check_nrpe -l pl.UTF-8
64Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie wtyczek
65na innych komputerach za pomocą demona nrpe.
66
67%prep
68%setup -q -n nrpe-%{version}
69%undos contrib/nrpe_check_control.c
70%patch0 -p1
71%patch1 -p1
72%patch2 -p1
73
74%build
75%configure \
76 --with-nrpe-port=%{nsport} \
77 --with-nrpe-user=nagios \
78 --with-nrpe-group=nagios \
79 --enable-ssl \
80 --with-ssl-lib=%{_libdir} \
81 --enable-command-args
82
83%{__make} all
84
85%{__cc} %{rpmcppflags} %{rpmcflags} %{rpmldflags} contrib/nrpe_check_control.c -o contrib/nrpe_check_control
86
87%install
88rm -rf $RPM_BUILD_ROOT
89install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_libdir}/nagios/plugins,%{_sbindir}} \
90 $RPM_BUILD_ROOT{%{_localstatedir},/var/run/nrpe} \
91 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
92
93cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg
94cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.d
95sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg
96install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
97install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir}
98install -p src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
99cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
100
101%clean
102rm -rf $RPM_BUILD_ROOT
103
104%post
105/sbin/chkconfig --add nrpe
106%service nrpe restart
107
108%preun
109if [ "$1" = "0" ] ; then
110 %service nrpe stop
111 /sbin/chkconfig --del nrpe
112fi
113
114%triggerpostun -- %{name} < 2.15-5
115# skip *this* trigger on downgrade
116[ $1 -le 1 ] && exit 0
117
118# ensure there's include_dir directive
119if ! grep -q '^include_dir=%{_sysconfdir}/nrpe.d' %{_sysconfdir}/nrpe.cfg; then
120 echo 'include_dir=%{_sysconfdir}/nrpe.d' >> %{_sysconfdir}/nrpe.cfg
121fi
122
123# check if need to migrate
124grep -q '^command\[' %{_sysconfdir}/nrpe.cfg || exit 0
125
126# move command definitions to separate file
127mv -f %{_sysconfdir}/nrpe.d/commands.cfg{,.rpmnew}
128grep '^command\[' %{_sysconfdir}/nrpe.cfg > %{_sysconfdir}/nrpe.d/commands.cfg
129cp -f %{_sysconfdir}/nrpe.cfg{,.rpmsave}
130sed -i -e '/^command\[/d' %{_sysconfdir}/nrpe.cfg
131
132%service nrpe restart
133
134%triggerpostun -- %{name} < 2.6-1.1
135%{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg
136
137%triggerpostun -n nagios-plugin-check_nrpe -- nagios-plugin-check_nrpe < 2.12-7.1
138if [ -f %{_sysconfdir}/plugins/nrpe.cfg.rpmsave ]; then
139 cp -f %{_sysconfdir}/plugins/check_nrpe.cfg{,.rpmnew}
140 mv -f %{_sysconfdir}/plugins/{nrpe.cfg.rpmsave,check_nrpe.cfg}
141 sed -i -e 's,-c \$ARG1\$,$ARG1$,' %{_sysconfdir}/plugins/check_nrpe.cfg
142fi
143
144%files
145%defattr(644,root,root,755)
146%doc Changelog LEGAL README* SECURITY
147%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg
148%attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
149%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.d/commands.cfg
150%attr(755,root,root) %{_sbindir}/nrpe
151%attr(754,root,root) /etc/rc.d/init.d/nrpe
152%dir %attr(775,root,nagios) /var/run/nrpe
153%{systemdtmpfilesdir}/%{name}.conf
154
155%files -n nagios-plugin-check_nrpe
156%defattr(644,root,root,755)
157%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/check_nrpe.cfg
158%attr(755,root,root) %{_plugindir}/check_nrpe
This page took 0.020409 seconds and 4 git commands to generate.