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