Page 1 of 1

Domain Expiration wizard question

Posted: Wed Jun 11, 2014 1:20 pm
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);
    }
 

Re: Domain Expiration wizard question

Posted: Wed Jun 11, 2014 1:44 pm
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)"

Re: Domain Expiration wizard question

Posted: Wed Jun 11, 2014 1:56 pm
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.

Re: Domain Expiration wizard question

Posted: Thu Jun 12, 2014 11:23 am
by lmiltchev
We will be fixing this as soon as we can. Thanks for the feedback!

Re: Domain Expiration wizard question

Posted: Thu Jun 12, 2014 12:25 pm
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