Internet Domains and WHOIS

check_domain

Description:

This plugin checks the expiration date of a domain name.

Current Version

1.4.5

Last Release Date

2015-11-15

Compatible With

  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
  • Nagios Fusion

License

GPL


Project Notes
This plugin will use whois service to get the expiration date for the domain name. Visit Plugin's website for latest version or plugin or sample .cfg or just history: https://github.com/glensc/monitoring-plugin-check_domain/releases NOTE: Report bugs to isssue tracker, https://github.com/glensc/monitoring-plugin-check_domain/issues THE OWNER IS NOT READING COMMENTS OR FEEDBACK HERE.
Reviews (18) Add a Review
Error when I try to check the * .com domain
by Sivich, April 30, 2018
I have the same problem
I'm trying to test the domain test, but get an error:
./check_domain.sh -d vk.com
UNKNOWN - WHOIS exited with error 1.
Helpful? Yes  No 
Error when running whois
by kaioccarvalho, April 30, 2017
When I try to run ./check_domain.php -d the message "Error running whois" appears. It seems occur for all domains in godaddy.com.

Could you help me?
1 of 1 found this review helpful.
Helpful? Yes 1 No 0
update for ru and xn--p1ai domains
by Kolos, March 31, 2017
now date format for ".ru" and cyrillic ".xn--p1ai" domains is ISO
so you should change

this string
/paid-till:/ && $NF ~ DATE_YYYY_MM_DD_DOT {split($2, a, "."); printf("%s-%s-%s", a[1], a[2], a[3]); exit}

to this one
/paid-till:/ && DATE_ISO_FULL { get_iso_date($0, ":", 2) }
Helpful? Yes  No 
Like this but need .co.nz?
by LostBoy, May 31, 2015
This worked a treat but it doesn't seem to work for our .co.nz domains (Which is an issue since I live here with most of my clients).

./check_domain -d stuff.co.nz
UNKNOWN - Unable to figure out expiration date for stuff.co.nz Domain.

Any ideas on how I can update this script to work for .co.nz domains?

I tried a bunch of .co.nz's and none of them seem to work.

Cheers
Helpful? Yes  No 
Thanks
by wasserja, March 31, 2015
Thanks for this plugin. I started using it today, but found that you can get blocked by network solutions very quickly. Make sure you only check your domains infrequently so as to not violate their policy.
Helpful? Yes  No 
Godaddy did it again.
by hprins, October 31, 2014
As of last month, when doing any lookups from godaddy it seems that they no longer provide expiration dates in their whois report.
0 of 1 found this review helpful.
Helpful? Yes  No 1
md domain
by jwehnerhf, October 31, 2013
Does anyone have any idea on how to get .md domains to show up?
Helpful? Yes  No 
Very Easy & Effective Tool
by nishith, October 31, 2013
Worked perfectly. Just download it & make following changes in Nagios configuration.

In /usr/local/nagios/etc/objects/commands.cfg

define command {
command_name check_abc.com
command_line $USER1$/check_domain -d $ARG1$ -w $ARG2$ -c $ARG3$
}
####################################
In /usr/local/nagios/etc/objects/localhost.cfg

define service{
use generic-service ; Inherit values from a template
host_name localhost
service_description Domain Expiry of abc.com

check_command check_abc.com!abc.com!30!10

Here, 30 = Warning of 30 days remaining
10 = Critical message of 10 days remaining

Nishith N.Vyas
2 of 2 found this review helpful.
Helpful? Yes 2 No 0
Godaddy messed this up
by RFD, August 31, 2013
I have been using the script for about 4 years without issues. Just a few hours ago, I started getting critical alerts saying that my domains had expired, but the dates were in the future.
It appears GoDaddy changed the information that they were returning through the whois database today, and the grep command on line 60 started returning two lines of data which messed up the script. I was able to simply add two spaces to the grep portion of line 60. Which then made the grep command only return the proper line.
grep " Expiration Date:"
Owner's Reply:

could you inform what was the sample domain for this to be able to fix plugin


Helpful? Yes  No 
CentOS 6.3 change to who is
by Kirk, February 28, 2013
To get this to work on CentOS I had to modify line 60 to this:

expiration=`whois communitect.com |grep "Expires"| awk -F":" '{print $2}'|cut -f 1`

The who is "Expires on" string varied from what the program is looking for.
Helpful? Yes  No 
Edit to work with multiple TLD
by gary.turner, October 31, 2012
Edit to line 60 so it works with uk.com, .ie and most others too

expiration=`whois $domain |egrep "renewal:|Expiration Date:|Renewal date:|Expiry date:" | head -n 1 | sed 's/^[^:]*://' | awk '{print $1}'`
Helpful? Yes  No 
naum's .ca addon fix
by elyrith, October 31, 2012
Excellent plugin. The array order in naum's addon for .ca domains is wrong, though:

*.ca)
expiration=$(echo "$out" | awk '/Expiry date:/{split($3, a, "/"); printf("%s/%s/%sn", a[2], a[3], a[1])}')
;;

(Also, this is version 1.01. I got 1.2.1 from http://git.pld-linux.org/gitweb.cgi/?p=packages/nagios-plugin-check_domain.git;a=summary)
Helpful? Yes  No 
.ca works
by naum, September 30, 2011
*.ca)
expiration=$(echo "$out" | awk '/Expiry date:/{split($3, a, "/"); printf("%s/%s/%sn", a[3], a[2], a[1])}')
;;

Add this into script and .ca will work fine.
1 of 1 found this review helpful.
Helpful? Yes 1 No 0
Works Great
by vihag, August 31, 2011
It works great, but it doesn't seem to work with .ca domains, even though a regular whois lookup will. Does anyone know how I can get this to monitor .ca domains?
Helpful? Yes  No 
integra wrong way round
by rooneybuk, July 31, 2011
excellent script, im just a little confused it seems to alert warning or critical if the value is high instead of lower>
Helpful? Yes  No 
Great idea to build on
by svindler, May 31, 2011
This line allows for even more domains:
expiration=`whois $domain |egrep -i "((Expir)|(Renew)).*20[0-9][0-9]"|sed -e 's/s/n/g'|grep "20[0-9][0-9]"|tail -1`
Helpful? Yes  No 
FYI
by Leo Tao, April 30, 2011
A little changes I did to fit for more whois result:
expiration=`whois $domain |grep -i "Expir.*20[0-9][0-9]"|sed -e 's/s/n/g'|grep "20[0-9][0-9]"`
> # date format dd-mm-yyyy (UK format) transmition
> ukdate=`echo $expiration | grep "[0-3][0-9]-[0-1][0-9]-20[0-9][0-9]$"`
> [ -n "$ukdate" ] && expiration=`echo $ukdate|awk -F"-" '{print $3"-"$2"-"$1}'`
Helpful? Yes  No 
patch for nominet domains
by rob.turner, March 31, 2011
Works well, great thing to check and if you change line 60 to:
expiration=`whois $domain |egrep "Expiration Date:|Renewal date:"| awk '{print $3}'`

it works for UK domains too.
0 of 2 found this review helpful.
Helpful? Yes  No 2
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.2 (25)
Favorites
5
Views
148,020