diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/Makefile.am | 4 | ||||
| -rw-r--r-- | plugins/check_disk.c | 2 | ||||
| -rw-r--r-- | plugins/sslutils.c | 23 |
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 | |||
| 51 | libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \ | 51 | libnpcommon_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 | ||
| 54 | BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a | 54 | BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) |
| 55 | NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS) | 55 | NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS) |
| 56 | NETLIBS = $(NETOBJS) $(SOCKETLIBS) | 56 | NETLIBS = $(NETOBJS) $(SOCKETLIBS) |
| 57 | SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) | 57 | SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO) |
| 58 | 58 | ||
| 59 | TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) | 59 | TESTS_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 286273f6..4f12ddaf 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c | |||
| @@ -191,17 +191,6 @@ int np_net_ssl_read(void *buf, int num) { | |||
| 191 | return SSL_read(s, buf, num); | 191 | return SSL_read(s, buf, num); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ | ||
| 195 | # ifdef USE_OPENSSL | ||
| 196 | X509 *certificate = NULL; | ||
| 197 | certificate=SSL_get_peer_certificate(s); | ||
| 198 | return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit)); | ||
| 199 | # else /* ifndef USE_OPENSSL */ | ||
| 200 | printf("%s\n", _("WARNING - Plugin does not support checking certificates.")); | ||
| 201 | return STATE_WARNING; | ||
| 202 | # endif /* USE_OPENSSL */ | ||
| 203 | } | ||
| 204 | |||
| 205 | int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ | 194 | int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ |
| 206 | # ifdef USE_OPENSSL | 195 | # ifdef USE_OPENSSL |
| 207 | X509_NAME *subj=NULL; | 196 | X509_NAME *subj=NULL; |
| @@ -328,4 +317,16 @@ int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int | |||
| 328 | # endif /* USE_OPENSSL */ | 317 | # endif /* USE_OPENSSL */ |
| 329 | } | 318 | } |
| 330 | 319 | ||
| 320 | int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ | ||
| 321 | # ifdef USE_OPENSSL | ||
| 322 | X509 *certificate = NULL; | ||
| 323 | certificate=SSL_get_peer_certificate(s); | ||
| 324 | return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit)); | ||
| 325 | # else /* ifndef USE_OPENSSL */ | ||
| 326 | printf("%s\n", _("WARNING - Plugin does not support checking certificates.")); | ||
| 327 | return STATE_WARNING; | ||
| 328 | # endif /* USE_OPENSSL */ | ||
| 329 | } | ||
| 330 | |||
| 331 | |||
| 331 | #endif /* HAVE_SSL */ | 332 | #endif /* HAVE_SSL */ |
