summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLorenz <12514511+RincewindsHat@users.noreply.github.com>2023-02-10 11:43:20 +0100
committerGitHub <noreply@github.com>2023-02-10 11:43:20 +0100
commitc07206f2ccc2356aa74bc6813a94c2190017d44e (patch)
tree1677e5fdca5c3ce544e92c5484e16a0b68df1cc9 /plugins
parente92046f810658016b7c373677efefda3b21400e4 (diff)
parentd2fcf49ad4afc15f37d082d7bc96a808369ec2d4 (diff)
downloadmonitoring-plugins-c07206f2ccc2356aa74bc6813a94c2190017d44e.tar.gz
Merge pull request #1832 from RincewindsHat/gnulib_update_2023
Gnulib update 2023 and attendant fixes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am4
-rw-r--r--plugins/check_disk.c2
-rw-r--r--plugins/sslutils.c23
3 files changed, 15 insertions, 14 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 3fde54d6..ab59eb73 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -51,10 +51,10 @@ noinst_LIBRARIES = libnpcommon.a
51libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \ 51libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \
52 popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h 52 popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h
53 53
54BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a 54BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
55NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS) 55NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS)
56NETLIBS = $(NETOBJS) $(SOCKETLIBS) 56NETLIBS = $(NETOBJS) $(SOCKETLIBS)
57SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) 57SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO)
58 58
59TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) 59TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
60 60
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 6de17f86..935acce0 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -1056,7 +1056,7 @@ get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
1056 p->dfree_units = p->available*fsp->fsu_blocksize/mult; 1056 p->dfree_units = p->available*fsp->fsu_blocksize/mult;
1057 p->dtotal_units = p->total*fsp->fsu_blocksize/mult; 1057 p->dtotal_units = p->total*fsp->fsu_blocksize/mult;
1058 /* Free file nodes. Not sure the workaround is required, but in case...*/ 1058 /* Free file nodes. Not sure the workaround is required, but in case...*/
1059 p->inodes_free = fsp->fsu_favail > fsp->fsu_ffree ? 0 : fsp->fsu_favail; 1059 p->inodes_free = fsp->fsu_ffree;
1060 p->inodes_free_to_root = fsp->fsu_ffree; /* Free file nodes for root. */ 1060 p->inodes_free_to_root = fsp->fsu_ffree; /* Free file nodes for root. */
1061 p->inodes_used = fsp->fsu_files - fsp->fsu_ffree; 1061 p->inodes_used = fsp->fsu_files - fsp->fsu_ffree;
1062 if (freespace_ignore_reserved) { 1062 if (freespace_ignore_reserved) {
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index a7d80196..666a0120 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -200,17 +200,6 @@ int np_net_ssl_read(void *buf, int num) {
200 return SSL_read(s, buf, num); 200 return SSL_read(s, buf, num);
201} 201}
202 202
203int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
204# ifdef USE_OPENSSL
205 X509 *certificate = NULL;
206 certificate=SSL_get_peer_certificate(s);
207 return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
208# else /* ifndef USE_OPENSSL */
209 printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
210 return STATE_WARNING;
211# endif /* USE_OPENSSL */
212}
213
214int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ 203int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){
215# ifdef USE_OPENSSL 204# ifdef USE_OPENSSL
216 X509_NAME *subj=NULL; 205 X509_NAME *subj=NULL;
@@ -337,4 +326,16 @@ int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int
337# endif /* USE_OPENSSL */ 326# endif /* USE_OPENSSL */
338} 327}
339 328
329int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
330# ifdef USE_OPENSSL
331 X509 *certificate = NULL;
332 certificate=SSL_get_peer_certificate(s);
333 return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
334# else /* ifndef USE_OPENSSL */
335 printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
336 return STATE_WARNING;
337# endif /* USE_OPENSSL */
338}
339
340
340#endif /* HAVE_SSL */ 341#endif /* HAVE_SSL */