Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_domain
1.4.5
2015-11-15
- Nagios 1.x
- Nagios 2.x
- Nagios 3.x
- Nagios 4.x
- Nagios XI
- Nagios Fusion
GPL
148050
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
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.
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)
bySivich, April 23, 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.
I'm trying to test the domain test, but get an error:
./check_domain.sh -d vk.com
UNKNOWN - WHOIS exited with error 1.
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?
Could you help me?
byKolos, March 5, 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) }
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) }
byLostBoy, May 10, 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
./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
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.
As of last month, when doing any lookups from godaddy it seems that they no longer provide expiration dates in their whois report.
Does anyone have any idea on how to get .md domains to show up?
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
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:"
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.
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.
bygary.turner, October 29, 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}'`
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)
*.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)
*.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.
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?
byrooneybuk, July 12, 2011
excellent script, im just a little confused it seems to alert warning or critical if the value is high instead of lower>
bysvindler, May 30, 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`
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`
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}'`
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}'`
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.
expiration=`whois $domain |egrep "Expiration Date:|Renewal date:"| awk '{print $3}'`
it works for UK domains too.