[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 02/11: dsa-check-cert-expire: Make timers configurable
Bernd Zeimetz
bernd at bzed.de
Sun Apr 27 10:05:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
bzed pushed a commit to branch master
in repository pkg-nagios-plugins-contrib.
commit 2049c14dd35ab61965996866e01e1211a77802ee
Author: Evgeni Golov <evgeni.golov at credativ.de>
Date: Sat Apr 26 14:17:44 2014 +0200
dsa-check-cert-expire: Make timers configurable
Closes: #744248
---
dsa/checks/dsa-check-cert-expire | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dsa/checks/dsa-check-cert-expire b/dsa/checks/dsa-check-cert-expire
index 89a119a..98a04a2 100644
--- a/dsa/checks/dsa-check-cert-expire
+++ b/dsa/checks/dsa-check-cert-expire
@@ -30,9 +30,30 @@ set -e
warn=1209600
crit=86400
-if [ "$#" != 1 ]; then
- echo "Usage: $0 <certfile>" >&2
+usage() {
+ echo "Usage: $0 [-w seconds] [-c seconds] <certfile>" >&2
exit 3
+}
+
+
+OPTS=`getopt -o w:c: -n "$0" -- "$@"` || usage
+
+eval set -- "$OPTS"
+
+while :; do
+ case "$1" in
+ -w) warn=$2; shift 2 ;;
+ -c) crit=$2; shift 2 ;;
+ --) shift; break; ;;
+ *) usage ;;
+ esac
+done
+if test "$crit" -gt "$warn"; then
+ warn=$crit
+fi
+
+if [ "$#" != 1 ]; then
+ usage
fi
cert="$1"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins-contrib
More information about the Pkg-nagios-changes
mailing list