Page 1 of 1
Domain expiration monitoring error
Posted: Sun Sep 06, 2020 2:34 am
by kalyanpabolu
Hello Team,
We are monitoring "Domain Expiration" for almost 250 domains in our Nagios XI. Most of them are monitored properly but, on few domains we are getting below error:
Error running whois:
The service status is Unknown.
Please help us to understand the issue.
Thanks in advance!!
Re: Domain expiration monitoring error
Posted: Tue Sep 08, 2020 3:41 pm
by cdienger
It sounds like it isn't able to parse the whois data. What is the full command that is being run? What kind of output do you get if you run it from the command line?
Re: Domain expiration monitoring error
Posted: Sat Sep 12, 2020 3:17 am
by kalyanpabolu
Hello,
We have used "Domain Expiration" Wizard to monitor our domains.
Below is the output for two domains, one giving the correct output and other having issues.
[root@vmaz-nagiosxi libexec]# /usr/local/nagios/libexec/check_domain.php -d ayunilenses.com -w 60 -c 30
OK - Domain 'ayunilenses.com' will expire in 541 days (2022-03-07T12:29:31Z).
[root@vmaz-nagiosxi libexec]#
[root@vmaz-nagiosxi libexec]# /usr/local/nagios/libexec/check_domain.php -d beautynation.ae -w 60 -c 30
Error running whois: [root@vmaz-nagiosxi libexec]#
Both the domains are using same command.
Re: Domain expiration monitoring error
Posted: Mon Sep 14, 2020 11:39 am
by cdienger
The check parses the result of a whois query to find the expiration date. If you run this from the command line:
no expiration information is provided which is why the check is failing.
Re: Domain expiration monitoring error
Posted: Tue Sep 15, 2020 5:37 am
by kalyanpabolu
Hello,
Thanks for your reply!!
So if not information is there, does it mean the domain has expired?
What is the way to resolve it?
Re: Domain expiration monitoring error
Posted: Tue Sep 15, 2020 3:32 pm
by cdienger
The domain doesn't appear to be expired. To fix it you will need to find some other way of getting the expiration date.
Re: Domain expiration monitoring error
Posted: Wed Sep 16, 2020 12:01 am
by kalyanpabolu
Hello,
Could you please help me to understand the other way please?
Is there any other plugin or wizard to monitor the same?
Re: Domain expiration monitoring error
Posted: Wed Sep 16, 2020 5:14 pm
by cdienger
I wasn't able to find another source of this information. If it is an internal site and you have this information then it should be possible to write a plugin that can check the date. For example:
Code: Select all
#!/bin/bash
source /usr/local/nagios/libexec/utils.sh
current=`date +%s`
diff=`expr $1 - $current`
check_range $diff $2
if [[ $? -eq 0 ]]
then
echo CRITICAL. Difference: $diff. Range: $2
exit 2;
else
echo OK. Difference: $diff. Range: $2
exit 0;
fi
The above script takes two arguements. An expiration date(in epoch time) and a range(as defined in
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT). If the difference between the expiration date and the current time triggers the threshold then it will exit with a CRITICAL message. If it does not trigger the threshold then it will exit with an OK message. For example:
Code: Select all
./check_expiration.sh 1600393866 86400:
./check_expiration.sh 1600393866 259200:
The two commands examine the expiration date 1600393866(Friday). The first checks to see if the expiration is a day away or more(86400:). It is so the check returns OK.
The second checks to see if it 3 days or more away(259200:). It isn't so the check returns CRITICAL.
Configuring XI to use a custom plugin like this is covered in
https://assets.nagios.com/downloads/nag ... ios-XI.pdf.
Re: Domain expiration monitoring error
Posted: Wed Sep 23, 2020 10:59 am
by kalyanpabolu
Hello,
I will check that document.
But, I am unable to understand why we are facing issues with selected domains. We have configured all the domains in the same way. If there is any issue, it should be with all domains, not with just few.
Is there anything specfic we need to check for those domains?
Please suggest!!
Re: Domain expiration monitoring error
Posted: Wed Sep 23, 2020 5:04 pm
by cdienger
Please see my second response where I tell you how to run a whois query. The expiration date is missing so the check does not work. Other domains provide an expiration date which is why they work. This information is not something we control.