new, version 1.0
authorElan Ruusamäe <glen@delfi.ee>
Mon, 1 Feb 2016 08:40:35 +0000 (10:40 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 1 Feb 2016 08:41:37 +0000 (10:41 +0200)
check_file_exists.cfg [new file with mode: 0644]
monitoring-plugin-check_file_exists.spec [new file with mode: 0644]

diff --git a/check_file_exists.cfg b/check_file_exists.cfg
new file mode 100644 (file)
index 0000000..6d1a913
--- /dev/null
@@ -0,0 +1,20 @@
+# Usage:
+# check_file_exists!/path/to/file
+define command {
+       command_name    check_file_exists
+       command_line    /usr/lib/nagios/plugins/check_file_exists $ARG1$
+}
+
+define service {
+       use                     generic-service
+       name                    file_exists
+       service_description     file_exists
+       register                0
+
+       normal_check_interval   5
+       retry_check_interval    1
+
+       notification_interval   10
+
+       check_command           check_file_exists
+}
diff --git a/monitoring-plugin-check_file_exists.spec b/monitoring-plugin-check_file_exists.spec
new file mode 100644 (file)
index 0000000..4c1ce14
--- /dev/null
@@ -0,0 +1,41 @@
+%define                plugin  check_file_exists
+Summary:       Monitoring plugin to check if a file exists or not
+Name:          monitoring-plugin-%{plugin}
+Version:       1.0
+Release:       1
+License:       GPL
+Group:         Networking
+Source0:       https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=2330&cf_id=24&/%{plugin}.sh
+# Source0-md5: 388097c05f6e58f4eeaca2cdf132331e
+Source1:       %{plugin}.cfg
+URL:           https://exchange.nagios.org/directory/Plugins/System-Metrics/File-System/check_file_exists/details
+BuildRequires: rpmbuild(macros) >= 1.654
+Requires:      nagios-common
+Requires:      nagios-plugins-libs
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                _sysconfdir     /etc/nagios/plugins
+%define                nrpeddir        /etc/nagios/nrpe.d
+%define                plugindir       %{_prefix}/lib/nagios/plugins
+
+%description
+Monitoring plugin to check if a file exists or not.
+
+%prep
+%setup -qcT
+cp -p %{SOURCE0} %{plugin}
+
+%install
+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
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%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}
This page took 0.12436 seconds and 4 git commands to generate.