From c733ee75ad230c013804c6f6e90f7118caab17c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 1 Feb 2016 10:48:23 +0200 Subject: [PATCH] add nrpe trigger --- monitoring-plugin-check_file_exists.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/monitoring-plugin-check_file_exists.spec b/monitoring-plugin-check_file_exists.spec index d0ac04d..1811620 100644 --- a/monitoring-plugin-check_file_exists.spec +++ b/monitoring-plugin-check_file_exists.spec @@ -2,7 +2,7 @@ Summary: Monitoring plugin to check if a file exists or not Name: monitoring-plugin-%{plugin} Version: 1.0 -Release: 1 +Release: 2 License: GPL Group: Networking Source0: %{plugin}.sh @@ -11,6 +11,7 @@ URL: https://exchange.nagios.org/directory/Plugins/System-Metrics/File-System/c BuildRequires: rpmbuild(macros) >= 1.654 Requires: nagios-common Requires: nagios-plugins-libs +Conflicts: nagios-nrpe < 2.15-5 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -30,11 +31,19 @@ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}} install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin} cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg +touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg %clean rm -rf $RPM_BUILD_ROOT +%triggerin -- nagios-nrpe +%nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg + +%triggerun -- nagios-nrpe +%nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg + %files %defattr(644,root,root,755) %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg %attr(755,root,root) %{plugindir}/%{plugin} +%ghost %{nrpeddir}/%{plugin}.cfg -- 2.43.0