From git at monitoring-plugins.org Thu Nov 7 09:30:12 2019 From: git at monitoring-plugins.org (Andreas Baumann) Date: Thu, 7 Nov 2019 09:30:12 +0100 (CET) Subject: [monitoring-plugins] check_curl: more tolerant CN= parsing when ... Message-ID: <20191107083012.5D9222002475@orwell.monitoring-plugins.org> Module: monitoring-plugins Branch: feature_check_curl Commit: f7efee5f9c590ee0bea65d56697903cbf26d24c5 Author: Andreas Baumann Date: Thu Nov 7 08:20:17 2019 +0000 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=f7efee5 check_curl: more tolerant CN= parsing when checking certificates (hit on Centos 8) --- plugins/check_curl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 69b6344..796c55f 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -2215,13 +2215,20 @@ net_noopenssl_check_certificate (cert_ptr_union* cert_ptr, int days_till_exp_war for (i = 0; i < cert_ptr->to_certinfo->num_of_certs; i++) { for (slist = cert_ptr->to_certinfo->certinfo[i]; slist; slist = slist->next) { - /* find first common name in subject, TODO: check alternative subjects for + /* find first common name in subject, + * TODO: check alternative subjects for + * TODO: have a decent parser here and not a hack * multi-host certificate, check wildcards */ if (strncasecmp (slist->data, "Subject:", 8) == 0) { + int d = 3; char* p = strstr (slist->data, "CN="); + if (p == NULL) { + d = 5; + p = strstr (slist->data, "CN = "); + } if (p != NULL) { - if (strncmp (host_name, p+3, strlen (host_name)) == 0) { + if (strncmp (host_name, p+d, strlen (host_name)) == 0) { cname_found = 1; } } From git at monitoring-plugins.org Thu Nov 7 16:40:11 2019 From: git at monitoring-plugins.org (Andreas Baumann) Date: Thu, 7 Nov 2019 16:40:11 +0100 (CET) Subject: [monitoring-plugins] check_curl: NSS, parse more date formats from ... Message-ID: <20191107154011.76DE22002475@orwell.monitoring-plugins.org> Module: monitoring-plugins Branch: feature_check_curl Commit: 1b689dab5e64d4dfb76b81434cd5c4d50e988442 Author: Andreas Baumann Date: Thu Nov 7 15:31:52 2019 +0000 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=1b689da check_curl: NSS, parse more date formats from certificate (in -C cert check) --- plugins/check_curl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 796c55f..5b6564c 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -2181,10 +2181,14 @@ parse_cert_date (const char *s) { struct tm tm; time_t date; + char *res; if (!s) return -1; - strptime (s, "%Y-%m-%d %H:%M:%S GMT", &tm); + /* Jan 17 14:25:12 2020 GMT */ + res = strptime (s, "%Y-%m-%d %H:%M:%S GMT", &tm); + /* Sep 11 12:00:00 2020 GMT */ + if (res == NULL) strptime (s, "%Y %m %d %H:%M:%S GMT", &tm); date = mktime (&tm); return date; From git at monitoring-plugins.org Thu Nov 28 09:10:11 2019 From: git at monitoring-plugins.org (Sven Nierlein) Date: Thu, 28 Nov 2019 09:10:11 +0100 (CET) Subject: [monitoring-plugins] simplify documentation Message-ID: <20191128081011.CEF51200247F@orwell.monitoring-plugins.org> Module: monitoring-plugins Branch: master Commit: 7693af147926d0eb7369a43070d114b6bd79dc70 Author: datamuc Committer: Sven Nierlein Date: Thu Nov 28 06:44:59 2019 +0100 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=7693af1 simplify documentation "first" + "second to last" is every line right? --- doc/developer-guidelines.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 6f31f36..5f480c5 100644 --- a/doc/developer-guidelines.sgml +++ b/doc/developer-guidelines.sgml @@ -324,8 +324,8 @@
Performance data - Nagios 3 and newer will concatenate the parts following a "|" in a) the first - line output by the plugin, and b) in the second to last line, into a string it + Nagios 3 and newer will concatenate the parts following a "|" in + each line of output by the plugin into a string it passes to whatever performance data processing it has configured. (Note that it currently does not insert additional whitespace between both, so the plugin needs to provide some to prevent the last pair of a) and the first of b) getting run