Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a small improvement #21

Open
jarbelix opened this issue May 25, 2023 · 3 comments
Open

a small improvement #21

jarbelix opened this issue May 25, 2023 · 3 comments

Comments

@jarbelix
Copy link

a small improvement

Your ./whois_expire.sh script could be improved to serve full URLs instead of just domain.
For example:

./whois_expire.sh https://one.two.three.quatro.wiki.tiozaodolinux.com
318
./whois_expire.sh http://one.two.three.translate.google.com
1937

will result in a query to the domains tiozaodolinux.com and google.com

Take a look at the code and feel free to use it (if you find it useful).

whois_expire.sh.txt

@fjordlandernz
Copy link

Hi. I am looking at the same issue where I have a number of subdomains of .ac.nz to monitor but both your script above and the original are truncating all FQDNs to ac.nz and therefore failing to get expiry dates. It looks like the subdomain is being stripped in the if statement that looks at the CCTLD/TLD . I'm trying to figure out why that if statement is there as running echo $_domain after the if statement shows the subdomain has been stripped. I've tried hashing out the entire if statement and the subdomain is retained when running the script from CLI against an FQDN but for some reason it still does not seem to be showing up in Zabbix.

@kulpin74
Copy link
Owner

Hi. I am looking at the same issue where I have a number of subdomains of .ac.nz to monitor but both your script above and the original are truncating all FQDNs to ac.nz and therefore failing to get expiry dates. It looks like the subdomain is being stripped in the if statement that looks at the CCTLD/TLD . I'm trying to figure out why that if statement is there as running echo $_domain after the if statement shows the subdomain has been stripped. I've tried hashing out the entire if statement and the subdomain is retained when running the script from CLI against an FQDN but for some reason it still does not seem to be showing up in Zabbix.

whois give you expire date for subdomains of .ac.nz? I think that there are no expire date for 3-rd level domain names in whois...

@fjordlandernz
Copy link

fjordlandernz commented Nov 22, 2023

That makes sense! I suppose that means I am looking at host records and subdomains rather than domain records so will not work. The issue with the ac.nz domain might be that there is no expiry date in whois. It's a government controlled domain.
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants