Domain expiration monitoring error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Domain expiration monitoring error

Post 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!!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Domain expiration monitoring error

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Domain expiration monitoring error

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Domain expiration monitoring error

Post by cdienger »

The check parses the result of a whois query to find the expiration date. If you run this from the command line:

Code: Select all

whois beautynation.ae
no expiration information is provided which is why the check is failing.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Domain expiration monitoring error

Post 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?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Domain expiration monitoring error

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Domain expiration monitoring error

Post 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?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Domain expiration monitoring error

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Domain expiration monitoring error

Post 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!!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Domain expiration monitoring error

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked