+

Add README file and improve usage message

Benjamin Renard [2014-12-08 13:03:37]
Add README file and improve usage message
Filename
README
check_lock_file
diff --git a/README b/README
new file mode 100644
index 0000000..87b1e9e
--- /dev/null
+++ b/README
@@ -0,0 +1,43 @@
+Nagios plugin to check lock file state
+======================================
+
+This plugin check lock file statue.
+
+Usage
+-----
+
+  Usage : ./check_lock_file -l /path/to/lock.file [-o uid] [-w W] [-c C] [-d] [-h]
+
+  Check lock file status
+
+  Parameters :
+    -l /path/to/lock.file   Path to lock file
+    -o uid                  Valid lock file owner (optional)
+    -w W                    Exit with WARNING status if lock file
+                            has been created for more than W hours
+    -c C                    Exit with CRITICAL status if lock file
+                            has been created for more than C hours
+    -d                      Enable debug mode
+    -h                      Show this message
+
+Copyright
+---------
+
+Copyright (c) 2014 Benjamin Renard
+
+License
+-------
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License version 2
+as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
diff --git a/check_lock_file b/check_lock_file
index 8eed1dc..784ad15 100755
--- a/check_lock_file
+++ b/check_lock_file
@@ -11,8 +11,11 @@ CRIT=24
 DEBUG=0

 function usage() {
+	echo "Usage : $0 -l /path/to/lock.file [-o uid] [-w W] [-c C] [-d] [-h]"
+	echo
 	echo "Check lock file status"
 	echo
+	echo "Parameters :"
 	echo "  -l /path/to/lock.file   Path to lock file"
 	echo "  -o uid                  Valid lock file owner (optional)"
 	echo "  -w W                    Exit with WARNING status if lock file"
ViewGit