New upstream version 2.4.0
This commit is contained in:
parent
d5a5faa95b
commit
600e193ca4
102 changed files with 16219 additions and 31778 deletions
|
@ -26,7 +26,7 @@ EXTRA_PROGRAMS = pst3
|
|||
|
||||
EXTRA_DIST = t pst3.c
|
||||
|
||||
BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
|
||||
BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a
|
||||
NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
|
||||
NETLIBS = $(NETOBJS) $(SOCKETLIBS)
|
||||
|
||||
|
@ -80,8 +80,8 @@ install-exec-local: $(noinst_PROGRAMS)
|
|||
|
||||
##############################################################################
|
||||
# the actual targets
|
||||
check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
|
||||
check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
|
||||
check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) $(LIB_CRYPTO)
|
||||
check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) $(LIB_CRYPTO)
|
||||
|
||||
# -m64 needed at compiler and linker phase
|
||||
pst3_CFLAGS = @PST3CFLAGS@
|
||||
|
|
|
@ -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,
|
||||
|
@ -166,8 +166,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 \
|
||||
|
@ -180,7 +179,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 \
|
||||
|
@ -198,7 +196,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 \
|
||||
|
@ -220,11 +217,9 @@ PROGRAMS = $(noinst_PROGRAMS)
|
|||
check_dhcp_SOURCES = check_dhcp.c
|
||||
check_dhcp_OBJECTS = check_dhcp.$(OBJEXT)
|
||||
am__DEPENDENCIES_1 =
|
||||
am__DEPENDENCIES_2 = ../plugins/utils.o ../lib/libmonitoringplug.a \
|
||||
../gl/libgnu.a $(am__DEPENDENCIES_1)
|
||||
am__DEPENDENCIES_3 = ../plugins/netutils.o $(am__DEPENDENCIES_2) \
|
||||
am__DEPENDENCIES_2 = ../plugins/netutils.o $(BASEOBJS) \
|
||||
$(am__DEPENDENCIES_1)
|
||||
am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
|
||||
am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
|
@ -297,8 +292,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
|
||||
|
@ -534,6 +527,8 @@ CFLAGS = @CFLAGS@
|
|||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBILIBS = @DBILIBS@
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
|
@ -553,6 +548,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@
|
||||
|
@ -1924,6 +1920,8 @@ install_sh = @install_sh@
|
|||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = $(datadir)/locale
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
@ -1947,7 +1945,7 @@ with_trusted_path = @with_trusted_path@
|
|||
AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
|
||||
AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
|
||||
EXTRA_DIST = t pst3.c
|
||||
BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
|
||||
BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a
|
||||
NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
|
||||
NETLIBS = $(NETOBJS) $(SOCKETLIBS)
|
||||
TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
|
||||
|
@ -1971,8 +1969,8 @@ INSTALL_SUID = \
|
|||
|
||||
##############################################################################
|
||||
# the actual targets
|
||||
check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
|
||||
check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
|
||||
check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) $(LIB_CRYPTO)
|
||||
check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) $(LIB_CRYPTO)
|
||||
|
||||
# -m64 needed at compiler and linker phase
|
||||
pst3_CFLAGS = @PST3CFLAGS@
|
||||
|
@ -2300,7 +2298,6 @@ recheck: all
|
|||
@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
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ int send_dhcp_discover(int sock){
|
|||
memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
|
||||
opts += sizeof(requested_address);
|
||||
}
|
||||
discover_packet.options[opts++]=DHCP_OPTION_END;
|
||||
discover_packet.options[opts++]= (char)DHCP_OPTION_END;
|
||||
|
||||
/* unicast fields */
|
||||
if(unicast)
|
||||
|
|
|
@ -1547,46 +1547,66 @@ finish(int sig)
|
|||
while(host) {
|
||||
if(debug) puts("");
|
||||
|
||||
if (rta_mode && host->pl<100) {
|
||||
printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000,
|
||||
(targets > 1) ? host->name : "", (float)host->rtmax / 1000,
|
||||
(targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0);
|
||||
if (rta_mode) {
|
||||
if (host->pl<100) {
|
||||
printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000,
|
||||
(targets > 1) ? host->name : "", (float)host->rtmax / 1000,
|
||||
(targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0);
|
||||
} else {
|
||||
printf("%srta=U;;;; %srtmax=U;;;; %srtmin=U;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(targets > 1) ? host->name : "",
|
||||
(targets > 1) ? host->name : "");
|
||||
}
|
||||
}
|
||||
|
||||
if (pl_mode) {
|
||||
printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl);
|
||||
}
|
||||
|
||||
if (jitter_mode && host->pl<100) {
|
||||
printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; %sjitter_min=%0.3fms;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->jitter,
|
||||
(float)warn.jitter,
|
||||
(float)crit.jitter,
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->jitter_max / 1000, (targets > 1) ? host->name : "",
|
||||
(float)host->jitter_min / 1000
|
||||
);
|
||||
if (jitter_mode) {
|
||||
if (host->pl<100) {
|
||||
printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; %sjitter_min=%0.3fms;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->jitter,
|
||||
(float)warn.jitter,
|
||||
(float)crit.jitter,
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->jitter_max / 1000, (targets > 1) ? host->name : "",
|
||||
(float)host->jitter_min / 1000
|
||||
);
|
||||
} else {
|
||||
printf("%sjitter_avg=U;;;; %sjitter_max=U;;;; %sjitter_min=U;;;; ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(targets > 1) ? host->name : "",
|
||||
(targets > 1) ? host->name : "");
|
||||
}
|
||||
}
|
||||
|
||||
if (mos_mode && host->pl<100) {
|
||||
printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->mos,
|
||||
(float)warn.mos,
|
||||
(float)crit.mos
|
||||
);
|
||||
if (mos_mode) {
|
||||
if (host->pl<100) {
|
||||
printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(float)host->mos,
|
||||
(float)warn.mos,
|
||||
(float)crit.mos);
|
||||
} else {
|
||||
printf("%smos=U;;;; ", (targets > 1) ? host->name : "");
|
||||
}
|
||||
}
|
||||
|
||||
if (score_mode && host->pl<100) {
|
||||
printf("%sscore=%u;%u;%u;0;100 ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(int)host->score,
|
||||
(int)warn.score,
|
||||
(int)crit.score
|
||||
);
|
||||
if (score_mode) {
|
||||
if (host->pl<100) {
|
||||
printf("%sscore=%u;%u;%u;0;100 ",
|
||||
(targets > 1) ? host->name : "",
|
||||
(int)host->score,
|
||||
(int)warn.score,
|
||||
(int)crit.score);
|
||||
} else {
|
||||
printf("%sscore=U;;;; ", (targets > 1) ? host->name : "");
|
||||
}
|
||||
}
|
||||
|
||||
host = host->next;
|
||||
|
|
|
@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO",
|
|||
"no" );
|
||||
|
||||
if ($allow_sudo eq "yes" or $> == 0) {
|
||||
plan tests => 39;
|
||||
plan tests => 40;
|
||||
} else {
|
||||
plan skip_all => "Need sudo to test check_icmp";
|
||||
}
|
||||
|
@ -57,7 +57,8 @@ $res = NPTest->testCmd(
|
|||
"$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2"
|
||||
);
|
||||
is( $res->return_code, 2, "Timeout - host nonresponsive" );
|
||||
like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
|
||||
like( $res->output, '/pl=100%/', "Error contains 'pl=100%' string (for 100% packet loss)" );
|
||||
like( $res->output, '/rta=U/', "Error contains 'rta=U' string" );
|
||||
|
||||
$res = NPTest->testCmd(
|
||||
"$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue