1
0
Fork 0

nagios: check_whois handles more TLD

.ru, .jp, .it + a fix for handling .fr answers.
This commit is contained in:
Chl 2023-10-04 23:26:55 +02:00
parent a16e070883
commit 142d136d11

View file

@ -100,12 +100,18 @@ extract_date_from_whois() {
# 2 - coca-cola.com (we try to ignore lines starting with space...) # 2 - coca-cola.com (we try to ignore lines starting with space...)
# 3 - facebook.com (...but if there's nothing else, take it anyway) # 3 - facebook.com (...but if there's nothing else, take it anyway)
# 4 - some databases with simple display (.se, .si) # 4 - some databases with simple display (.se, .si)
# 5 - .it
# 6 - .ru
# 7 - .jp
# Add your own filter here :) # Add your own filter here :)
EXPIRATION_DATE="$( sed -n \ EXPIRATION_DATE="$( sed -n \
-e 's/^Registry Expiry Date: //p' \ -e 's/^Registry Expiry Date: //p' \
-e '/^[^[:space:]]/s/.*\(xpiry\|xpiration\) Date: //p' \ -e '/^[^[:space:]]/s/.*\(xpiry\|xpiration\) Date:[[:space:]]\+//p' \
-e 's/.*\(xpiry\|xpiration\) Date: //p' \ -e 's/.*\(xpiry\|xpiration\) Date:[[:space:]]\+//p' \
-e 's/^expires\?:[[: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' | sed 'q'
)" )"