]>
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} | |
4 | Version: 1.0 | |
5 | Release: 1 | |
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 | |
14 | BuildArch: noarch | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %define _sysconfdir /etc/nagios/plugins | |
18 | %define nrpeddir /etc/nagios/nrpe.d | |
19 | %define plugindir %{_prefix}/lib/nagios/plugins | |
20 | ||
21 | %description | |
22 | Monitoring plugin to check if a file exists or not. | |
23 | ||
24 | %prep | |
25 | %setup -qcT | |
26 | cp -p %{SOURCE0} %{plugin} | |
27 | ||
28 | %install | |
29 | rm -rf $RPM_BUILD_ROOT | |
30 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}} | |
31 | install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin} | |
32 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg | |
33 | ||
34 | %clean | |
35 | rm -rf $RPM_BUILD_ROOT | |
36 | ||
37 | %files | |
38 | %defattr(644,root,root,755) | |
39 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg | |
40 | %attr(755,root,root) %{plugindir}/%{plugin} |