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