From 142d136d11aeff3551ce7e64470a9cbf38e11588 Mon Sep 17 00:00:00 2001 From: Chl Date: Wed, 4 Oct 2023 23:26:55 +0200 Subject: [PATCH] nagios: check_whois handles more TLD .ru, .jp, .it + a fix for handling .fr answers. --- nagios/check_whois | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nagios/check_whois b/nagios/check_whois index 8f08e46..dc6ef2e 100755 --- a/nagios/check_whois +++ b/nagios/check_whois @@ -100,12 +100,18 @@ extract_date_from_whois() { # 2 - coca-cola.com (we try to ignore lines starting with space...) # 3 - facebook.com (...but if there's nothing else, take it anyway) # 4 - some databases with simple display (.se, .si) + # 5 - .it + # 6 - .ru + # 7 - .jp # Add your own filter here :) EXPIRATION_DATE="$( sed -n \ -e 's/^Registry Expiry Date: //p' \ - -e '/^[^[:space:]]/s/.*\(xpiry\|xpiration\) Date: //p' \ - -e 's/.*\(xpiry\|xpiration\) Date: //p' \ + -e '/^[^[:space:]]/s/.*\(xpiry\|xpiration\) Date:[[:space:]]\+//p' \ + -e 's/.*\(xpiry\|xpiration\) Date:[[:space:]]\+//p' \ -e 's/^expires\?:[[:space:]]*//p' \ + -e 's/^Expire Date:[[:space:]]*//p' \ + -e 's/^paid-till:[[:space:]]*//p' \ + -e 's/^\[Expires on\][[:space:]]*//p' \ | sed 'q' )"