sensu-plugins / sensu-plugins-network-checks

This plugin provides native network instrumentation for monitoring and metrics collection, including: hardware, TCP response, RBLs, whois, port status, and more.
http://sensu-plugins.io
MIT License
30 stars 76 forks source link

check-whois-domain-expiration - "invalid date" (still) #73

Closed plainlystated closed 6 years ago

plainlystated commented 6 years ago

I know this was addressed in #59, and I agree it works for the example of "google.com", but for other sites it's still failing. I am on:

Works:

$ GEM_PATH=/opt/sensu/embedded/lib/ruby/gems/2.3.0 /opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/check-whois-domain-expiration.rb -d google.com
WhoisDomainExpirationCheck OK: google.com expires on 09-13-2020 (929 days away)

Fails with different domain:

$ GEM_PATH=/opt/sensu/embedded/lib/ruby/gems/2.3.0 /opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/check-whois-domain-expiration.rb -d plainlystated.com
WhoisDomainExpirationCheck UNKNOWN: plainlystated.com can't be checked

(beneath the rescue, it's "invalid date")

This domain is my personal blog, but I get the same errors with domains related to my work.

amdprophet commented 6 years ago

Hi @plainlystated,

Thank you for reporting this. I'm going to see if I can replicate this issue.

amdprophet commented 6 years ago

I've replicated the issue and it appears to be due to the version of whois-parser in use by this plugin. Although you have whois-parser-1.0.1 installed, the plugin is using whois-parser-1.0.0. I'll open a pull request to bump the version of whois-parser which appears to fix the issue you are seeing with your domain.

plainlystated commented 6 years ago

Perfect, thanks @amdprophet !

majormoses commented 6 years ago

This is fixed in: https://rubygems.org/gems/sensu-plugins-network-checks/versions/2.3.1