aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.de> 2015-10-02 15:53:08 +0200
committerGravatar Sven Nierlein <sven@nierlein.de> 2015-10-02 15:56:19 +0200
commit9eeb3e170f2638ec36c6770687a11bd01846e75a (patch)
tree6a5cab1212bf3f1fa7b2111bf303b6b06b5b03fd
parente1ed1d805eafaef113e7a676f57cf9f5d0016099 (diff)
downloadmonitoring-plugins-9eeb3e170f2638ec36c6770687a11bd01846e75a.tar.gz
fix typo from #1336
if exactly one hour before the expire date, we would mixup minutes and hours. Signed-off-by: Sven Nierlein <sven@nierlein.de>
-rw-r--r--plugins/sslutils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 76e45079..c9882c69 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -209,7 +209,8 @@ int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
(tm->data[6 + offset] - '0') * 10 + (tm->data[7 + offset] - '0');
stamp.tm_min =
(tm->data[8 + offset] - '0') * 10 + (tm->data[9 + offset] - '0');
- stamp.tm_sec = 0;
+ stamp.tm_sec =
+ (tm->data[10 + offset] - '0') * 10 + (tm->data[11 + offset] - '0');
stamp.tm_isdst = -1;
time_left = difftime(timegm(&stamp), time(NULL));
@@ -231,7 +232,7 @@ int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"),
(days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", cn, time_remaining,
- time_left > 3600 ? "hours" : "minutes", timestamp);
+ time_left >= 3600 ? "hours" : "minutes", timestamp);
if ( days_left > days_till_exp_crit)
status = STATE_WARNING;