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


Remember Me

Directory Tree


Current Version
Last Release Date
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
  • Nagios Fusion
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
A Nagios plugin for checking a domain expiration date by registry name.

The major changes made from the shell version is that registry expiration dates have different date formats and keys. This version accepts a wide variety of Registry formats and is intended to support all TLDs that are supported by whois.

(UPDATE: now can use the -s option to set a whois server)
Nagios Plugin: check_domain

A Nagios plugin for checking a domain expiration date by registry name.

> This plugin relies on [jwhois]( to find the registration
> dates so any TLD that is not supported by whois will not return correctly and will output
> something similar to the following:
> Error running whois:
> Thanks to [glensc]( for his work on [nagios-plugin-check_domain](
> which inspired this php version of his shell plugin.


$./check_domain.php -d
OK - Domain will expire in 248 days (2015-10-04)

Full Usage:

check_domain.php - v1.1.0
Copyright (c) 2014 Luke Groschen, Nagios Enterprises ,
2009-2014 Elan Ruusamäe
Under GPL v2 License

This plugin checks the expiration date of a domain name.

Usage: check_domain.php -h | -d [-c ] [-w ] [-s ]
NOTE: -d must be specified

Print this help and usage message
Domain name to query against
Response time to result in warning status (days)
Response time to result in critical status (days)
Specify a whois server ( by default)

This plugin will use the whois service to get the expiration date for the domain name.
$./check_domain.php -d -w 30 -c 10 nn"
Reviews (2)
Installed it on Opsview Core. So far, most domains I have tried to monitor work great. Then I ran into a bunch that do not. I discovered they are all domains registered through GoDaddy. Any thoughts on how to fix that? I tried changing the whois server to to no avail. Even itself doesn't work.

$ /usr/local/nagios/libexec/check_domain.php -d -w 60 -c 15
CRITICAL - Domain will expire in -16448 days (clientRenewProhibited).

Thanks for all of the great your work you have put into this so far!
Owner's reply

Hello vertices,

Not sure why you're having an issue, but I tried this recently on my CentOS machine from the command line (which has the plugin in Nagios XI):

[root@XIdevr21 libexec]# ./check_domain.php -d -w 60 -c 15
OK - Domain will expire in 2484 days (2021-11-01T11:59:59Z).

Are you using v1.1.0? When I do the same command above, but use '-s' it errors out saying:

Error running whois:

So I guess the default whois server works for godaddy.

bydkan, November 9, 2014
Dear programmer
can you also add support for .gr Greek and .eu European domain.