Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_domain

Rating
25 votes
Favoured:
5
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
Owner
License
GPL
Hits
146667
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This plugin checks the expiration date of a domain name.
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)
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.
bykaioccarvalho, April 26, 2017
1 of 1 people found this review helpful
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?
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) }
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
bywasserja, March 3, 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.
byhprins, October 13, 2014
0 of 1 people found this review helpful
As of last month, when doing any lookups from godaddy it seems that they no longer provide expiration dates in their whois report.
byjwehnerhf, October 8, 2013
Does anyone have any idea on how to get .md domains to show up?
bynishith, October 4, 2013
2 of 2 people found this review helpful
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
byRFD, August 1, 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

byKirk, February 15, 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.
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}'`
byelyrith, October 26, 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/%s\n", 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)
bynaum, September 1, 2011
1 of 1 people found this review helpful
*.ca)
expiration=$(echo "$out" | awk '/Expiry date:/{split($3, a, "/"); printf("%s/%s/%s\n", a[3], a[2], a[1])}')
;;

Add this into script and .ca will work fine.
byvihag, August 14, 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?
excellent script, im just a little confused it seems to alert warning or critical if the value is high instead of lower>
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`
byLeo Tao, April 25, 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}'`
byrob.turner, March 24, 2011
0 of 2 people found this review helpful
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.