From 7ac20968f1bf5c4dd1e79c222ccd2a49808d499f Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 26 Apr 2014 12:13:11 +0200 Subject: [PATCH] dsa-check-cert-expire: Make timers configurable (#744248) --- .../checks/dsa-check-cert-expire | 25 +++++++++++++++++-- dsa-nagios-checks/debian/changelog | 5 +++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dsa-nagios-checks/checks/dsa-check-cert-expire b/dsa-nagios-checks/checks/dsa-check-cert-expire index 89a119a..98a04a2 100755 --- a/dsa-nagios-checks/checks/dsa-check-cert-expire +++ b/dsa-nagios-checks/checks/dsa-check-cert-expire @@ -30,9 +30,30 @@ set -e warn=1209600 crit=86400 -if [ "$#" != 1 ]; then - echo "Usage: $0 " >&2 +usage() { + echo "Usage: $0 [-w seconds] [-c seconds] " >&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" diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index 7b62397..e0c257c 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -5,13 +5,16 @@ dsa-nagios-checks (100) UNRELEASED; urgency=low * dsa-check-zone-rrsig-expiration-many: Initialize exit properly, in case it does not get set later. + [ Helmut Grohne ] + * dsa-check-cert-expire: Make timers configurable. + [ George Kargiotakis ] * dsa-check-hpacucli: Add Parity check for logical drives. [ Stephen Gran ] * dsa-check-mq-connection: Catch case when host has never connected - -- Peter Palfrader Fri, 04 Apr 2014 18:55:33 +0200 + -- Peter Palfrader Sat, 26 Apr 2014 12:10:21 +0200 dsa-nagios-checks (99) unstable; urgency=low -- 2.20.1