check_ssl_certificate - Handle the case of actually expired certificates
This commit is contained in:
parent
ffe98f702b
commit
55c4a7b3a5
1 changed files with 3 additions and 0 deletions
|
@ -161,6 +161,9 @@ func (program *checkProgram) checkNames() bool {
|
||||||
// thresholds, returning a status code and description based on these
|
// thresholds, returning a status code and description based on these
|
||||||
// values.
|
// values.
|
||||||
func (program *checkProgram) checkCertificateExpiry(tlDays int) (plugin.Status, string) {
|
func (program *checkProgram) checkCertificateExpiry(tlDays int) (plugin.Status, string) {
|
||||||
|
if tlDays <= 0 {
|
||||||
|
return plugin.CRITICAL, "certificate expired"
|
||||||
|
}
|
||||||
var limitStr string
|
var limitStr string
|
||||||
var state plugin.Status
|
var state plugin.Status
|
||||||
if program.crit > 0 && tlDays <= program.crit {
|
if program.crit > 0 && tlDays <= program.crit {
|
||||||
|
|
Loading…
Reference in a new issue