Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
This plugin checks the expiration date of a domain name.
Current Version
1.4.5
Last Release Date
2015-11-15
Owner
Elan Ruusamäe
Website
https://github.com/glensc/monitoring-plugin-check_domain
Download URL
https://github.com/glensc/monitoring-plugin-check_domain/raw/master/check_domain.sh
License
GPL
Compatible With
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.
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.
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
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
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:"
could you inform what was the sample domain for this to be able to fix plugin
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}'`
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)
*.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.
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`
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}'`
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.
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!