]> git.pld-linux.org Git - packages/monitoring-plugin-check_file_exists.git/blob - monitoring-plugin-check_file_exists.spec
v1.1: add negate (-n) support
[packages/monitoring-plugin-check_file_exists.git] / monitoring-plugin-check_file_exists.spec
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.1
5 Release:        1
6 License:        GPL
7 Group:          Networking
8 Source0:        %{plugin}.sh
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 Conflicts:      nagios-nrpe < 2.15-5
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
34 touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
35
36 %clean
37 rm -rf $RPM_BUILD_ROOT
38
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
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}
49 %ghost %{nrpeddir}/%{plugin}.cfg
This page took 0.069008 seconds and 3 git commands to generate.