Added suport for .cloud

This commit is contained in:
Jack-Benny Persson 2024-04-26 15:14:51 +02:00
parent 62de166ad2
commit 61ce5c8246
2 changed files with 7 additions and 2 deletions

View File

@ -23,7 +23,7 @@
# https://github.com/Elyrith/check_domain #
###############################################################################
# VERSION: Version 1.1
# VERSION: Version 1.2.2
# AUTHOR: See README. This version updated by Ryan Loudfoot (ryan@delotha.com)
PROGRAM=$(whereis -b -B /{bin,sbin,usr,etc} /{bin,sbin,usr,etc}/* -f whois | awk '{print $2}')
@ -148,9 +148,12 @@ case "$domain" in
*.se)
expiration=$(echo "$out" | awk '/expires:/{split($2, a, "-"); printf("%s-%s-%s\n", a[1], a[2], a[3])}')
;;
*.cloud)
expiration=$(echo "$out" | awk '/Registry Expiry Date: /{split($4, a, "-"); printf("%d-%02d-%02d\n", a[1], a[2], a[3])}')
;;
*.net)
expiration=$(echo "$out" | awk '/Registry Expiry Date: /{split($4, a, "-"); printf("%d-%02d-%02d\n", a[1], a[2], a[3])}')
;;
;;
*.org)
expiration=$(echo "$out" | awk -F: '/ Expiry Date:/{print substr($0, length($1) + 3, 10)}')
;;

2
readme
View File

@ -1,3 +1,5 @@
UPDATE 2024-04-26: Added support for .cloud (same as .net). Bumped version 1.2.2. /Jack-Benny Persson.
UPDATE 2017-09-07: Updated .net and .com since they changed the whois format / Jack-Benny Persson.
UPDATE 2015-03-27: I've found the original plugin (still maintained by Elan) on GitHub at https://github.com/glensc/nagios-plugin-check_domain. It has improved much more than this one so I've contributed the minor additions from this repo upstream and am going to switch to that version.