[packages/monitoring-plugin-check_file_exists] new, version 1.0

glen glen at pld-linux.org
Mon Feb 1 09:41:58 CET 2016


commit 70f45f393a56269bf8e82f2fee23d147d36f416b
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Feb 1 10:40:35 2016 +0200

    new, version 1.0

 check_file_exists.cfg                    | 20 ++++++++++++++++
 monitoring-plugin-check_file_exists.spec | 41 ++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
---
diff --git a/monitoring-plugin-check_file_exists.spec b/monitoring-plugin-check_file_exists.spec
new file mode 100644
index 0000000..4c1ce14
--- /dev/null
+++ b/monitoring-plugin-check_file_exists.spec
@@ -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}
diff --git a/check_file_exists.cfg b/check_file_exists.cfg
new file mode 100644
index 0000000..6d1a913
--- /dev/null
+++ b/check_file_exists.cfg
@@ -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
+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/monitoring-plugin-check_file_exists.git/commitdiff/70f45f393a56269bf8e82f2fee23d147d36f416b



More information about the pld-cvs-commit mailing list