Hi,

Has anyone written a sensor to monitor the expiry of a domain?

Eg: paessler.com Expires 09/09/2012

If not something to put on my to do list.

Cheers Pete


Article Comments

PTF.TLDomainExpiration

This can be done with custom sensor PTF.TLDomainExpiration. The sensor returns the number of days before a .com, .net, .org, .info, .us or .biz domain registration expires.

The following parameters can be used:

-d=    The domain name to monitor.

The sensor can be downloaded from this page.

Regards,


Jul, 2012 - Permalink

It appears this tool is not reporting the proper expiration date. For example, a domain expiring in 741 days it reported it expired -721 days ago.


Jul, 2012 - Permalink

I am also having the same issue, works for some but not others. This would be a really useful sensor.


May, 2013 - Permalink

Can you give one ore more examples of domains that are not working?

If you do not want to publish those names here, you can contact me at http://www.prtgtoolsfamily.com?page=contact


May, 2013 - Permalink

I sent you an Email with some that do and don't work. Thank you.


May, 2013 - Permalink

Version 13.2.2.6 of the sensor is now available for download.

This verson includes better handling for falsely reported negative values and "No expiration date found" errors.

The sensor can be downloaded from http://www.prtgtoolsfamily.com?page=downloads (Custom Sensors section)


May, 2013 - Permalink

You can check the expiry of a domain with the help of Whois search from http://www.whoisxy.com/ where you can check the date created and when it is going to expiry and also the last updated date....


Aug, 2013 - Permalink

Hi, great custom sensor that works well... however, I have checked the http://www.who.is site as recommended in the ReadMe and it appears it is now able to perform look-ups on .co.uk domain names though the sensor seems to be hard-coded to return the fact that it can only look up TLD's.

Can .co.uk's now also be allowed?

Kind regards,

James


Aug, 2015 - Permalink

Hi,

Please send an email to support@prtgtoolsfamily.com with a few examples of domain names that you would like to monitor.


Aug, 2015 - Permalink

Many thanks, I have done so.

Regards,

James


Aug, 2015 - Permalink

Wow, what fantastic service! Thank you very much to 'PRTGToolsFamily' for updating your sensor to now include .co.uk's ... and so quickly too. :-)

I have tried to 'upvote' you but apparently I'm not reputable enough. :-( If there's anything else I can do in this regard, please let me know.

Regards,

James


Aug, 2015 - Permalink

This 3rd party sensor still doesn't quite work right. I'm getting a negative number for a domain which expires in four years.

PS C:\Temp\PTF.TLDomainExpiration> .\TLDomainExpiration.exe -d=somedomain.net -nocheck 16.1.1.18 Requesting data ...... .Found negative value, trying again. Requesting data ...... .-38:The domain registration expires in -38 days.

Very disappointing that PRTG doesn't have a native sensor to handle domain expiration. This is a very easy task in Nagios.


Feb, 2016 - Permalink

This sensor still appears to have issues and the issues are inconsistent. Earlier today, when trying this sensor from the command line, I would receive a negative value on a domain which I know expires next February. Now, I'm getting "no expiration date found", regardless of what domain I use. Example below.

PS C:\temp\Domain Expiry> .\TLDomainExpiration.exe -d=google.com -nocheck 16.1.2.19 Requesting data ... No expiration date found, trying again. Requesting data ... No expiration date found, please visit http://www.who.is and enter your domain name once.

Press any key to continue


Apr, 2016 - Permalink

Hi Joshford,

There seems to be nothing wrong with checking google.com at this moment.

Please keep in mind that you should not use a 60sec interval for this sensor.
Checking once a day at a 24h interval should be sufficient for this sensor type.

A 60sec interval might generate too much traffic for who.is as a result of which your IP can get temporarily blocked, explaining the inconsistent issues.


Apr, 2016 - Permalink
  1. Try a custom PS sensor should work for any domain if you know the whois server url
  1. example .\GetDaysLeft.ps1 rg.bm "Registrar Registration Expiration Date: " whois.asaplatform.info
  2. example .\GetDaysLeft.ps1 google.com "Registrar Registration Expiration Date: "
  3. example .\GetDaysLeft.ps1 bbc.co.uk " Expiry date:"
  1. whois.exe from micrsoft must be in specified in script
Param(
  [Parameter(Mandatory=$true)]
  [string]$domain,
  [Parameter(Mandatory=$true)]
  [string]$expirationtextsearch,
  [string]$whoisserveroveride
)

$Command = "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\whois.exe"
$Parms = "/accepteula $domain $whoisserveroveride"
$Prms = $Parms.Split(" ")
$whoisoutput = (& "$Command" $Prms) 

$expirationresult = $whoisoutput | % { if($_ -match $expirationtextsearch) {$_}}

$datestring = $expirationresult.Substring($expirationtextsearch.Length)

$expiredate = Get-Date $datestring
$daystoexpire = ($expiredate - (Get-Date)).Days


$x=[string]$daystoexpire+":The domain registration expires in "+$daystoexpire+" days."
write-host $x

exit 0

Dec, 2016 - Permalink

I've added the script to github as well https://github.com/hwsknudsen/PSWhoisGetDaysLeft/


Dec, 2016 - Permalink

Well this powershellscript aint working, every domain ill try is:

"-738270:The domain registration expires in -738270 days. This is invalid as it is negative"

So whats wrong? And the original from PRTG Tools Family dont do any other domains :(


Apr, 2022 - Permalink

modified the script a little bit to handle different search string patterns https://github.com/kkuderko/powershell/blob/main/DomainExpiry.ps1


Nov, 2022 - Permalink