X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=nagios-nrpe.spec;h=20460adf20c2e887a5b4e13b7104ef0835bdc764;hb=refs%2Fheads%2Fmaster;hp=95621c00d241f6e78b4a1049366a030375f9b7b9;hpb=8cad7fcdb1159a8311d60fd3892a00e455f44e0c;p=packages%2Fnagios-nrpe.git diff --git a/nagios-nrpe.spec b/nagios-nrpe.spec index 95621c0..20460ad 100644 --- a/nagios-nrpe.spec +++ b/nagios-nrpe.spec @@ -1,26 +1,25 @@ Summary: Nagios remote plugin execution service/plugin Summary(pl.UTF-8): Demon i wtyczka zdalnego wywoływania wtyczek Nagios Name: nagios-nrpe -Version: 2.13 -Release: 2 +Version: 4.1.0 +Release: 1 License: GPL v2 Group: Networking -Source0: http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz -# Source0-md5: e5176d9b258123ce9cf5872e33a77c1a +Source0: https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-%{version}/nrpe-%{version}.tar.gz +# Source0-md5: ace32f8d41e9b9138ea5d40b8beed274 Source1: nrpe.init Source2: nrpe-command.cfg Source3: %{name}.tmpfiles +Source4: commands.cfg Patch0: %{name}-config.patch Patch1: nrpe_check_control.patch -URL: http://www.nagios.org/ -BuildRequires: autoconf -BuildRequires: automake +URL: https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details BuildRequires: openssl-devel BuildRequires: openssl-tools -BuildRequires: rpmbuild(macros) >= 1.268 +BuildRequires: rpmbuild(macros) >= 1.647 Requires(post,preun): /sbin/chkconfig -Requires: nagios-common -Requires: rc-scripts +Requires: nagios-common >= 4.3.3-2 +Requires: rc-scripts >= 0.4.1.26 Provides: nagios-core Obsoletes: netsaint-nrpe BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -28,18 +27,13 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _sysconfdir /etc/nagios %define _datadir %{_prefix}/share/%{name} %define _plugindir %{_libdir}/nagios/plugins -%define _libexecdir %{_plugindir} %define _localstatedir %{_var}/log/nagios %define nsport 5666 %description -NRPE is an addon for Nagios that allows you to execute "local" plugins -(like check_disk, check_procs, etc.) on remote hosts. The check_nrpe -plugin is called from Nagios and makes plugin execution requests to -the NRPE daemon running on the remote host (either as a standalone -daemon or as a service under inetd). Supports passing command -arguments to server, as well as native SSL/TLS encryption (anonymous -DH mode). +NPRE (Nagios Remote Plugin Executor) is a system daemon that will +execute various Nagios plugins locally on behalf of a remote +(monitoring) host that uses the check_nrpe plugin. %description -l pl.UTF-8 NRPE to dodatek do Nagiosa pozwalający na wywoływanie "lokalnych" @@ -59,8 +53,10 @@ Provides: %{name}-plugin = %{version}-%{release} Obsoletes: nagios-nrpe-plugin < 2.12-6 %description -n nagios-plugin-check_nrpe -check_nrpe plugin for Nagios. This plugin allows running plugins on -remote machines using nrpe service. +The check_nrpe plugin is called from Nagios and makes plugin execution +requests to the NRPE daemon running on the remote host. Supports +passing command arguments to server, as well as native SSL/TLS +encryption (anonymous DH mode). %description -n nagios-plugin-check_nrpe -l pl.UTF-8 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie wtyczek @@ -79,7 +75,9 @@ na innych komputerach za pomocą demona nrpe. --with-nrpe-port=%{nsport} \ --with-nrpe-user=nagios \ --with-nrpe-group=nagios \ + --with-piddir=/var/run/nrpe \ --enable-ssl \ + --with-ssl-lib=%{_libdir} \ --enable-command-args %{__make} all @@ -90,15 +88,15 @@ na innych komputerach za pomocą demona nrpe. rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_libdir}/nagios/plugins,%{_sbindir}} \ $RPM_BUILD_ROOT{%{_localstatedir},/var/run/nrpe} \ - $RPM_BUILD_ROOT/usr/lib/tmpfiles.d + $RPM_BUILD_ROOT%{systemdtmpfilesdir} cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg +cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.d sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir} install -p src/check_nrpe $RPM_BUILD_ROOT%{_plugindir} - -install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf +cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf %clean rm -rf $RPM_BUILD_ROOT @@ -114,6 +112,27 @@ if [ "$1" = "0" ] ; then fi %triggerpostun -- %{name} < 2.6-1.1 +# < 2.15-5 +# skip *this* trigger on downgrade +[ $1 -le 1 ] && exit 0 + +# ensure there's include_dir directive +if ! grep -q '^include_dir=%{_sysconfdir}/nrpe.d' %{_sysconfdir}/nrpe.cfg; then + echo 'include_dir=%{_sysconfdir}/nrpe.d' >> %{_sysconfdir}/nrpe.cfg +fi + +# check if need to migrate +grep -q '^command\[' %{_sysconfdir}/nrpe.cfg || exit 0 + +# move command definitions to separate file +mv -f %{_sysconfdir}/nrpe.d/commands.cfg{,.rpmnew} +grep '^command\[' %{_sysconfdir}/nrpe.cfg > %{_sysconfdir}/nrpe.d/commands.cfg +cp -f %{_sysconfdir}/nrpe.cfg{,.rpmsave} +sed -i -e '/^command\[/d' %{_sysconfdir}/nrpe.cfg + +%service nrpe restart + +# < 2.6-1.1 %{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg %triggerpostun -n nagios-plugin-check_nrpe -- nagios-plugin-check_nrpe < 2.12-7.1 @@ -125,13 +144,13 @@ fi %files %defattr(644,root,root,755) -%doc Changelog LEGAL README* SECURITY +%doc CHANGELOG.md LEGAL README* SECURITY.md update-cfg.pl %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg -%attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d +%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.d/commands.cfg %attr(755,root,root) %{_sbindir}/nrpe %attr(754,root,root) /etc/rc.d/init.d/nrpe %dir %attr(775,root,nagios) /var/run/nrpe -/usr/lib/tmpfiles.d/%{name}.conf +%{systemdtmpfilesdir}/%{name}.conf %files -n nagios-plugin-check_nrpe %defattr(644,root,root,755)