summaryrefslogtreecommitdiffstats
path: root/plugins/sslutils.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2015-10-02 13:53:08 (GMT)
committerSven Nierlein <sven@nierlein.de>2015-10-02 13:56:19 (GMT)
commit9eeb3e170f2638ec36c6770687a11bd01846e75a (patch)
tree6a5cab1212bf3f1fa7b2111bf303b6b06b5b03fd /plugins/sslutils.c
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>
Diffstat (limited to 'plugins/sslutils.c')
-rw-r--r--plugins/sslutils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 76e4507..c9882c6 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){
209 (tm->data[6 + offset] - '0') * 10 + (tm->data[7 + offset] - '0'); 209 (tm->data[6 + offset] - '0') * 10 + (tm->data[7 + offset] - '0');
210 stamp.tm_min = 210 stamp.tm_min =
211 (tm->data[8 + offset] - '0') * 10 + (tm->data[9 + offset] - '0'); 211 (tm->data[8 + offset] - '0') * 10 + (tm->data[9 + offset] - '0');
212 stamp.tm_sec = 0; 212 stamp.tm_sec =
213 (tm->data[10 + offset] - '0') * 10 + (tm->data[11 + offset] - '0');
213 stamp.tm_isdst = -1; 214 stamp.tm_isdst = -1;
214 215
215 time_left = difftime(timegm(&stamp), time(NULL)); 216 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){
231 232
232 printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"), 233 printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"),
233 (days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", cn, time_remaining, 234 (days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", cn, time_remaining,
234 time_left > 3600 ? "hours" : "minutes", timestamp); 235 time_left >= 3600 ? "hours" : "minutes", timestamp);
235 236
236 if ( days_left > days_till_exp_crit) 237 if ( days_left > days_till_exp_crit)
237 status = STATE_WARNING; 238 status = STATE_WARNING;