New upstream version 2.4.0
This commit is contained in:
parent
d5a5faa95b
commit
600e193ca4
102 changed files with 16219 additions and 31778 deletions
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -165,8 +165,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
|
||||
$(top_srcdir)/gl/m4/open-cloexec.m4 \
|
||||
$(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
|
||||
$(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
|
||||
$(top_srcdir)/gl/m4/realloc.m4 \
|
||||
$(top_srcdir)/gl/m4/reallocarray.m4 \
|
||||
|
@ -179,7 +178,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
|
||||
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
|
||||
$(top_srcdir)/gl/m4/std-gnu11.m4 \
|
||||
$(top_srcdir)/gl/m4/stdalign.m4 \
|
||||
$(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
|
||||
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
|
||||
|
@ -197,7 +195,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
|
||||
$(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
|
||||
$(top_srcdir)/gl/m4/unlocked-io.m4 \
|
||||
$(top_srcdir)/gl/m4/vararrays.m4 \
|
||||
$(top_srcdir)/gl/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vasprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/visibility.m4 \
|
||||
|
@ -312,8 +309,6 @@ am__define_uniq_tagged_files = \
|
|||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp \
|
||||
|
@ -370,6 +365,8 @@ CFLAGS = @CFLAGS@
|
|||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBILIBS = @DBILIBS@
|
||||
DEFS = @DEFS@
|
||||
|
@ -389,6 +386,7 @@ ENOLINK_VALUE = @ENOLINK_VALUE@
|
|||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRAS = @EXTRAS@
|
||||
EXTRAS_ROOT = @EXTRAS_ROOT@
|
||||
|
@ -1760,6 +1758,8 @@ install_sh = @install_sh@
|
|||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
@ -1974,7 +1974,6 @@ cscopelist-am: $(am__tagged_files)
|
|||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
*/
|
||||
typedef struct {
|
||||
char *file;
|
||||
bool file_string_on_heap;
|
||||
char *stanza;
|
||||
} np_ini_info;
|
||||
|
||||
|
@ -95,16 +96,22 @@ parse_locator(const char *locator, const char *def_stanza, np_ini_info *i)
|
|||
i->stanza = malloc(sizeof(char) * (stanza_len + 1));
|
||||
strncpy(i->stanza, locator, stanza_len);
|
||||
i->stanza[stanza_len] = '\0';
|
||||
} else /* otherwise we use the default stanza */
|
||||
} else {/* otherwise we use the default stanza */
|
||||
i->stanza = strdup(def_stanza);
|
||||
}
|
||||
|
||||
if (i->stanza == NULL)
|
||||
die(STATE_UNKNOWN, _("malloc() failed!\n"));
|
||||
|
||||
/* check whether there's an @file part */
|
||||
i->file = stanza_len == locator_len
|
||||
? default_file()
|
||||
: strdup(&(locator[stanza_len + 1]));
|
||||
if (stanza_len == locator_len) {
|
||||
i->file = default_file();
|
||||
i->file_string_on_heap = false;
|
||||
} else {
|
||||
i->file = strdup(&(locator[stanza_len + 1]));
|
||||
i->file_string_on_heap = true;
|
||||
}
|
||||
|
||||
if (i->file == NULL || i->file[0] == '\0')
|
||||
die(STATE_UNKNOWN,
|
||||
_("Cannot find config file in any standard location.\n"));
|
||||
|
@ -136,7 +143,10 @@ np_get_defaults(const char *locator, const char *default_section)
|
|||
_("Invalid section '%s' in config file '%s'\n"), i.stanza,
|
||||
i.file);
|
||||
|
||||
free(i.file);
|
||||
if (i.file_string_on_heap) {
|
||||
free(i.file);
|
||||
}
|
||||
|
||||
if (inifile != stdin)
|
||||
fclose(inifile);
|
||||
free(i.stanza);
|
||||
|
@ -358,14 +368,18 @@ add_option(FILE *f, np_arg_list **optlst)
|
|||
static char *
|
||||
default_file(void)
|
||||
{
|
||||
char **p, *ini_file;
|
||||
char *ini_file;
|
||||
|
||||
if ((ini_file = getenv("MP_CONFIG_FILE")) != NULL ||
|
||||
(ini_file = default_file_in_path()) != NULL)
|
||||
(ini_file = default_file_in_path()) != NULL) {
|
||||
return ini_file;
|
||||
for (p = default_ini_path_names; *p != NULL; p++)
|
||||
if (access(*p, F_OK) == 0)
|
||||
}
|
||||
|
||||
for (char **p = default_ini_path_names; *p != NULL; p++) {
|
||||
if (access(*p, F_OK) == 0) {
|
||||
return *p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -168,8 +168,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
|
||||
$(top_srcdir)/gl/m4/open-cloexec.m4 \
|
||||
$(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
|
||||
$(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
|
||||
$(top_srcdir)/gl/m4/realloc.m4 \
|
||||
$(top_srcdir)/gl/m4/reallocarray.m4 \
|
||||
|
@ -182,7 +181,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
|
||||
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
|
||||
$(top_srcdir)/gl/m4/std-gnu11.m4 \
|
||||
$(top_srcdir)/gl/m4/stdalign.m4 \
|
||||
$(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
|
||||
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
|
||||
|
@ -200,7 +198,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
|
|||
$(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
|
||||
$(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
|
||||
$(top_srcdir)/gl/m4/unlocked-io.m4 \
|
||||
$(top_srcdir)/gl/m4/vararrays.m4 \
|
||||
$(top_srcdir)/gl/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vasprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/visibility.m4 \
|
||||
|
@ -339,8 +336,6 @@ am__define_uniq_tagged_files = \
|
|||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__tty_colors_dummy = \
|
||||
mgn= red= grn= lgn= blu= brg= std=; \
|
||||
am__color_tests=no
|
||||
|
@ -575,6 +570,8 @@ CFLAGS = @CFLAGS@
|
|||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBILIBS = @DBILIBS@
|
||||
DEFS = @DEFS@
|
||||
|
@ -594,6 +591,7 @@ ENOLINK_VALUE = @ENOLINK_VALUE@
|
|||
EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
|
||||
EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
|
||||
ERRNO_H = @ERRNO_H@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRAS = @EXTRAS@
|
||||
EXTRAS_ROOT = @EXTRAS_ROOT@
|
||||
|
@ -1965,6 +1963,8 @@ install_sh = @install_sh@
|
|||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
@ -2352,7 +2352,6 @@ recheck: all $(check_PROGRAMS)
|
|||
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
|
||||
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
|
||||
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
monitoring_plugin *this_monitoring_plugin=NULL;
|
||||
|
||||
unsigned int timeout_state = STATE_CRITICAL;
|
||||
int timeout_state = STATE_CRITICAL;
|
||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||
|
||||
bool _np_state_read_file(FILE *);
|
||||
|
|
|
@ -65,7 +65,7 @@ bool check_range(double, range *);
|
|||
int get_status(double, thresholds *);
|
||||
|
||||
/* Handle timeouts */
|
||||
extern unsigned int timeout_state;
|
||||
extern int timeout_state;
|
||||
extern unsigned int timeout_interval;
|
||||
|
||||
/* All possible characters in a threshold range */
|
||||
|
|
|
@ -390,13 +390,12 @@ cmd_file_read ( char *filename, output *out, int flags)
|
|||
void
|
||||
timeout_alarm_handler (int signo)
|
||||
{
|
||||
size_t i;
|
||||
if (signo == SIGALRM) {
|
||||
printf (_("%s - Plugin timed out after %d seconds\n"),
|
||||
state_text(timeout_state), timeout_interval);
|
||||
|
||||
long maxfd = mp_open_max();
|
||||
if(_cmd_pids) for(i = 0; i < maxfd; i++) {
|
||||
if(_cmd_pids) for(long int i = 0; i < maxfd; i++) {
|
||||
if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue