1 %define plugin check_file_exists
2 Summary: Monitoring plugin to check if a file exists or not
3 Name: monitoring-plugin-%{plugin}
10 URL: https://exchange.nagios.org/directory/Plugins/System-Metrics/File-System/check_file_exists/details
11 BuildRequires: rpmbuild(macros) >= 1.654
12 Requires: nagios-common
13 Requires: nagios-plugins-libs
14 Conflicts: nagios-nrpe < 2.15-5
16 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18 %define _sysconfdir /etc/nagios/plugins
19 %define nrpeddir /etc/nagios/nrpe.d
20 %define plugindir %{_prefix}/lib/nagios/plugins
23 Monitoring plugin to check if a file exists or not.
27 cp -p %{SOURCE0} %{plugin}
30 rm -rf $RPM_BUILD_ROOT
31 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}}
32 install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
33 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
34 touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
37 rm -rf $RPM_BUILD_ROOT
39 %triggerin -- nagios-nrpe
40 %nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
42 %triggerun -- nagios-nrpe
43 %nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
46 %defattr(644,root,root,755)
47 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
48 %attr(755,root,root) %{plugindir}/%{plugin}
49 %ghost %{nrpeddir}/%{plugin}.cfg