[packages/nagios-plugin-check_domain] print domain name what was checked in results

glen glen at pld-linux.org
Fri Mar 8 10:56:09 CET 2013


commit 22a178151f24fca97fbc0d5d7ffeff11069fe0f5
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Mar 8 11:44:00 2013 +0200

    print domain name what was checked in results

 check_domain | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/check_domain b/check_domain
index acbf90a..4b9deb5 100755
--- a/check_domain
+++ b/check_domain
@@ -123,7 +123,7 @@ case "$domain" in
 	;;
 esac
 
-[ -z "$expiration" ] && die $STATE_UNKNOWN "UNKNOWN - Domain doesn't exist or no WHOIS server available."
+[ -z "$expiration" ] && die $STATE_UNKNOWN "UNKNOWN - Domain $domain doesn't exist or no WHOIS server available."
 
 expseconds=$(date +%s --date="$expiration")
 expdate=$(date +'%Y-%m-%d' --date="$expiration")
@@ -132,10 +132,10 @@ diffseconds=$((expseconds-nowseconds))
 expdays=$((diffseconds/86400))
 
 # Trigger alarms if applicable
-[ $expdays -lt 0 ] && die $STATE_CRITICAL "CRITICAL - Domain expired on $expiration"
-[ $expdays -lt $critical ] && die $STATE_CRITICAL "CRITICAL - Domain will expire in $expdays days ($expdate)."
-[ $expdays -lt $warning ] && die $STATE_WARNING "WARNING - Domain will expire in $expdays days ($expdate)."
+[ $expdays -lt 0 ] && die $STATE_CRITICAL "CRITICAL - Domain $domain expired on $expiration"
+[ $expdays -lt $critical ] && die $STATE_CRITICAL "CRITICAL - Domain $domain will expire in $expdays days ($expdate)."
+[ $expdays -lt $warning ] && die $STATE_WARNING "WARNING - Domain $domain will expire in $expdays days ($expdate)."
 
 # No alarms? Ok, everything is right.
-echo "OK - Domain will expire in $expdays days ($expdate)."
+echo "OK - Domain $domain will expire in $expdays days ($expdate)."
 exit $STATE_OK
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_domain.git/commitdiff/b90816566b56dd69e128c835543567673bce3b46



More information about the pld-cvs-commit mailing list