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