Domain Expiration wizard question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jwelch
Posts: 225
Joined: Wed Sep 05, 2012 12:49 pm

Domain Expiration wizard question

Post by jwelch »

I noticed two new/updated wizards for XI 2014 so I downloaded them.
One was the Domain Expiration wizard. I used it to create a check for my domain and gave parameters warning at 30 days, critical at 10 days.
It immediately went critical and said my domain was due to expire in 49 days.
I may be misunderstanding the parameter settings, but it looks like the check comparisons are inverted:
(note the >= vs <= in the 'if' lines

original:

Code: Select all

    //plugin output
    if ($critical !== null && $expire_days >= $critical) {
        nagios_exit("CRITICAL - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_CRITICAL);
    } elseif ($warning !== null && $expire_days >= $warning) {
        nagios_exit("WARNING - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_WARNING);
    } else {
        nagios_exit("OK - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_OK);
    }
fixed?:

Code: Select all

    //plugin output
    if ($critical !== null && $expire_days <= $critical) {
        nagios_exit("CRITICAL - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_CRITICAL);
    } elseif ($warning !== null && $expire_days <= $warning) {
        nagios_exit("WARNING - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_WARNING);
    } else {
        nagios_exit("OK - Domain ".$domain." will expire in ".$expire_days." days (".$expire_date.").\n\n", STATUS_OK);
    }
 
User avatar
GldRush98
Posts: 259
Joined: Wed May 25, 2011 10:51 am
Location: Springfield, IL
Contact:

Re: Domain Expiration wizard question

Post by GldRush98 »

Yup, confirmed on my end. Added a domain in and I've got a critical warning for it " will expire in 284 days (2015-03-22 14:35:38)"
Prod XI: Debian 12 - Nagios XI 2026R1.2
Dev XI: Debian 12 - Nagios XI 2026R1.2
jwelch
Posts: 225
Joined: Wed Sep 05, 2012 12:49 pm

Re: Domain Expiration wizard question

Post by jwelch »

Cool! You can change the '>' in /usr/local/nagios/libexec/check_domain.php lines 152 and 154 to '<' as a workaround until the wizard is fixed.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Domain Expiration wizard question

Post by lmiltchev »

We will be fixing this as soon as we can. Thanks for the feedback!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Domain Expiration wizard question

Post by lgroschen »

This fix has been implemented. The exchange and github pages for the check_domain.php plugin have been updated as well. Just replace your local check_domain.php with the new one and it should be good to go.

check_domain.php


/Luke
/Luke
Locked