]>
Commit | Line | Data |
---|---|---|
70f45f39 ER |
1 | %define plugin check_file_exists |
2 | Summary: Monitoring plugin to check if a file exists or not | |
3 | Name: monitoring-plugin-%{plugin} | |
58e4a0d4 ER |
4 | Version: 1.1 |
5 | Release: 1 | |
70f45f39 ER |
6 | License: GPL |
7 | Group: Networking | |
e3cafd69 | 8 | Source0: %{plugin}.sh |
70f45f39 ER |
9 | Source1: %{plugin}.cfg |
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 | |
c733ee75 | 14 | Conflicts: nagios-nrpe < 2.15-5 |
70f45f39 ER |
15 | BuildArch: noarch |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
17 | ||
18 | %define _sysconfdir /etc/nagios/plugins | |
19 | %define nrpeddir /etc/nagios/nrpe.d | |
20 | %define plugindir %{_prefix}/lib/nagios/plugins | |
21 | ||
22 | %description | |
23 | Monitoring plugin to check if a file exists or not. | |
24 | ||
25 | %prep | |
26 | %setup -qcT | |
27 | cp -p %{SOURCE0} %{plugin} | |
28 | ||
29 | %install | |
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 | |
c733ee75 | 34 | touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg |
70f45f39 ER |
35 | |
36 | %clean | |
37 | rm -rf $RPM_BUILD_ROOT | |
38 | ||
c733ee75 ER |
39 | %triggerin -- nagios-nrpe |
40 | %nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg | |
41 | ||
42 | %triggerun -- nagios-nrpe | |
43 | %nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg | |
44 | ||
70f45f39 ER |
45 | %files |
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} | |
c733ee75 | 49 | %ghost %{nrpeddir}/%{plugin}.cfg |