Domain Expiration wizard question
Posted: Wed Jun 11, 2014 1:20 pm
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:
fixed?:
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);
}
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);
}