commit e3cafd69b65da338e8154eefbd6549cf04c88fd2
Author: Elan Ruusamäe <[email protected]>
Date:   Mon Feb 1 10:42:16 2016 +0200

    keep the source here
    
    very trivial file and creating patches for changes creates more noise
    than it's worth

 check_file_exists.sh                     | 27 +++++++++++++++++++++++++++
 monitoring-plugin-check_file_exists.spec |  3 +--
 2 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/monitoring-plugin-check_file_exists.spec 
b/monitoring-plugin-check_file_exists.spec
index 4c1ce14..d0ac04d 100644
--- a/monitoring-plugin-check_file_exists.spec
+++ b/monitoring-plugin-check_file_exists.spec
@@ -5,8 +5,7 @@ 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
+Source0:       %{plugin}.sh
 Source1:       %{plugin}.cfg
 URL:           
https://exchange.nagios.org/directory/Plugins/System-Metrics/File-System/check_file_exists/details
 BuildRequires: rpmbuild(macros) >= 1.654
diff --git a/check_file_exists.sh b/check_file_exists.sh
new file mode 100755
index 0000000..bc91daf
--- /dev/null
+++ b/check_file_exists.sh
@@ -0,0 +1,27 @@
+#! /bin/bash
+#
+# Author : Diego Martin Gardella [[email protected]]
+# Desc : Plugin to verify if a file exists
+#
+#
+
+PROGNAME=`basename $0`
+PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
+
+. $PROGPATH/utils.sh
+
+if [ "$1" = "" ]
+then
+       echo -e " Use : $PROGNAME <file_name> -- Ex : $PROGNAME /etc/hosts \n "
+       exit $STATE_UNKNOWN
+fi
+
+
+if [ -f $1 ]
+then
+       echo "OK - $1 : EXISTS :: `head -3 $1`" # shows the first three lines 
of the file
+       exit $STATE_OK
+else
+       echo "CRITICAL : $1 Does NOT exists "
+       exit $STATE_CRITICAL
+fi
================================================================

---- gitweb:

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to