Imported Upstream version 1.4.15
This commit is contained in:
parent
882cdeecca
commit
047baae1ca
386 changed files with 60019 additions and 38317 deletions
|
@ -1,7 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
if RELEASE_PRESENT
|
||||
NP_VERSION = $(PACKAGE_VERSION)
|
||||
NP_VERSION = @NP_RELEASE@
|
||||
else
|
||||
NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
|
||||
@$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
|
||||
|
@ -39,7 +39,7 @@ EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \
|
|||
check_nagios check_by_ssh check_dns check_nt check_ide_smart \
|
||||
check_procs check_mysql_query check_apt
|
||||
|
||||
EXTRA_DIST = t utils.c netutils.c sslutils.c popen.c utils.h netutils.h \
|
||||
EXTRA_DIST = t tests utils.c netutils.c sslutils.c popen.c utils.h netutils.h \
|
||||
popen.h common.h runcmd.c runcmd.h
|
||||
|
||||
PLUGINHDRS = common.h
|
||||
|
|
|
@ -53,20 +53,23 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|||
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
|
||||
$(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \
|
||||
$(top_srcdir)/gl/m4/arpa_inet_h.m4 \
|
||||
$(top_srcdir)/gl/m4/asm-underscore.m4 \
|
||||
$(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \
|
||||
$(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \
|
||||
$(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \
|
||||
$(top_srcdir)/gl/m4/dos.m4 \
|
||||
$(top_srcdir)/gl/m4/double-slash-root.m4 \
|
||||
$(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \
|
||||
$(top_srcdir)/gl/m4/exitfail.m4 \
|
||||
$(top_srcdir)/gl/m4/extensions.m4 \
|
||||
$(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
|
||||
$(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
|
||||
$(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/extensions.m4 \
|
||||
$(top_srcdir)/gl/m4/fcntl-o.m4 \
|
||||
$(top_srcdir)/gl/m4/fcntl-safer.m4 \
|
||||
$(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \
|
||||
$(top_srcdir)/gl/m4/floorf.m4 \
|
||||
$(top_srcdir)/gl/m4/fcntl.m4 $(top_srcdir)/gl/m4/fcntl_h.m4 \
|
||||
$(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
|
||||
$(top_srcdir)/gl/m4/fstypename.m4 \
|
||||
$(top_srcdir)/gl/m4/fsusage.m4 \
|
||||
$(top_srcdir)/gl/m4/getaddrinfo.m4 \
|
||||
$(top_srcdir)/gl/m4/getdtablesize.m4 \
|
||||
$(top_srcdir)/gl/m4/gethostname.m4 \
|
||||
$(top_srcdir)/gl/m4/getloadavg.m4 \
|
||||
$(top_srcdir)/gl/m4/getopt.m4 $(top_srcdir)/gl/m4/gettext.m4 \
|
||||
|
@ -79,48 +82,64 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
|
|||
$(top_srcdir)/gl/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/gl/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/gl/m4/inttypes_h.m4 \
|
||||
$(top_srcdir)/gl/m4/langinfo_h.m4 \
|
||||
$(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
|
||||
$(top_srcdir)/gl/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/gl/m4/libtool.m4 \
|
||||
$(top_srcdir)/gl/m4/localcharset.m4 \
|
||||
$(top_srcdir)/gl/m4/locale-fr.m4 \
|
||||
$(top_srcdir)/gl/m4/locale-ja.m4 \
|
||||
$(top_srcdir)/gl/m4/locale-zh.m4 \
|
||||
$(top_srcdir)/gl/m4/locale_h.m4 \
|
||||
$(top_srcdir)/gl/m4/longlong.m4 \
|
||||
$(top_srcdir)/gl/m4/ls-mntd-fs.m4 \
|
||||
$(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \
|
||||
$(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \
|
||||
$(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \
|
||||
$(top_srcdir)/gl/m4/mountlist.m4 \
|
||||
$(top_srcdir)/gl/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/gl/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/gl/m4/ltversion.m4 \
|
||||
$(top_srcdir)/gl/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
|
||||
$(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
|
||||
$(top_srcdir)/gl/m4/mbsinit.m4 \
|
||||
$(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/memchr.m4 \
|
||||
$(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
|
||||
$(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
|
||||
$(top_srcdir)/gl/m4/multiarch.m4 \
|
||||
$(top_srcdir)/gl/m4/netdb_h.m4 \
|
||||
$(top_srcdir)/gl/m4/netinet_in_h.m4 $(top_srcdir)/gl/m4/nls.m4 \
|
||||
$(top_srcdir)/gl/m4/netinet_in_h.m4 \
|
||||
$(top_srcdir)/gl/m4/nl_langinfo.m4 $(top_srcdir)/gl/m4/nls.m4 \
|
||||
$(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \
|
||||
$(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \
|
||||
$(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \
|
||||
$(top_srcdir)/gl/m4/safe-read.m4 \
|
||||
$(top_srcdir)/gl/m4/safe-write.m4 \
|
||||
$(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \
|
||||
$(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \
|
||||
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \
|
||||
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
|
||||
$(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strdup.m4 \
|
||||
$(top_srcdir)/gl/m4/strerror.m4 \
|
||||
$(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/setenv.m4 \
|
||||
$(top_srcdir)/gl/m4/sha1.m4 $(top_srcdir)/gl/m4/size_max.m4 \
|
||||
$(top_srcdir)/gl/m4/snprintf.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.m4 \
|
||||
$(top_srcdir)/gl/m4/stdbool.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 $(top_srcdir)/gl/m4/stdlib_h.m4 \
|
||||
$(top_srcdir)/gl/m4/strdup.m4 $(top_srcdir)/gl/m4/strerror.m4 \
|
||||
$(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \
|
||||
$(top_srcdir)/gl/m4/strnlen.m4 \
|
||||
$(top_srcdir)/gl/m4/strnlen.m4 $(top_srcdir)/gl/m4/strsep.m4 \
|
||||
$(top_srcdir)/gl/m4/strstr.m4 \
|
||||
$(top_srcdir)/gl/m4/sys_socket_h.m4 \
|
||||
$(top_srcdir)/gl/m4/sys_stat_h.m4 \
|
||||
$(top_srcdir)/gl/m4/time_h.m4 $(top_srcdir)/gl/m4/time_r.m4 \
|
||||
$(top_srcdir)/gl/m4/timegm.m4 \
|
||||
$(top_srcdir)/gl/m4/unistd-safer.m4 \
|
||||
$(top_srcdir)/gl/m4/unistd_h.m4 \
|
||||
$(top_srcdir)/gl/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vasprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \
|
||||
$(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \
|
||||
$(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
|
||||
$(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
|
||||
$(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/gl/m4/vsnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/warn-on-use.m4 \
|
||||
$(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
|
||||
$(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/write.m4 \
|
||||
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xsize.m4 \
|
||||
$(top_srcdir)/gl/m4/xstrndup.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
|
||||
|
@ -262,7 +281,7 @@ ALLOCA_H = @ALLOCA_H@
|
|||
AMTAR = @AMTAR@
|
||||
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
|
||||
AR = @AR@
|
||||
ARPA_INET_H = @ARPA_INET_H@
|
||||
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -278,16 +297,13 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
# gettext docs say to use AM_CPPFLAGS, but per module_CPPFLAGS override this
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEPLIBS = @DEPLIBS@
|
||||
ECHO = @ECHO@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
|
@ -304,12 +320,11 @@ EXTRAS = @EXTRAS@
|
|||
EXTRAS_ROOT = @EXTRAS_ROOT@
|
||||
EXTRA_NETOBJS = @EXTRA_NETOBJS@
|
||||
EXTRA_TEST = @EXTRA_TEST@
|
||||
F77 = @F77@
|
||||
FCNTL_H = @FCNTL_H@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FLOAT_H = @FLOAT_H@
|
||||
FLOORF_LIBM = @FLOORF_LIBM@
|
||||
GETADDRINFO_LIB = @GETADDRINFO_LIB@
|
||||
GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
|
@ -317,27 +332,41 @@ GLIBC21 = @GLIBC21@
|
|||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GNULIB_ACCEPT = @GNULIB_ACCEPT@
|
||||
GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
|
||||
GNULIB_ACOSL = @GNULIB_ACOSL@
|
||||
GNULIB_ASINL = @GNULIB_ASINL@
|
||||
GNULIB_ATANL = @GNULIB_ATANL@
|
||||
GNULIB_ATOLL = @GNULIB_ATOLL@
|
||||
GNULIB_BIND = @GNULIB_BIND@
|
||||
GNULIB_BTOWC = @GNULIB_BTOWC@
|
||||
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
|
||||
GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
|
||||
GNULIB_CEILF = @GNULIB_CEILF@
|
||||
GNULIB_CEILL = @GNULIB_CEILL@
|
||||
GNULIB_CHOWN = @GNULIB_CHOWN@
|
||||
GNULIB_CLOSE = @GNULIB_CLOSE@
|
||||
GNULIB_CONNECT = @GNULIB_CONNECT@
|
||||
GNULIB_COSL = @GNULIB_COSL@
|
||||
GNULIB_DPRINTF = @GNULIB_DPRINTF@
|
||||
GNULIB_DUP2 = @GNULIB_DUP2@
|
||||
GNULIB_DUP3 = @GNULIB_DUP3@
|
||||
GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
|
||||
GNULIB_ENVIRON = @GNULIB_ENVIRON@
|
||||
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
|
||||
GNULIB_EXPL = @GNULIB_EXPL@
|
||||
GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
|
||||
GNULIB_FCHDIR = @GNULIB_FCHDIR@
|
||||
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
|
||||
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
|
||||
GNULIB_FCLOSE = @GNULIB_FCLOSE@
|
||||
GNULIB_FCNTL = @GNULIB_FCNTL@
|
||||
GNULIB_FFLUSH = @GNULIB_FFLUSH@
|
||||
GNULIB_FLOORF = @GNULIB_FLOORF@
|
||||
GNULIB_FLOORL = @GNULIB_FLOORL@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF = @GNULIB_FPRINTF@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
GNULIB_FPURGE = @GNULIB_FPURGE@
|
||||
GNULIB_FPUTC = @GNULIB_FPUTC@
|
||||
GNULIB_FPUTS = @GNULIB_FPUTS@
|
||||
GNULIB_FREOPEN = @GNULIB_FREOPEN@
|
||||
|
@ -345,19 +374,23 @@ GNULIB_FREXP = @GNULIB_FREXP@
|
|||
GNULIB_FREXPL = @GNULIB_FREXPL@
|
||||
GNULIB_FSEEK = @GNULIB_FSEEK@
|
||||
GNULIB_FSEEKO = @GNULIB_FSEEKO@
|
||||
GNULIB_FSTATAT = @GNULIB_FSTATAT@
|
||||
GNULIB_FSYNC = @GNULIB_FSYNC@
|
||||
GNULIB_FTELL = @GNULIB_FTELL@
|
||||
GNULIB_FTELLO = @GNULIB_FTELLO@
|
||||
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
|
||||
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
|
||||
GNULIB_FWRITE = @GNULIB_FWRITE@
|
||||
GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
|
||||
GNULIB_GETCWD = @GNULIB_GETCWD@
|
||||
GNULIB_GETDELIM = @GNULIB_GETDELIM@
|
||||
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
|
||||
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
|
||||
GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
|
||||
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
|
||||
GNULIB_GETLINE = @GNULIB_GETLINE@
|
||||
GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
|
||||
GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
|
||||
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
|
||||
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
|
||||
GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
|
||||
|
@ -365,6 +398,7 @@ GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
|
|||
GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
|
||||
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
|
||||
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
|
||||
GNULIB_GRANTPT = @GNULIB_GRANTPT@
|
||||
GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
|
||||
GNULIB_INET_PTON = @GNULIB_INET_PTON@
|
||||
GNULIB_ISFINITE = @GNULIB_ISFINITE@
|
||||
|
@ -373,13 +407,17 @@ GNULIB_ISNAN = @GNULIB_ISNAN@
|
|||
GNULIB_ISNAND = @GNULIB_ISNAND@
|
||||
GNULIB_ISNANF = @GNULIB_ISNANF@
|
||||
GNULIB_ISNANL = @GNULIB_ISNANL@
|
||||
GNULIB_LCHMOD = @GNULIB_LCHMOD@
|
||||
GNULIB_LCHOWN = @GNULIB_LCHOWN@
|
||||
GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LINK = @GNULIB_LINK@
|
||||
GNULIB_LINKAT = @GNULIB_LINKAT@
|
||||
GNULIB_LISTEN = @GNULIB_LISTEN@
|
||||
GNULIB_LOGB = @GNULIB_LOGB@
|
||||
GNULIB_LOGL = @GNULIB_LOGL@
|
||||
GNULIB_LSEEK = @GNULIB_LSEEK@
|
||||
GNULIB_LSTAT = @GNULIB_LSTAT@
|
||||
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
|
||||
GNULIB_MATHL = @GNULIB_MATHL@
|
||||
GNULIB_MBRLEN = @GNULIB_MBRLEN@
|
||||
GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
|
||||
GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
|
||||
|
@ -399,27 +437,51 @@ GNULIB_MBSSEP = @GNULIB_MBSSEP@
|
|||
GNULIB_MBSSPN = @GNULIB_MBSSPN@
|
||||
GNULIB_MBSSTR = @GNULIB_MBSSTR@
|
||||
GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
|
||||
GNULIB_MEMCHR = @GNULIB_MEMCHR@
|
||||
GNULIB_MEMMEM = @GNULIB_MEMMEM@
|
||||
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
|
||||
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
|
||||
GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
|
||||
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
|
||||
GNULIB_MKFIFO = @GNULIB_MKFIFO@
|
||||
GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
|
||||
GNULIB_MKNOD = @GNULIB_MKNOD@
|
||||
GNULIB_MKNODAT = @GNULIB_MKNODAT@
|
||||
GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
|
||||
GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
|
||||
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
|
||||
GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
|
||||
GNULIB_MKTIME = @GNULIB_MKTIME@
|
||||
GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
|
||||
GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
|
||||
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
|
||||
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
|
||||
GNULIB_OPEN = @GNULIB_OPEN@
|
||||
GNULIB_OPENAT = @GNULIB_OPENAT@
|
||||
GNULIB_PERROR = @GNULIB_PERROR@
|
||||
GNULIB_PIPE2 = @GNULIB_PIPE2@
|
||||
GNULIB_POPEN = @GNULIB_POPEN@
|
||||
GNULIB_PREAD = @GNULIB_PREAD@
|
||||
GNULIB_PRINTF = @GNULIB_PRINTF@
|
||||
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
|
||||
GNULIB_PTSNAME = @GNULIB_PTSNAME@
|
||||
GNULIB_PUTC = @GNULIB_PUTC@
|
||||
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
|
||||
GNULIB_PUTENV = @GNULIB_PUTENV@
|
||||
GNULIB_PUTS = @GNULIB_PUTS@
|
||||
GNULIB_PWRITE = @GNULIB_PWRITE@
|
||||
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
|
||||
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
|
||||
GNULIB_READLINK = @GNULIB_READLINK@
|
||||
GNULIB_READLINKAT = @GNULIB_READLINKAT@
|
||||
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
|
||||
GNULIB_REALPATH = @GNULIB_REALPATH@
|
||||
GNULIB_RECV = @GNULIB_RECV@
|
||||
GNULIB_RECVFROM = @GNULIB_RECVFROM@
|
||||
GNULIB_REMOVE = @GNULIB_REMOVE@
|
||||
GNULIB_RENAME = @GNULIB_RENAME@
|
||||
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
|
||||
GNULIB_RMDIR = @GNULIB_RMDIR@
|
||||
GNULIB_ROUND = @GNULIB_ROUND@
|
||||
GNULIB_ROUNDF = @GNULIB_ROUNDF@
|
||||
GNULIB_ROUNDL = @GNULIB_ROUNDL@
|
||||
|
@ -430,10 +492,13 @@ GNULIB_SETENV = @GNULIB_SETENV@
|
|||
GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
|
||||
GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
|
||||
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
|
||||
GNULIB_SINL = @GNULIB_SINL@
|
||||
GNULIB_SLEEP = @GNULIB_SLEEP@
|
||||
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
|
||||
GNULIB_SOCKET = @GNULIB_SOCKET@
|
||||
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
|
||||
GNULIB_SQRTL = @GNULIB_SQRTL@
|
||||
GNULIB_STAT = @GNULIB_STAT@
|
||||
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
|
||||
GNULIB_STPCPY = @GNULIB_STPCPY@
|
||||
GNULIB_STPNCPY = @GNULIB_STPNCPY@
|
||||
|
@ -441,9 +506,11 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
|
|||
GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
|
||||
GNULIB_STRDUP = @GNULIB_STRDUP@
|
||||
GNULIB_STRERROR = @GNULIB_STRERROR@
|
||||
GNULIB_STRNCAT = @GNULIB_STRNCAT@
|
||||
GNULIB_STRNDUP = @GNULIB_STRNDUP@
|
||||
GNULIB_STRNLEN = @GNULIB_STRNLEN@
|
||||
GNULIB_STRPBRK = @GNULIB_STRPBRK@
|
||||
GNULIB_STRPTIME = @GNULIB_STRPTIME@
|
||||
GNULIB_STRSEP = @GNULIB_STRSEP@
|
||||
GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
|
||||
GNULIB_STRSTR = @GNULIB_STRSTR@
|
||||
|
@ -452,11 +519,24 @@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
|
|||
GNULIB_STRTOLL = @GNULIB_STRTOLL@
|
||||
GNULIB_STRTOULL = @GNULIB_STRTOULL@
|
||||
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
|
||||
GNULIB_SYMLINK = @GNULIB_SYMLINK@
|
||||
GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
|
||||
GNULIB_TANL = @GNULIB_TANL@
|
||||
GNULIB_TIMEGM = @GNULIB_TIMEGM@
|
||||
GNULIB_TIME_R = @GNULIB_TIME_R@
|
||||
GNULIB_TMPFILE = @GNULIB_TMPFILE@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
|
||||
GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
|
||||
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
|
||||
GNULIB_UNLINK = @GNULIB_UNLINK@
|
||||
GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
|
||||
GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
|
||||
GNULIB_UNSETENV = @GNULIB_UNSETENV@
|
||||
GNULIB_USLEEP = @GNULIB_USLEEP@
|
||||
GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
|
||||
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
|
||||
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
|
||||
GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
|
||||
|
@ -472,16 +552,28 @@ GNULIB_WCTOB = @GNULIB_WCTOB@
|
|||
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
|
||||
GNULIB_WRITE = @GNULIB_WRITE@
|
||||
GREP = @GREP@
|
||||
HAVE_ACCEPT4 = @HAVE_ACCEPT4@
|
||||
HAVE_ACOSL = @HAVE_ACOSL@
|
||||
HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
|
||||
HAVE_ASINL = @HAVE_ASINL@
|
||||
HAVE_ATANL = @HAVE_ATANL@
|
||||
HAVE_ATOLL = @HAVE_ATOLL@
|
||||
HAVE_BTOWC = @HAVE_BTOWC@
|
||||
HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
|
||||
HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
|
||||
HAVE_CHOWN = @HAVE_CHOWN@
|
||||
HAVE_COSL = @HAVE_COSL@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
|
||||
HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
|
||||
HAVE_DECL_COSL = @HAVE_DECL_COSL@
|
||||
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
|
||||
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
|
||||
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
|
||||
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
|
||||
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
|
||||
HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
|
||||
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
|
||||
HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
|
||||
|
@ -491,18 +583,23 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
|
|||
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
|
||||
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
|
||||
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
|
||||
HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
|
||||
HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
|
||||
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
|
||||
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
|
||||
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
|
||||
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
|
||||
HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
|
||||
HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
|
||||
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
|
||||
HAVE_DECL_SINL = @HAVE_DECL_SINL@
|
||||
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
|
||||
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
|
||||
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
|
||||
HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@
|
||||
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
|
||||
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
|
||||
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
|
||||
|
@ -510,58 +607,106 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
|||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
|
||||
HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
|
||||
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
|
||||
HAVE_DPRINTF = @HAVE_DPRINTF@
|
||||
HAVE_DUP2 = @HAVE_DUP2@
|
||||
HAVE_DUP3 = @HAVE_DUP3@
|
||||
HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
|
||||
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
|
||||
HAVE_EXPL = @HAVE_EXPL@
|
||||
HAVE_FACCESSAT = @HAVE_FACCESSAT@
|
||||
HAVE_FCHDIR = @HAVE_FCHDIR@
|
||||
HAVE_FCHMODAT = @HAVE_FCHMODAT@
|
||||
HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
|
||||
HAVE_FCNTL = @HAVE_FCNTL@
|
||||
HAVE_FSEEKO = @HAVE_FSEEKO@
|
||||
HAVE_FSTATAT = @HAVE_FSTATAT@
|
||||
HAVE_FSYNC = @HAVE_FSYNC@
|
||||
HAVE_FTELLO = @HAVE_FTELLO@
|
||||
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
|
||||
HAVE_FUTIMENS = @HAVE_FUTIMENS@
|
||||
HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
|
||||
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
|
||||
HAVE_GETGROUPS = @HAVE_GETGROUPS@
|
||||
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
|
||||
HAVE_GETLOGIN = @HAVE_GETLOGIN@
|
||||
HAVE_GETOPT_H = @HAVE_GETOPT_H@
|
||||
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
|
||||
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
|
||||
HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
|
||||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISNAND = @HAVE_ISNAND@
|
||||
HAVE_ISNANF = @HAVE_ISNANF@
|
||||
HAVE_ISNANL = @HAVE_ISNANL@
|
||||
HAVE_ISWBLANK = @HAVE_ISWBLANK@
|
||||
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
|
||||
HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
|
||||
HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
|
||||
HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
|
||||
HAVE_LCHMOD = @HAVE_LCHMOD@
|
||||
HAVE_LCHOWN = @HAVE_LCHOWN@
|
||||
HAVE_LINK = @HAVE_LINK@
|
||||
HAVE_LINKAT = @HAVE_LINKAT@
|
||||
HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
|
||||
HAVE_LOGL = @HAVE_LOGL@
|
||||
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
|
||||
HAVE_LSTAT = @HAVE_LSTAT@
|
||||
HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
|
||||
HAVE_MBRLEN = @HAVE_MBRLEN@
|
||||
HAVE_MBRTOWC = @HAVE_MBRTOWC@
|
||||
HAVE_MBSINIT = @HAVE_MBSINIT@
|
||||
HAVE_MBSLEN = @HAVE_MBSLEN@
|
||||
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
|
||||
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
|
||||
HAVE_MEMCHR = @HAVE_MEMCHR@
|
||||
HAVE_MEMPCPY = @HAVE_MEMPCPY@
|
||||
HAVE_MKDIRAT = @HAVE_MKDIRAT@
|
||||
HAVE_MKDTEMP = @HAVE_MKDTEMP@
|
||||
HAVE_MKFIFO = @HAVE_MKFIFO@
|
||||
HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
|
||||
HAVE_MKNOD = @HAVE_MKNOD@
|
||||
HAVE_MKNODAT = @HAVE_MKNODAT@
|
||||
HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
|
||||
HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
|
||||
HAVE_MKSTEMP = @HAVE_MKSTEMP@
|
||||
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
|
||||
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
|
||||
HAVE_NETDB_H = @HAVE_NETDB_H@
|
||||
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
|
||||
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
|
||||
HAVE_OPENAT = @HAVE_OPENAT@
|
||||
HAVE_OS_H = @HAVE_OS_H@
|
||||
HAVE_PIPE2 = @HAVE_PIPE2@
|
||||
HAVE_PREAD = @HAVE_PREAD@
|
||||
HAVE_PTSNAME = @HAVE_PTSNAME@
|
||||
HAVE_PWRITE = @HAVE_PWRITE@
|
||||
HAVE_RANDOM_H = @HAVE_RANDOM_H@
|
||||
HAVE_RANDOM_R = @HAVE_RANDOM_R@
|
||||
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
|
||||
HAVE_READLINK = @HAVE_READLINK@
|
||||
HAVE_READLINKAT = @HAVE_READLINKAT@
|
||||
HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
|
||||
HAVE_REALPATH = @HAVE_REALPATH@
|
||||
HAVE_RENAMEAT = @HAVE_RENAMEAT@
|
||||
HAVE_RPMATCH = @HAVE_RPMATCH@
|
||||
HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
|
||||
HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
|
||||
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
|
||||
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
|
||||
HAVE_SINL = @HAVE_SINL@
|
||||
HAVE_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_SQRTL = @HAVE_SQRTL@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
HAVE_STRCASESTR = @HAVE_STRCASESTR@
|
||||
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
|
||||
HAVE_STRNDUP = @HAVE_STRNDUP@
|
||||
HAVE_STRPBRK = @HAVE_STRPBRK@
|
||||
HAVE_STRPTIME = @HAVE_STRPTIME@
|
||||
HAVE_STRSEP = @HAVE_STRSEP@
|
||||
HAVE_STRTOD = @HAVE_STRTOD@
|
||||
HAVE_STRTOLL = @HAVE_STRTOLL@
|
||||
|
@ -570,18 +715,28 @@ HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
|
|||
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
|
||||
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
|
||||
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
|
||||
HAVE_SYMLINK = @HAVE_SYMLINK@
|
||||
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
|
||||
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
|
||||
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
|
||||
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
|
||||
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
|
||||
HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
|
||||
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
|
||||
HAVE_TANL = @HAVE_TANL@
|
||||
HAVE_TIMEGM = @HAVE_TIMEGM@
|
||||
HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
|
||||
HAVE_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNLINKAT = @HAVE_UNLINKAT@
|
||||
HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
|
||||
HAVE_UNSETENV = @HAVE_UNSETENV@
|
||||
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
|
||||
HAVE_USLEEP = @HAVE_USLEEP@
|
||||
HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
|
||||
HAVE_VASPRINTF = @HAVE_VASPRINTF@
|
||||
HAVE_VDPRINTF = @HAVE_VDPRINTF@
|
||||
HAVE_WCHAR_H = @HAVE_WCHAR_H@
|
||||
HAVE_WCHAR_T = @HAVE_WCHAR_T@
|
||||
HAVE_WCRTOMB = @HAVE_WCRTOMB@
|
||||
HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
|
||||
HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
|
||||
|
@ -589,11 +744,13 @@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
|
|||
HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
|
||||
HAVE_WINT_T = @HAVE_WINT_T@
|
||||
HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
|
||||
HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HOSTENT_LIB = @HOSTENT_LIB@
|
||||
HOSTNAME = @HOSTNAME@
|
||||
INCLUDE_NEXT = @INCLUDE_NEXT@
|
||||
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
|
||||
INET_NTOP_LIB = @INET_NTOP_LIB@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -603,6 +760,7 @@ INTLLIBS = @INTLLIBS@
|
|||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
KRBINCLUDE = @KRBINCLUDE@
|
||||
LD = @LD@
|
||||
LDAPINCLUDE = @LDAPINCLUDE@
|
||||
LDAPLIBS = @LDAPLIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
@ -614,7 +772,9 @@ LIBINTL = @LIBINTL@
|
|||
LIBOBJS = @LIBOBJS@
|
||||
# gettext docs say to use LDADD, but per module_LDADD override
|
||||
LIBS = @LTLIBINTL@ @LIBS@
|
||||
LIBSOCKET = @LIBSOCKET@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
LOCALE_FR = @LOCALE_FR@
|
||||
|
@ -634,25 +794,56 @@ MYSQLCFLAGS = @MYSQLCFLAGS@
|
|||
MYSQLINCLUDE = @MYSQLINCLUDE@
|
||||
MYSQLLIBS = @MYSQLLIBS@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
NETDB_H = @NETDB_H@
|
||||
NETINET_IN_H = @NETINET_IN_H@
|
||||
NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
|
||||
NEXT_ERRNO_H = @NEXT_ERRNO_H@
|
||||
NEXT_FCNTL_H = @NEXT_FCNTL_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_GETOPT_H = @NEXT_GETOPT_H@
|
||||
NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
|
||||
NEXT_LOCALE_H = @NEXT_LOCALE_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
NEXT_NETDB_H = @NEXT_NETDB_H@
|
||||
NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
|
||||
NEXT_STDDEF_H = @NEXT_STDDEF_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
NEXT_STDLIB_H = @NEXT_STDLIB_H@
|
||||
NEXT_STRING_H = @NEXT_STRING_H@
|
||||
NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
|
||||
NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
|
||||
NEXT_TIME_H = @NEXT_TIME_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NEXT_WCHAR_H = @NEXT_WCHAR_H@
|
||||
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NP_RELEASE = @NP_RELEASE@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
|
@ -692,32 +883,44 @@ POSUB = @POSUB@
|
|||
POW_LIB = @POW_LIB@
|
||||
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
|
||||
PST3CFLAGS = @PST3CFLAGS@
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
|
||||
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
|
||||
PYTHON = @PYTHON@
|
||||
RADIUSLIBS = @RADIUSLIBS@
|
||||
RANLIB = @RANLIB@
|
||||
RELEASE = @RELEASE@
|
||||
REPLACE_BTOWC = @REPLACE_BTOWC@
|
||||
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
|
||||
REPLACE_CEILF = @REPLACE_CEILF@
|
||||
REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_CLOSE = @REPLACE_CLOSE@
|
||||
REPLACE_DPRINTF = @REPLACE_DPRINTF@
|
||||
REPLACE_FCHDIR = @REPLACE_FCHDIR@
|
||||
REPLACE_DUP = @REPLACE_DUP@
|
||||
REPLACE_DUP2 = @REPLACE_DUP2@
|
||||
REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
|
||||
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
|
||||
REPLACE_FCLOSE = @REPLACE_FCLOSE@
|
||||
REPLACE_FCNTL = @REPLACE_FCNTL@
|
||||
REPLACE_FFLUSH = @REPLACE_FFLUSH@
|
||||
REPLACE_FLOORF = @REPLACE_FLOORF@
|
||||
REPLACE_FLOORL = @REPLACE_FLOORL@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FPURGE = @REPLACE_FPURGE@
|
||||
REPLACE_FREOPEN = @REPLACE_FREOPEN@
|
||||
REPLACE_FREXP = @REPLACE_FREXP@
|
||||
REPLACE_FREXPL = @REPLACE_FREXPL@
|
||||
REPLACE_FSEEK = @REPLACE_FSEEK@
|
||||
REPLACE_FSEEKO = @REPLACE_FSEEKO@
|
||||
REPLACE_FSTAT = @REPLACE_FSTAT@
|
||||
REPLACE_FSTATAT = @REPLACE_FSTATAT@
|
||||
REPLACE_FTELL = @REPLACE_FTELL@
|
||||
REPLACE_FTELLO = @REPLACE_FTELLO@
|
||||
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
|
||||
REPLACE_GETCWD = @REPLACE_GETCWD@
|
||||
REPLACE_GETDELIM = @REPLACE_GETDELIM@
|
||||
REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
|
||||
REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
|
@ -727,40 +930,75 @@ REPLACE_ISNAN = @REPLACE_ISNAN@
|
|||
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
|
||||
REPLACE_LCHOWN = @REPLACE_LCHOWN@
|
||||
REPLACE_LDEXPL = @REPLACE_LDEXPL@
|
||||
REPLACE_LINK = @REPLACE_LINK@
|
||||
REPLACE_LINKAT = @REPLACE_LINKAT@
|
||||
REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
|
||||
REPLACE_LSEEK = @REPLACE_LSEEK@
|
||||
REPLACE_LSTAT = @REPLACE_LSTAT@
|
||||
REPLACE_MBRLEN = @REPLACE_MBRLEN@
|
||||
REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
|
||||
REPLACE_MBSINIT = @REPLACE_MBSINIT@
|
||||
REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
|
||||
REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
|
||||
REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
|
||||
REPLACE_MEMCHR = @REPLACE_MEMCHR@
|
||||
REPLACE_MEMMEM = @REPLACE_MEMMEM@
|
||||
REPLACE_MKDIR = @REPLACE_MKDIR@
|
||||
REPLACE_MKFIFO = @REPLACE_MKFIFO@
|
||||
REPLACE_MKNOD = @REPLACE_MKNOD@
|
||||
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
|
||||
REPLACE_MKTIME = @REPLACE_MKTIME@
|
||||
REPLACE_NAN = @REPLACE_NAN@
|
||||
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
|
||||
REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
|
||||
REPLACE_NULL = @REPLACE_NULL@
|
||||
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
|
||||
REPLACE_OPEN = @REPLACE_OPEN@
|
||||
REPLACE_OPENAT = @REPLACE_OPENAT@
|
||||
REPLACE_PERROR = @REPLACE_PERROR@
|
||||
REPLACE_POPEN = @REPLACE_POPEN@
|
||||
REPLACE_PREAD = @REPLACE_PREAD@
|
||||
REPLACE_PRINTF = @REPLACE_PRINTF@
|
||||
REPLACE_PUTENV = @REPLACE_PUTENV@
|
||||
REPLACE_PWRITE = @REPLACE_PWRITE@
|
||||
REPLACE_READLINK = @REPLACE_READLINK@
|
||||
REPLACE_REALPATH = @REPLACE_REALPATH@
|
||||
REPLACE_REMOVE = @REPLACE_REMOVE@
|
||||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SLEEP = @REPLACE_SLEEP@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
REPLACE_STAT = @REPLACE_STAT@
|
||||
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
|
||||
REPLACE_STPNCPY = @REPLACE_STPNCPY@
|
||||
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
|
||||
REPLACE_STRDUP = @REPLACE_STRDUP@
|
||||
REPLACE_STRERROR = @REPLACE_STRERROR@
|
||||
REPLACE_STRPTIME = @REPLACE_STRPTIME@
|
||||
REPLACE_STRNCAT = @REPLACE_STRNCAT@
|
||||
REPLACE_STRNDUP = @REPLACE_STRNDUP@
|
||||
REPLACE_STRNLEN = @REPLACE_STRNLEN@
|
||||
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
|
||||
REPLACE_STRSTR = @REPLACE_STRSTR@
|
||||
REPLACE_STRTOD = @REPLACE_STRTOD@
|
||||
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
|
||||
REPLACE_SYMLINK = @REPLACE_SYMLINK@
|
||||
REPLACE_TIMEGM = @REPLACE_TIMEGM@
|
||||
REPLACE_TMPFILE = @REPLACE_TMPFILE@
|
||||
REPLACE_TRUNCL = @REPLACE_TRUNCL@
|
||||
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
|
||||
REPLACE_UNLINK = @REPLACE_UNLINK@
|
||||
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
|
||||
REPLACE_UNSETENV = @REPLACE_UNSETENV@
|
||||
REPLACE_USLEEP = @REPLACE_USLEEP@
|
||||
REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
|
||||
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
|
||||
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
|
||||
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
|
||||
|
@ -776,6 +1014,7 @@ REPLACE_WRITE = @REPLACE_WRITE@
|
|||
REV_DATESTAMP = @REV_DATESTAMP@
|
||||
REV_TIMESTAMP = @REV_TIMESTAMP@
|
||||
SCRIPT_TEST = @SCRIPT_TEST@
|
||||
SED = @SED@
|
||||
SERVENT_LIB = @SERVENT_LIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SH = @SH@
|
||||
|
@ -786,20 +1025,19 @@ SOCKETLIBS = @SOCKETLIBS@
|
|||
SSLINCLUDE = @SSLINCLUDE@
|
||||
SSLLIBS = @SSLLIBS@
|
||||
STDBOOL_H = @STDBOOL_H@
|
||||
STDDEF_H = @STDDEF_H@
|
||||
STDINT_H = @STDINT_H@
|
||||
STRIP = @STRIP@
|
||||
SUPPORT = @SUPPORT@
|
||||
SYS_SOCKET_H = @SYS_SOCKET_H@
|
||||
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
|
||||
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
|
||||
UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
|
||||
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
|
||||
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
VOID_UNSETENV = @VOID_UNSETENV@
|
||||
WARRANTY = @WARRANTY@
|
||||
WCHAR_H = @WCHAR_H@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
WCTYPE_H = @WCTYPE_H@
|
||||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
|
@ -809,8 +1047,7 @@ abs_srcdir = @abs_srcdir@
|
|||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -833,6 +1070,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
|
|||
gl_LTLIBOBJS = @gl_LTLIBOBJS@
|
||||
gltests_LIBOBJS = @gltests_LIBOBJS@
|
||||
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
|
||||
gltests_WITNESS = @gltests_WITNESS@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
|
@ -846,6 +1084,7 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = $(datadir)/locale
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
np_mysql_config = @np_mysql_config@
|
||||
|
@ -862,13 +1101,13 @@ target_alias = @target_alias@
|
|||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
with_trusted_path = @with_trusted_path@
|
||||
@RELEASE_PRESENT_TRUE@NP_VERSION = $(PACKAGE_VERSION)
|
||||
@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@
|
||||
AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
|
||||
INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@
|
||||
check_tcp_programs = check_ftp check_imap check_nntp check_pop \
|
||||
check_udp check_clamd @check_tcp_ssl@
|
||||
|
||||
EXTRA_DIST = t utils.c netutils.c sslutils.c popen.c utils.h netutils.h \
|
||||
EXTRA_DIST = t tests utils.c netutils.c sslutils.c popen.c utils.h netutils.h \
|
||||
popen.h common.h runcmd.c runcmd.h
|
||||
|
||||
PLUGINHDRS = common.h
|
||||
|
|
|
@ -411,10 +411,10 @@ print_help (void)
|
|||
|
||||
print_usage();
|
||||
|
||||
printf(_(UT_HELP_VRSN));
|
||||
printf(_(UT_EXTRA_OPTS));
|
||||
printf(UT_HELP_VRSN);
|
||||
printf(UT_EXTRA_OPTS);
|
||||
|
||||
printf(_(UT_TIMEOUT), timeout_interval);
|
||||
printf(UT_TIMEOUT, timeout_interval);
|
||||
|
||||
printf (" %s\n", "-U, --upgrade=OPTS");
|
||||
printf (" %s\n", _("[Default] Perform an upgrade. If an optional OPTS argument is provided,"));
|
||||
|
@ -453,13 +453,7 @@ print_help (void)
|
|||
printf (" %s\n", _("timeout (with -t) to prevent the plugin from timing out if apt-get"));
|
||||
printf (" %s\n", _("upgrade is expected to take longer than the default timeout."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf("\n");
|
||||
printf("%s\n", _("Notes:"));
|
||||
printf(_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf(_(UT_SUPPORT));
|
||||
printf(UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -467,6 +461,6 @@ print_help (void)
|
|||
void
|
||||
print_usage(void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [[-d|-u|-U]opts] [-n] [-t timeout]\n", progname);
|
||||
}
|
||||
|
|
|
@ -386,13 +386,13 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (UT_HELP_VRSN);
|
||||
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', "none");
|
||||
printf (UT_HOST_PORT, 'p', "none");
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-1, --proto1");
|
||||
printf (" %s\n", _("tell ssh to use Protocol 1 [optional]"));
|
||||
|
@ -420,9 +420,9 @@ print_help (void)
|
|||
printf (" %s\n", _("Call ssh with '-o OPTION' (may be used multiple times) [optional]"));
|
||||
printf (" %s\n","-q, --quiet");
|
||||
printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_WARN_CRIT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_VERBOSE);
|
||||
printf("\n");
|
||||
printf (" %s\n", _("The most common mode of use is to refer to a local identity file with"));
|
||||
printf (" %s\n", _("the '-i' option. In this mode, the identity pair should have a null"));
|
||||
|
@ -442,13 +442,7 @@ print_help (void)
|
|||
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
|
||||
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf("\n");
|
||||
printf("%s\n", _("Notes:"));
|
||||
printf(_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf(_(UT_SUPPORT));
|
||||
printf(UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -456,7 +450,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]\n"
|
||||
" [-S [lines]] [-E [lines]] [-t timeout] [-i identity]\n"
|
||||
" [-l user] [-n name] [-s servicelist] [-O outputfile]\n"
|
||||
|
|
|
@ -234,7 +234,7 @@ print_help(void)
|
|||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Options:"));
|
||||
printf(_(UT_EXTRA_OPTS));
|
||||
printf(UT_EXTRA_OPTS);
|
||||
printf (" %s\n", "-s, --service");
|
||||
printf (" %s\n", _("Check service cluster status"));
|
||||
printf (" %s\n", "-h, --host");
|
||||
|
@ -251,22 +251,19 @@ print_help(void)
|
|||
printf (" %s\n", _("The status codes of the hosts or services in the cluster, separated by"));
|
||||
printf (" %s\n", _("commas"));
|
||||
|
||||
printf(_(UT_VERBOSE));
|
||||
printf(UT_VERBOSE);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Notes:"));
|
||||
printf(_(UT_THRESHOLDS_NOTES));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
printf(UT_THRESHOLDS_NOTES);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Examples:"));
|
||||
printf (" %s\n", "check_cluster -s -d 2,0,2,0 -c @3:");
|
||||
printf (" %s\n", _("Will alert critical if there are 3 or more service data points in a non-OK state") );
|
||||
printf (" %s\n", _("Will alert critical if there are 3 or more service data points in a non-OK") );
|
||||
printf (" %s\n", _("state.") );
|
||||
|
||||
printf(_(UT_SUPPORT));
|
||||
printf(UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -274,7 +271,7 @@ void
|
|||
print_usage(void)
|
||||
{
|
||||
|
||||
printf(_("Usage:"));
|
||||
printf("%s\n", _("Usage:"));
|
||||
printf(" %s (-s | -h) -d val1[,val2,...,valn] [-l label]\n", progname);
|
||||
printf("[-w threshold] [-c threshold] [-v] [--help]\n");
|
||||
|
||||
|
|
|
@ -319,11 +319,11 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (UT_HELP_VRSN);
|
||||
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n","-l, --query_address=STRING");
|
||||
printf (" %s\n",_("Machine name to lookup"));
|
||||
|
@ -334,22 +334,16 @@ print_help (void)
|
|||
printf (" %s\n",_("was in -l"));
|
||||
printf (" %s\n","-A, --dig-arguments=STRING");
|
||||
printf (" %s\n",_("Pass STRING as argument(s) to dig"));
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_WARN_CRIT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Examples:"));
|
||||
printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\"");
|
||||
printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com");
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -357,7 +351,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -l <query_address> [-H <host>] [-p <server port>]\n", progname);
|
||||
printf (" [-T <query type>] [-w <warning interval>] [-c <critical interval>]\n");
|
||||
printf (" [-t <timeout>] [-a <expected answer address>] [-v]\n");
|
||||
|
|
|
@ -904,8 +904,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-w, --warning=INTEGER");
|
||||
printf (" %s\n", _("Exit with WARNING status if less than INTEGER units of disk are free"));
|
||||
|
@ -952,30 +952,24 @@ print_help (void)
|
|||
printf (" %s\n", _("Regular expression to ignore selected path/partition (case insensitive) (may be repeated)"));
|
||||
printf (" %s\n", "-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION");
|
||||
printf (" %s\n", _("Regular expression to ignore selected path or partition (may be repeated)"));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (" %s\n", "-u, --units=STRING");
|
||||
printf (" %s\n", _("Choose bytes, kB, MB, GB, TB (default: MB)"));
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
printf (" %s\n", "-X, --exclude-type=TYPE");
|
||||
printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Examples:"));
|
||||
printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /");
|
||||
printf (" %s\n", _("Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"));
|
||||
printf (" %s\n", "check_disk -w 100M -c 50M -C -w 1000M -c 500M -g sidDATA -r '^/oracle/SID/data.*$'");
|
||||
printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -g sidDATA -r '^/oracle/SID/data.*$'");
|
||||
printf (" %s\n", _("Checks all filesystems not matching -r at 100M and 50M. The fs matching the -r regex"));
|
||||
printf (" %s\n", _("are grouped which means the freespace thresholds are applied to all disks together"));
|
||||
printf (" %s\n", "check_disk -w 100M -c 50M -C -w 1000M -c 500M -p /foo -C -w 5% -c 3% -p /bar");
|
||||
printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -p /foo -C -w 5% -c 3% -p /bar");
|
||||
printf (" %s\n", _("Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use 100M/50M"));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -983,7 +977,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s -w limit -c limit [-W limit] [-K limit] {-p path | -x device}\n", progname);
|
||||
printf ("[-C] [-E] [-e] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n");
|
||||
printf ("[-t timeout] [-u unit] [-v] [-X type]\n");
|
||||
|
|
|
@ -455,8 +455,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" -H, --hostname=HOST\n");
|
||||
printf (" %s\n", _("The name or address you want to query"));
|
||||
|
@ -474,21 +474,15 @@ print_help (void)
|
|||
printf (" -c, --critical=seconds\n");
|
||||
printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-s server] [-a expected-address] [-A] [-t timeout] [-w warn] [-c crit]\n", progname);
|
||||
}
|
||||
|
|
|
@ -109,9 +109,9 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (UT_HELP_VRSN);
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,6 +119,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s <integer state> [optional text]\n", progname);
|
||||
}
|
||||
|
|
|
@ -399,8 +399,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-H, --hostname=HOST");
|
||||
printf (" %s\n", _("name or IP Address of host to ping (IP Address bypasses name lookup, reducing system load)"));
|
||||
|
@ -416,25 +416,19 @@ print_help (void)
|
|||
printf (" %s (default: fping's default for -t)\n", _("Target timeout (ms)"),PACKET_COUNT);
|
||||
printf (" %s\n", "-i, --interval=INTEGER");
|
||||
printf (" %s (default: fping's default for -p)\n", _("Interval (ms) between sending packets"),PACKET_COUNT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
printf ("\n");
|
||||
printf (" %s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time (ms)"));
|
||||
printf (" %s\n", _("which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"));
|
||||
printf (" %s\n", _("packet loss to trigger an alarm state."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s <host_address> -w limit -c limit [-b size] [-n number] [-T number] [-i number]\n", progname);
|
||||
}
|
||||
|
|
|
@ -300,8 +300,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-p");
|
||||
printf (" %s\n", _("Optional port of which to connect"));
|
||||
|
@ -312,19 +312,15 @@ print_help (void)
|
|||
printf (" %s\n", "-pf");
|
||||
printf (" %s\n", _("Field number in raw qstat output that contains ping time"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (" %s\n", _("This plugin uses the 'qstat' command, the popular game server status query tool."));
|
||||
printf (" %s\n", _("If you don't have the package installed, you will need to download it from"));
|
||||
printf (" %s\n", _("http://www.activesw.com/people/steve/qstat.html before you can use this plugin."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -332,8 +328,8 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf (" %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field] [-pf ping_field]\n", progname);
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s [-hvV] [-P port] [-t timeout] [-g game_field] [-m map_field] [-p ping_field] [-G game-time] [-H hostname] <game> <ip_address>\n", progname);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -395,21 +395,15 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-C, --community=STRING");
|
||||
printf (" %s", _("The SNMP community name "));
|
||||
printf (_("(default=%s)"), DEFAULT_COMMUNITY);
|
||||
printf ("\n");
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -417,6 +411,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-C community]\n", progname);
|
||||
}
|
||||
|
|
|
@ -100,17 +100,20 @@ int server_url_length;
|
|||
int server_expect_yn = 0;
|
||||
char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT;
|
||||
char string_expect[MAX_INPUT_BUFFER] = "";
|
||||
char output_string_search[30] = "";
|
||||
double warning_time = 0;
|
||||
int check_warning_time = FALSE;
|
||||
double critical_time = 0;
|
||||
int check_critical_time = FALSE;
|
||||
char user_auth[MAX_INPUT_BUFFER] = "";
|
||||
char proxy_auth[MAX_INPUT_BUFFER] = "";
|
||||
int display_html = FALSE;
|
||||
char **http_opt_headers;
|
||||
int http_opt_headers_count = 0;
|
||||
int onredirect = STATE_OK;
|
||||
int followsticky = STICKY_NONE;
|
||||
int use_ssl = FALSE;
|
||||
int use_sni = FALSE;
|
||||
int verbose = FALSE;
|
||||
int sd;
|
||||
int min_page_len = 0;
|
||||
|
@ -177,7 +180,8 @@ process_arguments (int argc, char **argv)
|
|||
char *p;
|
||||
|
||||
enum {
|
||||
INVERT_REGEX = CHAR_MAX + 1
|
||||
INVERT_REGEX = CHAR_MAX + 1,
|
||||
SNI_OPTION
|
||||
};
|
||||
|
||||
int option = 0;
|
||||
|
@ -186,12 +190,14 @@ process_arguments (int argc, char **argv)
|
|||
{"link", no_argument, 0, 'L'},
|
||||
{"nohtml", no_argument, 0, 'n'},
|
||||
{"ssl", no_argument, 0, 'S'},
|
||||
{"sni", no_argument, 0, SNI_OPTION},
|
||||
{"post", required_argument, 0, 'P'},
|
||||
{"method", required_argument, 0, 'j'},
|
||||
{"IP-address", required_argument, 0, 'I'},
|
||||
{"url", required_argument, 0, 'u'},
|
||||
{"port", required_argument, 0, 'p'},
|
||||
{"authorization", required_argument, 0, 'a'},
|
||||
{"proxy_authorization", required_argument, 0, 'b'},
|
||||
{"string", required_argument, 0, 's'},
|
||||
{"expect", required_argument, 0, 'e'},
|
||||
{"regex", required_argument, 0, 'r'},
|
||||
|
@ -229,7 +235,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
|
||||
c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
@ -302,6 +308,9 @@ process_arguments (int argc, char **argv)
|
|||
if (specify_port == FALSE)
|
||||
server_port = HTTPS_PORT;
|
||||
break;
|
||||
case SNI_OPTION:
|
||||
use_sni = TRUE;
|
||||
break;
|
||||
case 'f': /* onredirect */
|
||||
if (!strcmp (optarg, "stickyport"))
|
||||
onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST|STICKY_PORT;
|
||||
|
@ -350,6 +359,10 @@ process_arguments (int argc, char **argv)
|
|||
strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
|
||||
user_auth[MAX_INPUT_BUFFER - 1] = 0;
|
||||
break;
|
||||
case 'b': /* proxy-authorization info */
|
||||
strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1);
|
||||
proxy_auth[MAX_INPUT_BUFFER - 1] = 0;
|
||||
break;
|
||||
case 'P': /* HTTP POST data in URL encoded format; ignored if settings already */
|
||||
if (! http_post_data)
|
||||
http_post_data = strdup (optarg);
|
||||
|
@ -721,7 +734,10 @@ get_content_length (const char *headers)
|
|||
/* Skip to the end of the header, including continuation lines. */
|
||||
while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t')))
|
||||
s++;
|
||||
s++;
|
||||
|
||||
/* Avoid stepping over end-of-string marker */
|
||||
if (*s)
|
||||
s++;
|
||||
|
||||
/* Process this header. */
|
||||
if (value && value > field+2) {
|
||||
|
@ -778,6 +794,7 @@ check_http (void)
|
|||
int i = 0;
|
||||
size_t pagesize = 0;
|
||||
char *full_page;
|
||||
char *full_page_new;
|
||||
char *buf;
|
||||
char *pos;
|
||||
long microsec;
|
||||
|
@ -790,7 +807,7 @@ check_http (void)
|
|||
die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n"));
|
||||
#ifdef HAVE_SSL
|
||||
if (use_ssl == TRUE) {
|
||||
np_net_ssl_init_with_hostname(sd, host_name);
|
||||
np_net_ssl_init_with_hostname(sd, (use_sni ? host_name : NULL));
|
||||
if (check_cert == TRUE) {
|
||||
result = np_net_ssl_check_cert(days_till_exp);
|
||||
np_net_ssl_cleanup();
|
||||
|
@ -836,6 +853,12 @@ check_http (void)
|
|||
asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth);
|
||||
}
|
||||
|
||||
/* optionally send the proxy authentication info */
|
||||
if (strlen(proxy_auth)) {
|
||||
base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
|
||||
asprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
|
||||
}
|
||||
|
||||
/* either send http POST data (any data, not only POST)*/
|
||||
if (http_post_data) {
|
||||
if (http_content_type) {
|
||||
|
@ -859,7 +882,9 @@ check_http (void)
|
|||
full_page = strdup("");
|
||||
while ((i = my_recv (buffer, MAX_INPUT_BUFFER-1)) > 0) {
|
||||
buffer[i] = '\0';
|
||||
asprintf (&full_page, "%s%s", full_page, buffer);
|
||||
asprintf (&full_page_new, "%s%s", full_page, buffer);
|
||||
free (full_page);
|
||||
full_page = full_page_new;
|
||||
pagesize += i;
|
||||
|
||||
if (no_body && document_headers_done (full_page)) {
|
||||
|
@ -1013,7 +1038,11 @@ check_http (void)
|
|||
|
||||
if (strlen (string_expect)) {
|
||||
if (!strstr (page, string_expect)) {
|
||||
asprintf (&msg, _("%sstring not found, "), msg);
|
||||
strncpy(&output_string_search[0],string_expect,sizeof(output_string_search));
|
||||
if(output_string_search[sizeof(output_string_search)-1]!='\0') {
|
||||
bcopy("...",&output_string_search[sizeof(output_string_search)-4],4);
|
||||
}
|
||||
asprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url);
|
||||
result = STATE_CRITICAL;
|
||||
}
|
||||
}
|
||||
|
@ -1291,8 +1320,8 @@ print_help (void)
|
|||
|
||||
printf ("\n");
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-H, --hostname=ADDRESS");
|
||||
printf (" %s\n", _("Host name argument for servers using host headers (virtual host)"));
|
||||
|
@ -1303,11 +1332,13 @@ print_help (void)
|
|||
printf (" %s", _("Port number (default: "));
|
||||
printf ("%d)\n", HTTP_PORT);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
printf (" %s\n", "-S, --ssl");
|
||||
printf (" %s\n", _("Connect via SSL. Port defaults to 443"));
|
||||
printf (" %s\n", "--sni");
|
||||
printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
|
||||
printf (" %s\n", "-C, --certificate=INTEGER");
|
||||
printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443"));
|
||||
printf (" %s\n", _("(when this option is used the URL is not checked.)\n"));
|
||||
|
@ -1346,6 +1377,8 @@ print_help (void)
|
|||
|
||||
printf (" %s\n", "-a, --authorization=AUTH_PAIR");
|
||||
printf (" %s\n", _("Username:password on sites with basic authentication"));
|
||||
printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
|
||||
printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
|
||||
printf (" %s\n", "-A, --useragent=STRING");
|
||||
printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
|
||||
printf (" %s\n", "-k, --header=STRING");
|
||||
|
@ -1358,11 +1391,11 @@ print_help (void)
|
|||
printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>");
|
||||
printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)"));
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
|
@ -1372,8 +1405,6 @@ print_help (void)
|
|||
printf (" %s\n", _("messages from the host result in STATE_WARNING return values. If you are"));
|
||||
printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
|
||||
printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
printf ("\n");
|
||||
|
@ -1395,7 +1426,7 @@ print_help (void)
|
|||
printf (" %s\n", _("the certificate is expired."));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1404,11 +1435,12 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n",progname);
|
||||
printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n");
|
||||
printf (" [-a auth] [-f <ok | warn | critcal | follow | sticky | stickyport>]\n");
|
||||
printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-a auth]\n");
|
||||
printf (" [-b proxy_auth] [-f <ok|warning|critcal|follow|sticky|stickyport>]\n");
|
||||
printf (" [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
|
||||
printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
|
||||
printf (" [-A string] [-k string] [-S] [-C <age>] [-T <content-type>] [-j method]\n");
|
||||
printf (" [-A string] [-k string] [-S] [--sni] [-C <age>] [-T <content-type>]\n");
|
||||
printf (" [-j method]\n");
|
||||
}
|
||||
|
|
|
@ -158,9 +158,6 @@ main (int argc, char *argv[])
|
|||
values_t values;
|
||||
int fd;
|
||||
|
||||
/* Parse extra opts if any */
|
||||
argv=np_extra_opts (&argc, argv, progname);
|
||||
|
||||
static struct option longopts[] = {
|
||||
{"device", required_argument, 0, 'd'},
|
||||
{"immediate", no_argument, 0, 'i'},
|
||||
|
@ -173,6 +170,9 @@ main (int argc, char *argv[])
|
|||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* Parse extra opts if any */
|
||||
argv=np_extra_opts (&argc, argv, progname);
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
@ -489,8 +489,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-d, --device=DEVICE");
|
||||
printf (" %s\n", _("Select device DEVICE"));
|
||||
|
@ -506,13 +506,7 @@ print_help (void)
|
|||
printf (" %s\n", "-n, --nagios");
|
||||
printf (" %s\n", _("Output suitable for Nagios"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
/* todo : add to the long nanual as example
|
||||
|
@ -530,7 +524,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-d <device>] [-i <immediate>] [-q quiet] [-1 <auto-on>]",progname);
|
||||
printf (" [-O <auto-off>] [-n <nagios>]\n");
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
|||
#include "utils.h"
|
||||
|
||||
#include <lber.h>
|
||||
#define LDAP_DEPRECATED 1
|
||||
#include <ldap.h>
|
||||
|
||||
enum {
|
||||
|
@ -373,7 +374,7 @@ validate_arguments ()
|
|||
if (ld_host==NULL || strlen(ld_host)==0)
|
||||
usage4 (_("Please specify the host name\n"));
|
||||
|
||||
if (ld_base==NULL || strlen(ld_base)==0)
|
||||
if (ld_base==NULL)
|
||||
usage4 (_("Please specify the LDAP base\n"));
|
||||
|
||||
return OK;
|
||||
|
@ -395,12 +396,12 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-a [--attr]");
|
||||
printf (" %s\n", _("ldap attribute to search (default: \"(objectclass=*)\""));
|
||||
|
@ -423,11 +424,11 @@ print_help (void)
|
|||
printf (" (%s %d)\n", _("default protocol version:"), DEFAULT_PROTOCOL);
|
||||
#endif
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
|
@ -436,12 +437,8 @@ print_help (void)
|
|||
printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called."));
|
||||
printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags"));
|
||||
printf (" %s\n", _("to define the behaviour explicitly instead."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
/* todo
|
||||
|
@ -452,7 +449,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]",progname);
|
||||
printf ("\n [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n",
|
||||
#ifdef HAVE_LDAP_SET_OPTION
|
||||
|
|
|
@ -305,8 +305,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-w, --warning=WLOAD1,WLOAD5,WLOAD15");
|
||||
printf (" %s\n", _("Exit with WARNING status if load average exceeds WLOADn"));
|
||||
|
@ -316,18 +316,12 @@ print_help (void)
|
|||
printf (" %s\n", "-r, --percpu");
|
||||
printf (" %s\n", _("Divide the load averages by the number of CPUs (when possible)"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n", progname);
|
||||
}
|
||||
|
|
|
@ -325,8 +325,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-F, --logfile=FILE");
|
||||
printf (" %s\n", _("The MRTG log file containing the data you want to monitor"));
|
||||
|
@ -367,11 +367,8 @@ print_help (void)
|
|||
printf (" %s\n", _("you can always hack the code to make this plugin work for you..."));
|
||||
printf (" %s\n", _("- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded from"));
|
||||
printf (" %s\n", "http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html");
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -382,7 +379,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n",progname);
|
||||
printf ("[-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n");
|
||||
}
|
||||
|
|
|
@ -343,8 +343,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-F, --filename=STRING");
|
||||
printf (" %s\n", _("File to read log from"));
|
||||
|
@ -366,11 +366,8 @@ print_help (void)
|
|||
printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually"));
|
||||
printf (" %s\n", _(" reports. I'm not sure why this is right now, but will look into it"));
|
||||
printf (" %s\n", _(" for future enhancements of this plugin."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -381,10 +381,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'P', myport);
|
||||
printf (UT_HOST_PORT, 'P', myport);
|
||||
printf (" %s\n", "-s, --socket=STRING");
|
||||
printf (" %s\n", _("Use the specified socket (has no effect if -H is used)"));
|
||||
|
||||
|
@ -410,23 +410,19 @@ print_help (void)
|
|||
printf (" %s\n", _("using the default unix socket. You can force TCP on localhost by using an"));
|
||||
printf (" %s\n", _("IP address or FQDN ('localhost' will use the socket as well)."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
printf ("\n");
|
||||
printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
|
||||
printf (" %s\n", _("overriding any my.cnf settings."));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s [-d database] [-H host] [-P port] [-s socket]\n",progname);
|
||||
printf (" [-u user] [-p password] [-S]\n");
|
||||
}
|
||||
|
|
|
@ -289,12 +289,12 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
printf (" -q, --query=STRING\n");
|
||||
printf (" %s\n", _("SQL query to run. Only first column in first row will be read"));
|
||||
printf (_(UT_WARN_CRIT_RANGE));
|
||||
printf (_(UT_HOST_PORT), 'P', myport);
|
||||
printf (UT_WARN_CRIT_RANGE);
|
||||
printf (UT_HOST_PORT, 'P', myport);
|
||||
printf (" %s\n", "-s, --socket=STRING");
|
||||
printf (" %s\n", _("Use the specified socket (has no effect if -H is used)"));
|
||||
printf (" -d, --database=STRING\n");
|
||||
|
@ -310,23 +310,19 @@ print_help (void)
|
|||
printf (" %s\n", _("A query is required. The result from the query should be numeric."));
|
||||
printf (" %s\n", _("For extra security, create a user with minimal access."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
printf ("\n");
|
||||
printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
|
||||
printf (" %s\n", _("overriding any my.cnf settings."));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf (" %s -q SQL_query [-w warn] [-c crit] [-H host] [-P port] [-s socket]\n",progname);
|
||||
printf (" [-d database] [-u user] [-p password]\n");
|
||||
}
|
||||
|
|
|
@ -287,8 +287,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-F, --filename=FILE");
|
||||
printf (" %s\n", _("Name of the log file to check"));
|
||||
|
@ -296,19 +296,13 @@ print_help (void)
|
|||
printf (" %s\n", _("Minutes aging after which logfile is considered stale"));
|
||||
printf (" %s\n", "-C, --command=STRING");
|
||||
printf (" %s\n", _("Substring to search for in process arguments"));
|
||||
printf (_(UT_VERBOSE));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Examples:"));
|
||||
printf (" %s\n", "check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios");
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,6 +310,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -F <status log file> -e <expire_minutes> -C <process_string>\n", progname);
|
||||
}
|
||||
|
|
|
@ -655,8 +655,8 @@ void print_help(void)
|
|||
|
||||
print_usage();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf ("%s\n", _("Options:"));
|
||||
printf (" %s\n", "-H, --hostname=HOST");
|
||||
|
@ -748,18 +748,15 @@ void print_help(void)
|
|||
printf (" %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
|
||||
printf (" %s\n", _("One fix for this is to change the port to something else on check_nt "));
|
||||
printf (" %s\n", _("and on the client service it\'s connecting to."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void print_usage(void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
|
||||
printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
|
||||
}
|
||||
|
|
|
@ -842,9 +842,9 @@ void print_help(void){
|
|||
printf ("\n\n");
|
||||
|
||||
print_usage();
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (_(UT_HOST_PORT), 'p', "123");
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
printf (UT_HOST_PORT, 'p', "123");
|
||||
printf (" %s\n", "-w, --warning=THRESHOLD");
|
||||
printf (" %s\n", _("Offset to result in warning status (seconds)"));
|
||||
printf (" %s\n", "-c, --critical=THRESHOLD");
|
||||
|
@ -853,16 +853,12 @@ void print_help(void){
|
|||
printf (" %s\n", _("Warning threshold for jitter"));
|
||||
printf (" %s\n", "-k, --jcrit=THRESHOLD");
|
||||
printf (" %s\n", _("Critical threshold for jitter"));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Notes:"));
|
||||
printf(_(UT_THRESHOLDS_NOTES));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf("\n");
|
||||
printf(_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
printf(UT_THRESHOLDS_NOTES);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Examples:"));
|
||||
|
@ -873,17 +869,17 @@ void print_help(void){
|
|||
printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
|
||||
printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
|
||||
printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
|
||||
printf ("%s\n\n", _("check_ntp_time istead."));
|
||||
printf ("%s\n\n", _("check_ntp_time instead."));
|
||||
}
|
||||
|
||||
void
|
||||
print_usage(void)
|
||||
{
|
||||
printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
|
||||
printf ("%s\n\n", _("check_ntp_time istead."));
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n\n", _("check_ntp_time instead."));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n", progname);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ static char *scrit="-1:16";
|
|||
static short do_jitter=0;
|
||||
static char *jwarn="-1:5000";
|
||||
static char *jcrit="-1:10000";
|
||||
static short do_truechimers=0;
|
||||
static char *twarn="0:";
|
||||
static char *tcrit="0:";
|
||||
static int syncsource_found=0;
|
||||
static int li_alarm=0;
|
||||
|
||||
|
@ -63,6 +66,7 @@ int process_arguments (int, char **);
|
|||
thresholds *offset_thresholds = NULL;
|
||||
thresholds *jitter_thresholds = NULL;
|
||||
thresholds *stratum_thresholds = NULL;
|
||||
thresholds *truechimer_thresholds = NULL;
|
||||
void print_help (void);
|
||||
void print_usage (void);
|
||||
|
||||
|
@ -121,6 +125,7 @@ typedef struct {
|
|||
#define OP_READVAR 0x02
|
||||
/* In peer status bytes, bits 6,7,8 determine clock selection status */
|
||||
#define PEER_SEL(x) ((ntohs(x)>>8)&0x07)
|
||||
#define PEER_TRUECHIMER 0x02
|
||||
#define PEER_INCLUDED 0x04
|
||||
#define PEER_SYNCSOURCE 0x06
|
||||
|
||||
|
@ -160,12 +165,12 @@ void print_ntp_control_message(const ntp_control_message *p){
|
|||
for(i=0;i<numpeers;i++){
|
||||
printf("\tpeer id %.2x status %.2x",
|
||||
ntohs(peer[i].assoc), ntohs(peer[i].status));
|
||||
if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){
|
||||
if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){
|
||||
printf(" <-- current sync source");
|
||||
} else {
|
||||
printf(" <-- current sync candidate");
|
||||
}
|
||||
if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){
|
||||
printf(" <-- current sync source");
|
||||
} else if(PEER_SEL(peer[i].status) >= PEER_INCLUDED){
|
||||
printf(" <-- current sync candidate");
|
||||
} else if(PEER_SEL(peer[i].status) >= PEER_TRUECHIMER){
|
||||
printf(" <-- outlyer, but truechimer");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -194,7 +199,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
|
|||
* status is pretty much useless as syncsource_found is a global variable
|
||||
* used later in main to check is the server was synchronized. It works
|
||||
* so I left it alone */
|
||||
int ntp_request(const char *host, double *offset, int *offset_result, double *jitter, int *stratum){
|
||||
int ntp_request(const char *host, double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){
|
||||
int conn=-1, i, npeers=0, num_candidates=0;
|
||||
double tmp_offset = 0;
|
||||
int min_peer_sel=PEER_INCLUDED;
|
||||
|
@ -209,6 +214,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
|
|||
status = STATE_OK;
|
||||
*offset_result = STATE_UNKNOWN;
|
||||
*jitter = *stratum = -1;
|
||||
*num_truechimers = 0;
|
||||
|
||||
/* Long-winded explanation:
|
||||
* Getting the sync peer offset, jitter and stratum requires a number of
|
||||
|
@ -261,15 +267,18 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
|
|||
* at least some candidates. In the latter case we'll issue
|
||||
* a warning but go ahead with the check on them. */
|
||||
for (i = 0; i < npeers; i++){
|
||||
if (PEER_SEL(peers[i].status) >= PEER_INCLUDED){
|
||||
num_candidates++;
|
||||
if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
|
||||
syncsource_found=1;
|
||||
min_peer_sel=PEER_SYNCSOURCE;
|
||||
if(PEER_SEL(peers[i].status) >= PEER_TRUECHIMER){
|
||||
(*num_truechimers)++;
|
||||
if(PEER_SEL(peers[i].status) >= PEER_INCLUDED){
|
||||
num_candidates++;
|
||||
if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
|
||||
syncsource_found=1;
|
||||
min_peer_sel=PEER_SYNCSOURCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(verbose) printf("%d candiate peers available\n", num_candidates);
|
||||
if(verbose) printf("%d candidate peers available\n", num_candidates);
|
||||
if(verbose && syncsource_found) printf("synchronization source found\n");
|
||||
if(! syncsource_found){
|
||||
status = STATE_WARNING;
|
||||
|
@ -413,6 +422,8 @@ int process_arguments(int argc, char **argv){
|
|||
{"scrit", required_argument, 0, 'C'},
|
||||
{"jwarn", required_argument, 0, 'j'},
|
||||
{"jcrit", required_argument, 0, 'k'},
|
||||
{"twarn", required_argument, 0, 'm'},
|
||||
{"tcrit", required_argument, 0, 'n'},
|
||||
{"timeout", required_argument, 0, 't'},
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
{"port", required_argument, 0, 'p'},
|
||||
|
@ -424,7 +435,7 @@ int process_arguments(int argc, char **argv){
|
|||
usage ("\n");
|
||||
|
||||
while (1) {
|
||||
c = getopt_long (argc, argv, "Vhv46qw:c:W:C:j:k:t:H:p:", longopts, &option);
|
||||
c = getopt_long (argc, argv, "Vhv46qw:c:W:C:j:k:m:n:t:H:p:", longopts, &option);
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
||||
|
@ -467,6 +478,14 @@ int process_arguments(int argc, char **argv){
|
|||
do_jitter=1;
|
||||
jcrit = optarg;
|
||||
break;
|
||||
case 'm':
|
||||
do_truechimers=1;
|
||||
twarn = optarg;
|
||||
break;
|
||||
case 'n':
|
||||
do_truechimers=1;
|
||||
tcrit = optarg;
|
||||
break;
|
||||
case 'H':
|
||||
if(is_host(optarg) == FALSE)
|
||||
usage2(_("Invalid hostname/address"), optarg);
|
||||
|
@ -526,8 +545,16 @@ char *perfd_stratum (int stratum)
|
|||
TRUE, 0, TRUE, 16);
|
||||
}
|
||||
|
||||
char *perfd_truechimers (int num_truechimers)
|
||||
{
|
||||
return perfdata ("truechimers", num_truechimers, "",
|
||||
do_truechimers, (int)truechimer_thresholds->warning->end,
|
||||
do_truechimers, (int)truechimer_thresholds->critical->end,
|
||||
TRUE, 0, FALSE, 0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
int result, offset_result, stratum;
|
||||
int result, offset_result, stratum, num_truechimers;
|
||||
double offset=0, jitter=0;
|
||||
char *result_line, *perfdata_line;
|
||||
|
||||
|
@ -544,6 +571,7 @@ int main(int argc, char *argv[]){
|
|||
set_thresholds(&offset_thresholds, owarn, ocrit);
|
||||
set_thresholds(&jitter_thresholds, jwarn, jcrit);
|
||||
set_thresholds(&stratum_thresholds, swarn, scrit);
|
||||
set_thresholds(&truechimer_thresholds, twarn, tcrit);
|
||||
|
||||
/* initialize alarm signal handling */
|
||||
signal (SIGALRM, socket_timeout_alarm_handler);
|
||||
|
@ -552,7 +580,7 @@ int main(int argc, char *argv[]){
|
|||
alarm (socket_timeout);
|
||||
|
||||
/* This returns either OK or WARNING (See comment preceeding ntp_request) */
|
||||
result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum);
|
||||
result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum, &num_truechimers);
|
||||
|
||||
if(offset_result == STATE_UNKNOWN) {
|
||||
/* if there's no sync peer (this overrides ntp_request output): */
|
||||
|
@ -564,6 +592,9 @@ int main(int argc, char *argv[]){
|
|||
result = max_state_alt(result, get_status(fabs(offset), offset_thresholds));
|
||||
}
|
||||
|
||||
if(do_truechimers)
|
||||
result = max_state_alt(result, get_status(num_truechimers, truechimer_thresholds));
|
||||
|
||||
if(do_stratum)
|
||||
result = max_state_alt(result, get_status(stratum, stratum_thresholds));
|
||||
|
||||
|
@ -604,6 +635,10 @@ int main(int argc, char *argv[]){
|
|||
asprintf(&result_line, "%s, stratum=%i", result_line, stratum);
|
||||
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_stratum(stratum));
|
||||
}
|
||||
if (do_truechimers) {
|
||||
asprintf(&result_line, "%s, truechimers=%i", result_line, num_truechimers);
|
||||
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_truechimers(num_truechimers));
|
||||
}
|
||||
printf("%s|%s\n", result_line, perfdata_line);
|
||||
|
||||
if(server_address!=NULL) free(server_address);
|
||||
|
@ -623,9 +658,9 @@ void print_help(void){
|
|||
printf ("\n\n");
|
||||
|
||||
print_usage();
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (_(UT_HOST_PORT), 'p', "123");
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
printf (UT_HOST_PORT, 'p', "123");
|
||||
printf (" %s\n", "-q, --quiet");
|
||||
printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"));
|
||||
printf (" %s\n", "-w, --warning=THRESHOLD");
|
||||
|
@ -640,8 +675,12 @@ void print_help(void){
|
|||
printf (" %s\n", _("Warning threshold for jitter"));
|
||||
printf (" %s\n", "-k, --jcrit=THRESHOLD");
|
||||
printf (" %s\n", _("Critical threshold for jitter"));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (" %s\n", "-m, --twarn=THRESHOLD");
|
||||
printf (" %s\n", _("Warning threshold for number of usable time sources (\"truechimers\")"));
|
||||
printf (" %s\n", "-n, --tcrit=THRESHOLD");
|
||||
printf (" %s\n", _("Critical threshold for number of usable time sources (\"truechimers\")"));
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("This plugin checks an NTP server independent of any commandline"));
|
||||
|
@ -653,11 +692,7 @@ void print_help(void){
|
|||
printf(" %s\n", _("plugin will not check the clock offset between the local host and NTP"));
|
||||
printf(" %s\n", _("server; please use check_ntp_time for that purpose."));
|
||||
printf("\n");
|
||||
printf(_(UT_THRESHOLDS_NOTES));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf("\n");
|
||||
printf(_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
printf(UT_THRESHOLDS_NOTES);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Examples:"));
|
||||
|
@ -668,16 +703,19 @@ void print_help(void){
|
|||
printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
|
||||
printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
|
||||
printf("\n");
|
||||
printf(" %s\n", _("Only check the number of usable time sources (\"truechimers\"):"));
|
||||
printf(" %s\n", ("./check_ntp_peer -H ntpserv -m :5 -n :3"));
|
||||
printf("\n");
|
||||
printf(" %s\n", _("Check only stratum:"));
|
||||
printf(" %s\n", ("./check_ntp_peer -H ntpserv -W 4 -C 6"));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage(void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
|
||||
printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
|
||||
}
|
||||
|
|
|
@ -600,17 +600,17 @@ void print_help(void){
|
|||
printf ("\n\n");
|
||||
|
||||
print_usage();
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (_(UT_HOST_PORT), 'p', "123");
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
printf (UT_HOST_PORT, 'p', "123");
|
||||
printf (" %s\n", "-q, --quiet");
|
||||
printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found"));
|
||||
printf (" %s\n", "-w, --warning=THRESHOLD");
|
||||
printf (" %s\n", _("Offset to result in warning status (seconds)"));
|
||||
printf (" %s\n", "-c, --critical=THRESHOLD");
|
||||
printf (" %s\n", _("Offset to result in critical status (seconds)"));
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("This plugin checks the clock offset between the local host and a"));
|
||||
|
@ -622,23 +622,19 @@ void print_help(void){
|
|||
printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use"));
|
||||
printf(" %s\n", _("check_ntp_peer."));
|
||||
printf("\n");
|
||||
printf(_(UT_THRESHOLDS_NOTES));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf("\n");
|
||||
printf(_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
printf(UT_THRESHOLDS_NOTES);
|
||||
|
||||
printf("\n");
|
||||
printf("%s\n", _("Examples:"));
|
||||
printf(" %s\n", ("./check_ntp_time -H ntpserv -w 0.5 -c 1"));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage(void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-v verbose]\n", progname);
|
||||
}
|
||||
|
||||
|
|
|
@ -1605,10 +1605,10 @@ void print_help(void)
|
|||
|
||||
print_usage();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n", "-v, --variable=STRING");
|
||||
printf (" %s\n", _("Variable to check. Valid variables include:"));
|
||||
|
@ -1664,7 +1664,7 @@ void print_help(void)
|
|||
printf (" %s\n", "-o, --osversion");
|
||||
printf (" %s\n", _("Include server version string in results"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
|
@ -1674,17 +1674,14 @@ void print_help(void)
|
|||
printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds"));
|
||||
printf (" %s\n", _(" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "));
|
||||
printf (" %s\n", _(" TCB, LRUS and LRUM."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void print_usage(void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n",progname);
|
||||
}
|
||||
|
|
|
@ -423,10 +423,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n", "-w, --warning=INTEGER");
|
||||
printf (" %s\n", _("Threshold which will result in a warning status"));
|
||||
|
@ -442,9 +442,9 @@ print_help (void)
|
|||
printf (" %s\n", _("NET<port> = number of active connections on TCP port <port>"));
|
||||
printf (" %s\n", _("UPTIME = system uptime in seconds"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("This plugin requires that Eric Molitors' Over-CR collector daemon be"));
|
||||
|
@ -456,18 +456,14 @@ print_help (void)
|
|||
printf ("%s\n", _("Notes:"));
|
||||
printf (" %s\n", _("For the available options, the critical threshold value should always be"));
|
||||
printf (" %s\n", _("higher than the warning threshold value, EXCEPT with the uptime variable"));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n", progname);
|
||||
}
|
||||
|
|
|
@ -429,12 +429,12 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'P', myport);
|
||||
printf (UT_HOST_PORT, 'P', myport);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-d, --database=STRING");
|
||||
printf (" %s", _("Database to check "));
|
||||
|
@ -444,11 +444,11 @@ print_help (void)
|
|||
printf (" %s\n", "-p, --password = STRING");
|
||||
printf (" %s\n", _("Password (BIG SECURITY ISSUE)"));
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf (" %s\n", _("All parameters are optional."));
|
||||
|
@ -466,13 +466,7 @@ print_help (void)
|
|||
printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
|
||||
printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -480,7 +474,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n", progname);
|
||||
printf (" [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n");
|
||||
}
|
||||
|
|
|
@ -562,10 +562,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-H, --hostname=HOST");
|
||||
printf (" %s\n", _("host to ping"));
|
||||
|
@ -579,7 +579,7 @@ print_help (void)
|
|||
printf (" %s\n", "-L, --link");
|
||||
printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"));
|
||||
|
@ -592,19 +592,13 @@ print_help (void)
|
|||
printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
|
||||
printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname);
|
||||
printf (" [-p packets] [-t timeout] [-4|-6]\n");
|
||||
}
|
||||
|
|
|
@ -683,8 +683,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
printf (" %s\n", "-w, --warning=RANGE");
|
||||
printf (" %s\n", _("Generate warning state if metric is outside this range"));
|
||||
printf (" %s\n", "-c, --critical=RANGE");
|
||||
|
@ -699,7 +699,7 @@ print_help (void)
|
|||
#if defined( __linux__ )
|
||||
printf (" %s\n", _("ELAPSED - time elapsed in seconds"));
|
||||
#endif /* defined(__linux__) */
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (" %s\n", "-v, --verbose");
|
||||
printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));
|
||||
|
@ -739,12 +739,6 @@ the specified threshold ranges. The process count can be filtered by\n\
|
|||
process owner, parent process PID, current state (e.g., 'Z'), or may\n\
|
||||
be the total number of running processes\n\n"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
printf ("\n");
|
||||
#endif
|
||||
|
||||
printf ("%s\n", _("Examples:"));
|
||||
printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
|
||||
printf (" %s\n", _("Warning if not two processes with command name portsentry."));
|
||||
|
@ -757,13 +751,13 @@ be the total number of running processes\n\n"));
|
|||
printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU");
|
||||
printf (" %s\n", _("Alert if CPU of any processes over 10%% or 20%%"));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage: "));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n", progname);
|
||||
printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n");
|
||||
printf (" [-C command] [-t timeout] [-v]\n");
|
||||
|
|
|
@ -63,12 +63,20 @@ void print_usage (void);
|
|||
#define my_rc_avpair_add(a,b,c,d) rc_avpair_add(a, b, c, d)
|
||||
#define my_rc_read_dictionary(a) rc_read_dictionary(a)
|
||||
#endif
|
||||
|
||||
/* REJECT_RC is only defined in some version of radiusclient. It has
|
||||
* been reported from radiusclient-ng 0.5.6 on FreeBSD 7.2-RELEASE */
|
||||
#ifndef REJECT_RC
|
||||
#define REJECT_RC BADRESP_RC
|
||||
#endif
|
||||
|
||||
int my_rc_read_config(char *);
|
||||
|
||||
char *server = NULL;
|
||||
char *username = NULL;
|
||||
char *password = NULL;
|
||||
char *nasid = NULL;
|
||||
char *nasipaddress = NULL;
|
||||
char *expect = NULL;
|
||||
char *config_file = NULL;
|
||||
unsigned short port = PW_AUTH_UDP_PORT;
|
||||
|
@ -161,19 +169,26 @@ main (int argc, char **argv)
|
|||
memset (&data, 0, sizeof(data));
|
||||
if (!(my_rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0) &&
|
||||
my_rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) &&
|
||||
my_rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0) &&
|
||||
(nasid==NULL || my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))))
|
||||
my_rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0)
|
||||
))
|
||||
die (STATE_UNKNOWN, _("Out of Memory?"));
|
||||
|
||||
/*
|
||||
* Fill in NAS-IP-Address
|
||||
*/
|
||||
if (nasid != NULL) {
|
||||
if (!(my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0)))
|
||||
die (STATE_UNKNOWN, _("Invalid NAS-Identifier"));
|
||||
}
|
||||
|
||||
if ((client_id = my_rc_own_ipaddress ()) == 0)
|
||||
return (ERROR_RC);
|
||||
|
||||
if (my_rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) ==
|
||||
NULL) return (ERROR_RC);
|
||||
if (nasipaddress != NULL) {
|
||||
if (rc_good_ipaddr (nasipaddress))
|
||||
die (STATE_UNKNOWN, _("Invalid NAS-IP-Address"));
|
||||
if ((client_id = rc_get_ipaddr(nasipaddress)) == 0)
|
||||
die (STATE_UNKNOWN, _("Invalid NAS-IP-Address"));
|
||||
} else {
|
||||
if ((client_id = my_rc_own_ipaddress ()) == 0)
|
||||
die (STATE_UNKNOWN, _("Can't find local IP for NAS-IP-Address"));
|
||||
}
|
||||
if (my_rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) == NULL)
|
||||
die (STATE_UNKNOWN, _("Invalid NAS-IP-Address"));
|
||||
|
||||
my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval,
|
||||
retries);
|
||||
|
@ -187,13 +202,16 @@ main (int argc, char **argv)
|
|||
die (STATE_CRITICAL, _("Timeout"));
|
||||
if (result == ERROR_RC)
|
||||
die (STATE_CRITICAL, _("Auth Error"));
|
||||
if (result == BADRESP_RC)
|
||||
if (result == REJECT_RC)
|
||||
die (STATE_WARNING, _("Auth Failed"));
|
||||
if (result == BADRESP_RC)
|
||||
die (STATE_WARNING, _("Bad Response"));
|
||||
if (expect && !strstr (msg, expect))
|
||||
die (STATE_WARNING, "%s", msg);
|
||||
if (result == OK_RC)
|
||||
die (STATE_OK, _("Auth OK"));
|
||||
return (0);
|
||||
(void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result);
|
||||
die (STATE_UNKNOWN, msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -211,6 +229,7 @@ process_arguments (int argc, char **argv)
|
|||
{"username", required_argument, 0, 'u'},
|
||||
{"password", required_argument, 0, 'p'},
|
||||
{"nas-id", required_argument, 0, 'n'},
|
||||
{"nas-ip-address", required_argument, 0, 'N'},
|
||||
{"filename", required_argument, 0, 'F'},
|
||||
{"expect", required_argument, 0, 'e'},
|
||||
{"retries", required_argument, 0, 'r'},
|
||||
|
@ -222,7 +241,7 @@ process_arguments (int argc, char **argv)
|
|||
};
|
||||
|
||||
while (1) {
|
||||
c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:t:r:e:", longopts,
|
||||
c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:N:t:r:e:", longopts,
|
||||
&option);
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
|
@ -267,6 +286,9 @@ process_arguments (int argc, char **argv)
|
|||
case 'n': /* nas id */
|
||||
nasid = optarg;
|
||||
break;
|
||||
case 'N': /* nas ip address */
|
||||
nasipaddress = optarg;
|
||||
break;
|
||||
case 'F': /* configuration file */
|
||||
config_file = optarg;
|
||||
break;
|
||||
|
@ -319,10 +341,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'P', myport);
|
||||
printf (UT_HOST_PORT, 'P', myport);
|
||||
|
||||
printf (" %s\n", "-u, --username=STRING");
|
||||
printf (" %s\n", _("The user to authenticate"));
|
||||
|
@ -330,6 +352,8 @@ print_help (void)
|
|||
printf (" %s\n", _("Password for autentication (SECURITY RISK)"));
|
||||
printf (" %s\n", "-n, --nas-id=STRING");
|
||||
printf (" %s\n", _("NAS identifier"));
|
||||
printf (" %s\n", "-N, --nas-ip-address=STRING");
|
||||
printf (" %s\n", _("NAS IP Address"));
|
||||
printf (" %s\n", "-F, --filename=STRING");
|
||||
printf (" %s\n", _("Configuration file"));
|
||||
printf (" %s\n", "-e, --expect=STRING");
|
||||
|
@ -337,7 +361,7 @@ print_help (void)
|
|||
printf (" %s\n", "-r, --retries=INTEGER");
|
||||
printf (" %s\n", _("Number of times to retry a failed connection"));
|
||||
|
||||
printf (_(UT_TIMEOUT), timeout_interval);
|
||||
printf (UT_TIMEOUT, timeout_interval);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("This plugin tests a RADIUS server to see if it is accepting connections."));
|
||||
|
@ -350,13 +374,7 @@ print_help (void)
|
|||
printf ("%s\n", _("run the plugin at regular predictable intervals. Please be sure that"));
|
||||
printf ("%s\n", _("the password used does not allow access to sensitive system resources."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -364,9 +382,10 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\
|
||||
[-t timeout] [-r retries] [-e expect]\n", progname);
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host -F config_file -u username -p password\n\
|
||||
[-P port] [-t timeout] [-r retries] [-e expect]\n\
|
||||
[-n nas-id] [-N nas-ip-addr]\n", progname);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -416,10 +416,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n", "-u, --url=STRING");
|
||||
printf (" %s\n", _("Connect to this url"));
|
||||
|
@ -427,11 +427,11 @@ print_help (void)
|
|||
printf (_("String to expect in first line of server response (default: %s)\n"),
|
||||
EXPECT);
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("This plugin will attempt to open an RTSP connection with the host."));
|
||||
|
@ -440,13 +440,7 @@ print_help (void)
|
|||
printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return"));
|
||||
printf ("%s\n", _("values."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -454,6 +448,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-e expect] [-p port] [-w warn] [-c crit] [-t timeout] [-v]\n", progname);
|
||||
}
|
||||
|
|
|
@ -767,12 +767,12 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-e, --expect=STRING");
|
||||
printf (_(" String to expect in first line of server response (default: '%s')\n"), SMTP_EXPECT);
|
||||
|
@ -782,6 +782,8 @@ print_help (void)
|
|||
printf (" %s\n", _("Expected response to command (may be used repeatedly)"));
|
||||
printf (" %s\n", "-f, --from=STRING");
|
||||
printf (" %s\n", _("FROM-address to include in MAIL command, required by Exchange 2000")),
|
||||
printf (" %s\n", "-F, --fqdn=STRING");
|
||||
printf (" %s\n", _("FQDN used for HELO"));
|
||||
#ifdef HAVE_SSL
|
||||
printf (" %s\n", "-D, --certificate=INTEGER");
|
||||
printf (" %s\n", _("Minimum number of days a certificate has to be valid."));
|
||||
|
@ -796,11 +798,11 @@ print_help (void)
|
|||
printf (" %s\n", "-P, --authpass=STRING");
|
||||
printf (" %s\n", _("SMTP AUTH password"));
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf("\n");
|
||||
printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return"));
|
||||
|
@ -808,13 +810,7 @@ print_help (void)
|
|||
printf ("%s\n", _("connects, but incorrect reponse messages from the host result in"));
|
||||
printf ("%s\n", _("STATE_WARNING return values."));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -822,9 +818,9 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s -H host [-p port] [-e expect] [-C command] [-f from addr]", progname);
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host [-p port] [-e expect] [-C command] [-f from addr]", progname);
|
||||
printf ("[-A authtype -U authuser -P authpass] [-w warn] [-c crit] [-t timeout]\n");
|
||||
printf ("[-S] [-D days] [-v] [-4|-6]\n");
|
||||
printf ("[-F fqdn] [-S] [-D days] [-v] [-4|-6]\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,30 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
|||
|
||||
#define MAX_OIDS 8
|
||||
|
||||
/* Longopts only arguments */
|
||||
#define L_CALCULATE_RATE CHAR_MAX+1
|
||||
#define L_RATE_MULTIPLIER CHAR_MAX+2
|
||||
#define L_INVERT_SEARCH CHAR_MAX+3
|
||||
|
||||
/* Gobble to string - stop incrementing c when c[0] match one of the
|
||||
* characters in s */
|
||||
#define GOBBLE_TOS(c, s) while(c[0]!='\0' && strchr(s, c[0])==NULL) { c++; }
|
||||
/* Given c, keep track of backslashes (bk) and double-quotes (dq)
|
||||
* from c[0] */
|
||||
#define COUNT_SEQ(c, bk, dq) switch(c[0]) {\
|
||||
case '\\': \
|
||||
if (bk) bk--; \
|
||||
else bk++; \
|
||||
break; \
|
||||
case '"': \
|
||||
if (!dq) { dq++; } \
|
||||
else if(!bk) { dq--; } \
|
||||
else { bk--; } \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
int process_arguments (int, char **);
|
||||
int validate_arguments (void);
|
||||
char *thisarg (char *str);
|
||||
|
@ -92,6 +116,7 @@ char *units;
|
|||
char *port;
|
||||
char *snmpcmd;
|
||||
char string_value[MAX_INPUT_BUFFER] = "";
|
||||
int invert_search=0;
|
||||
char **labels = NULL;
|
||||
char **unitv = NULL;
|
||||
size_t nlabels = 0;
|
||||
|
@ -112,12 +137,17 @@ char *delimiter;
|
|||
char *output_delim;
|
||||
char *miblist = NULL;
|
||||
int needmibs = FALSE;
|
||||
int calculate_rate = 0;
|
||||
int rate_multiplier = 1;
|
||||
state_data *previous_state;
|
||||
double previous_value[MAX_OIDS];
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int i, len, line, total_oids;
|
||||
unsigned int bk_count = 0, dq_count = 0;
|
||||
int iresult = STATE_UNKNOWN;
|
||||
int result = STATE_UNKNOWN;
|
||||
int return_code = 0;
|
||||
|
@ -126,6 +156,7 @@ main (int argc, char **argv)
|
|||
char *cl_hidden_auth = NULL;
|
||||
char *oidname = NULL;
|
||||
char *response = NULL;
|
||||
char *mult_resp = NULL;
|
||||
char *outbuff;
|
||||
char *ptr = NULL;
|
||||
char *show = NULL;
|
||||
|
@ -133,6 +164,17 @@ main (int argc, char **argv)
|
|||
char *th_crit=NULL;
|
||||
char type[8] = "";
|
||||
output chld_out, chld_err;
|
||||
char *previous_string=NULL;
|
||||
char *ap=NULL;
|
||||
char *state_string=NULL;
|
||||
size_t response_length, current_length, string_length;
|
||||
char *temp_string=NULL;
|
||||
int is_numeric=0;
|
||||
time_t current_time;
|
||||
double temp_double;
|
||||
time_t duration;
|
||||
char *conv = "12345678";
|
||||
int is_counter=0;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
|
@ -152,12 +194,33 @@ main (int argc, char **argv)
|
|||
timeout_interval = DEFAULT_TIMEOUT;
|
||||
retries = DEFAULT_RETRIES;
|
||||
|
||||
np_init( (char *) progname, argc, argv );
|
||||
|
||||
/* Parse extra opts if any */
|
||||
argv=np_extra_opts (&argc, argv, progname);
|
||||
|
||||
np_set_args(argc, argv);
|
||||
|
||||
if (process_arguments (argc, argv) == ERROR)
|
||||
usage4 (_("Could not parse arguments"));
|
||||
|
||||
if(calculate_rate) {
|
||||
if (!strcmp(label, "SNMP"))
|
||||
label = strdup("SNMP RATE");
|
||||
time(¤t_time);
|
||||
i=0;
|
||||
previous_state = np_state_read();
|
||||
if(previous_state!=NULL) {
|
||||
/* Split colon separated values */
|
||||
previous_string = strdup((char *) previous_state->data);
|
||||
while((ap = strsep(&previous_string, ":")) != NULL) {
|
||||
if(verbose>2)
|
||||
printf("State for %d=%s\n", i, ap);
|
||||
previous_value[i++]=strtod(ap,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Populate the thresholds */
|
||||
th_warn=warning_thresholds;
|
||||
th_crit=critical_thresholds;
|
||||
|
@ -249,40 +312,89 @@ main (int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < chld_out.lines; i++) {
|
||||
const char *conv = "%.0f";
|
||||
for (line=0, i=0; line < chld_out.lines; line++, i++) {
|
||||
if(calculate_rate)
|
||||
conv = "%.10g";
|
||||
else
|
||||
conv = "%.0f";
|
||||
|
||||
ptr = chld_out.line[i];
|
||||
ptr = chld_out.line[line];
|
||||
oidname = strpcpy (oidname, ptr, delimiter);
|
||||
response = strstr (ptr, delimiter);
|
||||
if (response == NULL)
|
||||
break;
|
||||
|
||||
if (verbose > 2) {
|
||||
printf("Processing line %i\n oidname: %s\n response: %s\n", i+1, oidname, response);
|
||||
printf("Processing oid %i (line %i)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
|
||||
}
|
||||
|
||||
/* Clean up type array - Sol10 does not necessarily zero it out */
|
||||
bzero(type, sizeof(type));
|
||||
|
||||
is_counter=0;
|
||||
/* We strip out the datatype indicator for PHBs */
|
||||
if (strstr (response, "Gauge: "))
|
||||
if (strstr (response, "Gauge: ")) {
|
||||
show = strstr (response, "Gauge: ") + 7;
|
||||
else if (strstr (response, "Gauge32: "))
|
||||
is_numeric++;
|
||||
}
|
||||
else if (strstr (response, "Gauge32: ")) {
|
||||
show = strstr (response, "Gauge32: ") + 9;
|
||||
is_numeric++;
|
||||
}
|
||||
else if (strstr (response, "Counter32: ")) {
|
||||
show = strstr (response, "Counter32: ") + 11;
|
||||
strcpy(type, "c");
|
||||
is_numeric++;
|
||||
is_counter=1;
|
||||
if(!calculate_rate)
|
||||
strcpy(type, "c");
|
||||
}
|
||||
else if (strstr (response, "Counter64: ")) {
|
||||
show = strstr (response, "Counter64: ") + 11;
|
||||
strcpy(type, "c");
|
||||
is_numeric++;
|
||||
is_counter=1;
|
||||
if(!calculate_rate)
|
||||
strcpy(type, "c");
|
||||
}
|
||||
else if (strstr (response, "INTEGER: "))
|
||||
else if (strstr (response, "INTEGER: ")) {
|
||||
show = strstr (response, "INTEGER: ") + 9;
|
||||
is_numeric++;
|
||||
}
|
||||
else if (strstr (response, "STRING: ")) {
|
||||
show = strstr (response, "STRING: ") + 8;
|
||||
conv = "%.10g";
|
||||
|
||||
/* Get the rest of the string on multi-line strings */
|
||||
ptr = show;
|
||||
COUNT_SEQ(ptr, bk_count, dq_count)
|
||||
while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
|
||||
ptr++;
|
||||
GOBBLE_TOS(ptr, "\n\"\\")
|
||||
COUNT_SEQ(ptr, bk_count, dq_count)
|
||||
}
|
||||
|
||||
if (dq_count) { /* unfinished line */
|
||||
/* copy show verbatim first */
|
||||
if (!mult_resp) mult_resp = strdup("");
|
||||
asprintf (&mult_resp, "%s%s:\n%s\n", mult_resp, oids[i], show);
|
||||
/* then strip out unmatched double-quote from single-line output */
|
||||
if (show[0] == '"') show++;
|
||||
|
||||
/* Keep reading until we match end of double-quoted string */
|
||||
for (line++; line < chld_out.lines; line++) {
|
||||
ptr = chld_out.line[line];
|
||||
asprintf (&mult_resp, "%s%s\n", mult_resp, ptr);
|
||||
|
||||
COUNT_SEQ(ptr, bk_count, dq_count)
|
||||
while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
|
||||
ptr++;
|
||||
GOBBLE_TOS(ptr, "\n\"\\")
|
||||
COUNT_SEQ(ptr, bk_count, dq_count)
|
||||
}
|
||||
/* Break for loop before next line increment when done */
|
||||
if (!dq_count) break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (strstr (response, "Timeticks: "))
|
||||
show = strstr (response, "Timeticks: ");
|
||||
|
@ -291,29 +403,50 @@ main (int argc, char **argv)
|
|||
|
||||
iresult = STATE_DEPENDENT;
|
||||
|
||||
/* Process this block for integer comparisons */
|
||||
if (thlds[i]->warning || thlds[i]->critical) {
|
||||
/* Process this block for numeric comparisons */
|
||||
if (is_numeric) {
|
||||
ptr = strpbrk (show, "0123456789");
|
||||
if (ptr == NULL)
|
||||
die (STATE_UNKNOWN,_("No valid data returned"));
|
||||
response_value[i] = strtod (ptr, NULL);
|
||||
iresult = get_status(response_value[i], thlds[i]);
|
||||
asprintf (&show, conv, response_value[i]);
|
||||
|
||||
if(calculate_rate) {
|
||||
if (previous_state!=NULL) {
|
||||
duration = current_time-previous_state->time;
|
||||
if(duration<=0)
|
||||
die(STATE_UNKNOWN,_("Time duration between plugin calls is invalid"));
|
||||
temp_double = response_value[i]-previous_value[i];
|
||||
/* Simple overflow catcher (same as in rrdtool, rrd_update.c) */
|
||||
if(is_counter) {
|
||||
if(temp_double<(double)0.0)
|
||||
temp_double+=(double)4294967296.0; /* 2^32 */
|
||||
if(temp_double<(double)0.0)
|
||||
temp_double+=(double)18446744069414584320.0; /* 2^64-2^32 */;
|
||||
}
|
||||
/* Convert to per second, then use multiplier */
|
||||
temp_double = temp_double/duration*rate_multiplier;
|
||||
iresult = get_status(temp_double, thlds[i]);
|
||||
asprintf (&show, conv, temp_double);
|
||||
}
|
||||
} else {
|
||||
iresult = get_status(response_value[i], thlds[i]);
|
||||
asprintf (&show, conv, response_value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Process this block for string matching */
|
||||
else if (eval_method[i] & CRIT_STRING) {
|
||||
if (strcmp (show, string_value))
|
||||
iresult = STATE_CRITICAL;
|
||||
iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
|
||||
else
|
||||
iresult = STATE_OK;
|
||||
iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
|
||||
}
|
||||
|
||||
/* Process this block for regex matching */
|
||||
else if (eval_method[i] & CRIT_REGEX) {
|
||||
excode = regexec (&preg, response, 10, pmatch, eflags);
|
||||
if (excode == 0) {
|
||||
iresult = STATE_OK;
|
||||
iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
|
||||
}
|
||||
else if (excode != REG_NOMATCH) {
|
||||
regerror (excode, &preg, errbuf, MAX_INPUT_BUFFER);
|
||||
|
@ -321,11 +454,12 @@ main (int argc, char **argv)
|
|||
exit (STATE_CRITICAL);
|
||||
}
|
||||
else {
|
||||
iresult = STATE_CRITICAL;
|
||||
iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process this block for existence-nonexistence checks */
|
||||
/* TV: Should this be outside of this else block? */
|
||||
else {
|
||||
if (eval_method[i] & CRIT_PRESENT)
|
||||
iresult = STATE_CRITICAL;
|
||||
|
@ -339,7 +473,7 @@ main (int argc, char **argv)
|
|||
result = max_state (result, iresult);
|
||||
|
||||
/* Prepend a label for this OID if there is one */
|
||||
if (nlabels > (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
|
||||
if (nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
|
||||
asprintf (&outbuff, "%s%s%s %s%s%s", outbuff,
|
||||
(i == 0) ? " " : output_delim,
|
||||
labels[i], mark (iresult), show, mark (iresult));
|
||||
|
@ -351,18 +485,65 @@ main (int argc, char **argv)
|
|||
if (nunits > (size_t)0 && (size_t)i < nunits && unitv[i] != NULL)
|
||||
asprintf (&outbuff, "%s %s", outbuff, unitv[i]);
|
||||
|
||||
if (is_numeric(show)) {
|
||||
strncat(perfstr, oidname, sizeof(perfstr)-strlen(perfstr)-1);
|
||||
/* Write perfdata with whatever can be parsed by strtod, if possible */
|
||||
ptr = NULL;
|
||||
strtod(show, &ptr);
|
||||
if (ptr > show) {
|
||||
if (nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
|
||||
temp_string=labels[i];
|
||||
else
|
||||
temp_string=oidname;
|
||||
strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
|
||||
strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
|
||||
strncat(perfstr, show, sizeof(perfstr)-strlen(perfstr)-1);
|
||||
len = sizeof(perfstr)-strlen(perfstr)-1;
|
||||
strncat(perfstr, show, len>ptr-show ? ptr-show : len);
|
||||
|
||||
if (type)
|
||||
strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
|
||||
strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
|
||||
}
|
||||
}
|
||||
total_oids=i;
|
||||
|
||||
printf ("%s %s -%s %s \n", label, state_text (result), outbuff, perfstr);
|
||||
/* Save state data, as all data collected now */
|
||||
if(calculate_rate) {
|
||||
string_length=1024;
|
||||
state_string=malloc(string_length);
|
||||
if(state_string==NULL)
|
||||
die(STATE_UNKNOWN, _("Cannot malloc"));
|
||||
|
||||
current_length=0;
|
||||
for(i=0; i<total_oids; i++) {
|
||||
asprintf(&temp_string,"%.0f",response_value[i]);
|
||||
if(temp_string==NULL)
|
||||
die(STATE_UNKNOWN,_("Cannot asprintf()"));
|
||||
response_length = strlen(temp_string);
|
||||
if(current_length+response_length>string_length) {
|
||||
string_length=current_length+1024;
|
||||
state_string=realloc(state_string,string_length);
|
||||
if(state_string==NULL)
|
||||
die(STATE_UNKNOWN, _("Cannot realloc()"));
|
||||
}
|
||||
strcpy(&state_string[current_length],temp_string);
|
||||
current_length=current_length+response_length;
|
||||
state_string[current_length]=':';
|
||||
current_length++;
|
||||
free(temp_string);
|
||||
}
|
||||
state_string[--current_length]='\0';
|
||||
if (verbose > 2)
|
||||
printf("State string=%s\n",state_string);
|
||||
|
||||
/* This is not strictly the same as time now, but any subtle variations will cancel out */
|
||||
np_state_write_string(current_time, state_string );
|
||||
if(previous_state==NULL) {
|
||||
/* Or should this be highest state? */
|
||||
die( STATE_OK, _("No previous data to calculate rate - assume okay" ) );
|
||||
}
|
||||
}
|
||||
|
||||
printf ("%s %s -%s %s\n", label, state_text (result), outbuff, perfstr);
|
||||
if (mult_resp) printf ("%s", mult_resp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -403,6 +584,9 @@ process_arguments (int argc, char **argv)
|
|||
{"authpasswd", required_argument, 0, 'A'},
|
||||
{"privpasswd", required_argument, 0, 'X'},
|
||||
{"next", no_argument, 0, 'n'},
|
||||
{"rate", no_argument, 0, L_CALCULATE_RATE},
|
||||
{"rate-multiplier", required_argument, 0, L_RATE_MULTIPLIER},
|
||||
{"invert-search", no_argument, 0, L_INVERT_SEARCH},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -506,7 +690,7 @@ process_arguments (int argc, char **argv)
|
|||
*/
|
||||
needmibs = TRUE;
|
||||
}
|
||||
oids = calloc(MAX_OIDS, sizeof (char *));
|
||||
if (!oids) oids = calloc(MAX_OIDS, sizeof (char *));
|
||||
for (ptr = strtok(optarg, ", "); ptr != NULL && j < MAX_OIDS; ptr = strtok(NULL, ", "), j++) {
|
||||
oids[j] = strdup(ptr);
|
||||
}
|
||||
|
@ -550,7 +734,6 @@ process_arguments (int argc, char **argv)
|
|||
output_delim = strscpy (output_delim, optarg);
|
||||
break;
|
||||
case 'l': /* label */
|
||||
label = optarg;
|
||||
nlabels++;
|
||||
if (nlabels >= labels_size) {
|
||||
labels_size += 8;
|
||||
|
@ -607,7 +790,18 @@ process_arguments (int argc, char **argv)
|
|||
unitv[nunits - 1] = ptr;
|
||||
}
|
||||
break;
|
||||
|
||||
case L_CALCULATE_RATE:
|
||||
if(calculate_rate==0)
|
||||
np_enable_state(NULL, 1);
|
||||
calculate_rate = 1;
|
||||
break;
|
||||
case L_RATE_MULTIPLIER:
|
||||
if(!is_integer(optarg)||((rate_multiplier=atoi(optarg))<=0))
|
||||
usage2(_("Rate multiplier must be a positive integer"),optarg);
|
||||
break;
|
||||
case L_INVERT_SEARCH:
|
||||
invert_search=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -802,10 +996,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT);
|
||||
printf (UT_HOST_PORT, 'p', DEFAULT_PORT);
|
||||
|
||||
/* SNMP and Authentication Protocol */
|
||||
printf (" %s\n", "-n, --next");
|
||||
|
@ -846,6 +1040,10 @@ print_help (void)
|
|||
printf (" %s\n", _("Warning threshold range(s)"));
|
||||
printf (" %s\n", "-c, --critical=THRESHOLD(s)");
|
||||
printf (" %s\n", _("Critical threshold range(s)"));
|
||||
printf (" %s\n", "--rate");
|
||||
printf (" %s\n", _("Enable rate calculation. See 'Rate Calculation' below"));
|
||||
printf (" %s\n", "--rate-multiplier");
|
||||
printf (" %s\n", _("Converts rate per second. For example, set to 60 to convert to per minute"));
|
||||
|
||||
/* Tests Against Strings */
|
||||
printf (" %s\n", "-s, --string=STRING");
|
||||
|
@ -854,20 +1052,22 @@ print_help (void)
|
|||
printf (" %s\n", _("Return OK state (for that OID) if extended regular expression REGEX matches"));
|
||||
printf (" %s\n", "-R, --eregi=REGEX");
|
||||
printf (" %s\n", _("Return OK state (for that OID) if case-insensitive extended REGEX matches"));
|
||||
printf (" %s\n", "-l, --label=STRING");
|
||||
printf (" %s\n", _("Prefix label for output from plugin (default -s 'SNMP')"));
|
||||
printf (" %s\n", "--invert-search");
|
||||
printf (" %s\n", _("Invert search result (CRITICAL if found)"));
|
||||
|
||||
/* Output Formatting */
|
||||
printf (" %s\n", "-l, --label=STRING");
|
||||
printf (" %s\n", _("Prefix label for output from plugin"));
|
||||
printf (" %s\n", "-u, --units=STRING");
|
||||
printf (" %s\n", _("Units label(s) for output data (e.g., 'sec.')."));
|
||||
printf (" %s\n", "-D, --output-delimiter=STRING");
|
||||
printf (" %s\n", _("Separates output on multiple OID requests"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (" %s\n", "-e, --retries=INTEGER");
|
||||
printf (" %s\n", _("Number of retries to be used in the requests"));
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("This plugin uses the 'snmpget' command included with the NET-SNMP package."));
|
||||
|
@ -876,20 +1076,27 @@ print_help (void)
|
|||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (" %s\n", _("- Multiple OIDs may be indicated by a comma- or space-delimited list (lists with"));
|
||||
printf (" %s\n", _("internal spaces must be quoted) [max 8 OIDs]"));
|
||||
printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with"));
|
||||
printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
|
||||
|
||||
printf(" -%s", _(UT_THRESHOLDS_NOTES));
|
||||
printf(" -%s", UT_THRESHOLDS_NOTES);
|
||||
|
||||
printf (" %s\n", _("- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'"));
|
||||
printf (" %s\n", _("- Note that only one string and one regex may be checked at present"));
|
||||
printf (" %s\n", _("- All evaluation methods other than PR, STR, and SUBSTR expect that the value"));
|
||||
printf (" %s\n", _("returned from the SNMP query is an unsigned integer."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf("\n");
|
||||
printf("%s\n", _("Rate Calculation:"));
|
||||
printf(" %s\n", _("In many places, SNMP returns counters that are only meaningful when"));
|
||||
printf(" %s\n", _("calculating the counter difference since the last check. check_snmp"));
|
||||
printf(" %s\n", _("saves the last state information in a file so that the rate per second"));
|
||||
printf(" %s\n", _("can be calculated. Use the --rate option to save state information."));
|
||||
printf(" %s\n", _("On the first run, there will be no prior state - this will return with OK."));
|
||||
printf(" %s\n", _("The state is uniquely determined by the arguments to the plugin, so"));
|
||||
printf(" %s\n", _("changing the arguments will create a new state file."));
|
||||
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -897,7 +1104,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]\n",progname);
|
||||
printf ("[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]\n");
|
||||
printf ("[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]\n");
|
||||
|
|
|
@ -277,27 +277,21 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (" %s\n", "-r, --remote-version=STRING");
|
||||
printf (" %s\n", _("Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)"));
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -305,7 +299,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n", progname);
|
||||
}
|
||||
|
||||
|
|
|
@ -528,8 +528,8 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-w, --warning=INTEGER");
|
||||
printf (" %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free"));
|
||||
|
@ -541,18 +541,13 @@ print_help (void)
|
|||
printf (" %s\n", _("Exit with CRITCAL status if less than PERCENT of swap space is free"));
|
||||
printf (" %s\n", "-a, --allswaps");
|
||||
printf (" %s\n", _("Conduct comparisons for all swap partitions, one by one"));
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -560,7 +555,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-av] -w <percent_free>%% -c <percent_free>%%\n",progname);
|
||||
printf ("%s [-av] -w <bytes_free> -c <bytes_free>\n", progname);
|
||||
}
|
||||
|
|
|
@ -599,12 +599,12 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', "none");
|
||||
printf (UT_HOST_PORT, 'p', "none");
|
||||
|
||||
printf (_(UT_IPv46));
|
||||
printf (UT_IPv46);
|
||||
|
||||
printf (" %s\n", "-E, --escape");
|
||||
printf (" %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option"));
|
||||
|
@ -635,26 +635,20 @@ print_help (void)
|
|||
printf (" %s\n", _("Use SSL for the connection."));
|
||||
#endif
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
printf (UT_VERBOSE);
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]\n",progname);
|
||||
printf ("[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]\n");
|
||||
printf ("[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]\n");
|
||||
|
|
|
@ -342,10 +342,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n", "-u, --udp");
|
||||
printf (" %s\n", _("Use UDP to connect, not TCP"));
|
||||
|
@ -358,15 +358,9 @@ print_help (void)
|
|||
printf (" %s\n", "-C, --critical-connect=INTEGER");
|
||||
printf (" %s\n", _("Response time (sec.) necessary to result in critical status"));
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -374,7 +368,7 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n",progname);
|
||||
printf (" [-W connect_time] [-C connect_time] [-t timeout]\n");
|
||||
}
|
||||
|
|
|
@ -611,10 +611,10 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (_(UT_HOST_PORT), 'p', myport);
|
||||
printf (UT_HOST_PORT, 'p', myport);
|
||||
|
||||
printf (" %s\n", "-u, --ups=STRING");
|
||||
printf (" %s\n", _("Name of UPS"));
|
||||
|
@ -623,13 +623,13 @@ print_help (void)
|
|||
printf (" %s\n", "-v, --variable=STRING");
|
||||
printf (" %s %s\n", _("Valid values for STRING are"), "LINE, TEMP, BATTPCT or LOADPCT");
|
||||
|
||||
printf (_(UT_WARN_CRIT));
|
||||
printf (UT_WARN_CRIT);
|
||||
|
||||
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
|
||||
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
|
||||
|
||||
/* TODO: -v clashing with -v/-variable. Commenting out help text since verbose
|
||||
is unused up to now */
|
||||
/* printf (_(UT_VERBOSE)); */
|
||||
/* printf (UT_VERBOSE); */
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("This plugin attempts to determine the status of a UPS (Uninterruptible Power"));
|
||||
|
@ -649,18 +649,14 @@ print_help (void)
|
|||
printf (" %s\n", _("Network UPS Tools be installed on the remote host. If you do not have the"));
|
||||
printf (" %s\n", _("package installed on your system, you can download it from"));
|
||||
printf (" %s\n", _("http://www.networkupstools.org"));
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -H host -u ups [-p port] [-v variable] [-w warn_value] [-c crit_value] [-to to_sec] [-T]\n", progname);
|
||||
}
|
||||
|
|
|
@ -211,27 +211,21 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
printf (UT_HELP_VRSN);
|
||||
printf (UT_EXTRA_OPTS);
|
||||
|
||||
printf (" %s\n", "-w, --warning=INTEGER");
|
||||
printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
|
||||
printf (" %s\n", "-c, --critical=INTEGER");
|
||||
printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s -w <users> -c <users>\n", progname);
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ process_arguments (int argc, char **argv)
|
|||
break;
|
||||
case 'T': /* Result to return on timeouts */
|
||||
if ((timeout_state = translate_state(optarg)) == ERROR)
|
||||
usage4 (_("timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
|
||||
usage4 (_("Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
|
||||
break;
|
||||
case 'o': /* replacement for OK */
|
||||
if ((state[STATE_OK] = translate_state(optarg)) == ERROR)
|
||||
|
@ -247,9 +247,9 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (UT_HELP_VRSN);
|
||||
|
||||
printf (_(UT_TIMEOUT), timeout_interval);
|
||||
printf (UT_TIMEOUT, timeout_interval);
|
||||
printf (" %s\n", _("Keep timeout longer than the plugin timeout to retain CRITICAL status."));
|
||||
printf (" -T, --timeout-result=STATUS\n");
|
||||
printf (" %s\n", _("Custom result on Negate timeouts; see below for STATUS definition\n"));
|
||||
|
@ -281,7 +281,7 @@ print_help (void)
|
|||
printf (" %s\n", _("Using timeout-result, it is possible to override the timeout behaviour or a"));
|
||||
printf (" %s\n", _("plugin by setting the negate timeout a bit lower."));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,6 +289,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s [-t timeout] [-Towcu STATE] [-s] <definition of wrapped plugin>\n", progname);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
|
|||
my $ntp_okmatch1 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
|
||||
my $ntp_warnmatch1 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
|
||||
my $ntp_critmatch1 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
|
||||
my $ntp_okmatch2 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}/';
|
||||
my $ntp_warnmatch2 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}/';
|
||||
my $ntp_critmatch2 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}/';
|
||||
my $ntp_okmatch2 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/';
|
||||
my $ntp_warnmatch2 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/';
|
||||
my $ntp_critmatch2 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/';
|
||||
my $ntp_noresponse = '/^(CRITICAL - Socket timeout after 3 seconds)|(NTP CRITICAL: No response from NTP server)$/';
|
||||
my $ntp_nosuchhost = '/^check_ntp.*: Invalid hostname/address - ' . $hostname_invalid . '/';
|
||||
|
||||
|
@ -90,21 +90,21 @@ foreach my $plugin (@PLUGINS2) {
|
|||
SKIP: {
|
||||
skip "No NTP server defined", 1 unless $ntp_service;
|
||||
$res = NPTest->testCmd(
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k 200000"
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k 200000 -m 1: -n 0:"
|
||||
);
|
||||
cmp_ok( $res->return_code, '==', 0, "$plugin: Good NTP result with jitter and stratum check" );
|
||||
like( $res->output, $ntp_okmatch2, "$plugin: Output match OK with jitter and stratum" );
|
||||
cmp_ok( $res->return_code, '==', 0, "$plugin: Good NTP result with jitter, stratum, and truechimers check" );
|
||||
like( $res->output, $ntp_okmatch2, "$plugin: Output match OK with jitter, stratum, and truechimers" );
|
||||
|
||||
$res = NPTest->testCmd(
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W \\~:-1 -C 21 -j 100000 -k 200000"
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W \\~:-1 -C 21 -j 100000 -k 200000 -m 1: -n 0:"
|
||||
);
|
||||
cmp_ok( $res->return_code, '==', 1, "$plugin: Warning NTP result with jitter and stratum check" );
|
||||
like( $res->output, $ntp_warnmatch2, "$plugin: Output match WARNING with jitter and stratum" );
|
||||
cmp_ok( $res->return_code, '==', 1, "$plugin: Warning NTP result with jitter, stratum, and truechimers check" );
|
||||
like( $res->output, $ntp_warnmatch2, "$plugin: Output match WARNING with jitter, stratum, and truechimers" );
|
||||
|
||||
$res = NPTest->testCmd(
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k \\~:-1"
|
||||
"./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k \\~:-1 -m 1: -n 0:"
|
||||
);
|
||||
cmp_ok( $res->return_code, '==', 2, "$plugin: Critical NTP result with jitter and stratum check" );
|
||||
like( $res->output, $ntp_critmatch2, "$plugin: Output match CRITICAL with jitter and stratum" );
|
||||
cmp_ok( $res->return_code, '==', 2, "$plugin: Critical NTP result with jitter, stratum, and truechimers check" );
|
||||
like( $res->output, $ntp_critmatch2, "$plugin: Output match CRITICAL with jitter, stratum, and truechimers" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use strict;
|
|||
use Test::More;
|
||||
use NPTest;
|
||||
|
||||
my $tests = 46;
|
||||
my $tests = 8+38+2+2;
|
||||
plan tests => $tests;
|
||||
my $res;
|
||||
|
||||
|
@ -44,10 +44,10 @@ SKIP: {
|
|||
like( $res->output, "/check_snmp: Invalid SNMP version - 3c/" );
|
||||
|
||||
SKIP: {
|
||||
skip "no snmp host defined", 34 if ( ! $host_snmp );
|
||||
skip "no snmp host defined", 38 if ( ! $host_snmp );
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0 -w 1: -c 1:");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying uptime" );
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying uptime" );
|
||||
like($res->output, '/^SNMP OK - (\d+)/', "String contains SNMP OK");
|
||||
$res->output =~ /^SNMP OK - (\d+)/;
|
||||
my $value = $1;
|
||||
|
@ -59,19 +59,27 @@ SKIP: {
|
|||
like($res->output, '/^SNMP OK - \d+/', "String contains SNMP OK");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysDescr.0");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying sysDescr" );
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying sysDescr" );
|
||||
unlike($res->perf_output, '/sysDescr/', "Perfdata doesn't contain string values");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysDescr.0,system.sysDescr.0");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying two string OIDs, comma-separated" );
|
||||
like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysDescr.0 -o system.sysDescr.0");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying two string OIDs, repeated option" );
|
||||
like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 1:1 -c 1:1");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying hrSWRunIndex.1" );
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying hrSWRunIndex.1" );
|
||||
like($res->output, '/^SNMP OK - 1\s.*$/', "String fits SNMP OK and output format");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 0 -c 1:");
|
||||
cmp_ok( $res->return_code, '==', 1, "Exit WARNING when querying hrSWRunIndex.1 and warn-th doesn't apply " );
|
||||
cmp_ok( $res->return_code, '==', 1, "Exit WARNING when querying hrSWRunIndex.1 and warn-th doesn't apply " );
|
||||
like($res->output, '/^SNMP WARNING - \*1\*\s.*$/', "String matches SNMP WARNING and output format");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w :0 -c 0");
|
||||
cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL when querying hrSWRunIndex.1 and crit-th doesn't apply" );
|
||||
cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL when querying hrSWRunIndex.1 and crit-th doesn't apply" );
|
||||
like($res->output, '/^SNMP CRITICAL - \*1\*\s.*$/', "String matches SNMP CRITICAL and output format");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o ifIndex.2,ifIndex.1 -w 1:2 -c 1:2");
|
||||
|
@ -123,14 +131,14 @@ SKIP: {
|
|||
SKIP: {
|
||||
skip "no non responsive host defined", 2 if ( ! $host_nonresponsive );
|
||||
$res = NPTest->testCmd( "./check_snmp -H $host_nonresponsive -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:");
|
||||
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
|
||||
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
|
||||
like($res->output, '/External command error: Timeout: No Response from /', "String matches timeout problem");
|
||||
}
|
||||
|
||||
SKIP: {
|
||||
skip "no non invalid host defined", 2 if ( ! $hostname_invalid );
|
||||
$res = NPTest->testCmd( "./check_snmp -H $hostname_invalid -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:");
|
||||
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
|
||||
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
|
||||
like($res->output, '/External command error: .*(nosuchhost|Name or service not known|Unknown host)/', "String matches invalid host");
|
||||
}
|
||||
|
||||
|
|
21
plugins/tests/certs/expired-cert.pem
Normal file
21
plugins/tests/certs/expired-cert.pem
Normal file
|
@ -0,0 +1,21 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDYzCCAsygAwIBAgIJAJISzcX71f5pMA0GCSqGSIb3DQEBBAUAMH8xCzAJBgNV
|
||||
BAYTAlVLMRMwEQYDVQQIEwpEZXJieXNoaXJlMQ8wDQYDVQQHEwZCZWxwZXIxFzAV
|
||||
BgNVBAoTDk5hZ2lvcyBQbHVnaW5zMREwDwYDVQQDEwhUb24gVm9vbjEeMBwGCSqG
|
||||
SIb3DQEJARYPdG9udm9vbkBtYWMuY29tMB4XDTA5MDMwNjAwMTMxNVoXDTA5MDMw
|
||||
NTAwMTMxNlowfzELMAkGA1UEBhMCVUsxEzARBgNVBAgTCkRlcmJ5c2hpcmUxDzAN
|
||||
BgNVBAcTBkJlbHBlcjEXMBUGA1UEChMOTmFnaW9zIFBsdWdpbnMxETAPBgNVBAMT
|
||||
CFRvbiBWb29uMR4wHAYJKoZIhvcNAQkBFg90b252b29uQG1hYy5jb20wgZ8wDQYJ
|
||||
KoZIhvcNAQEBBQADgY0AMIGJAoGBAOQHP4JnzACi4q6quXAiK+gTSffG6yyjEV+K
|
||||
iyutRgBF2MdF03X5ls0wENw/5fnMTrHynl4XoGoV/rD4CR2hGT0m7dv7Vu0MRLlP
|
||||
J1SCiFeMuQS30zzLMJr0A7IW869qRlKQmzxs1JT6XDbSoNQuF154zoxwNsKlMjoX
|
||||
tJSHN2YpAgMBAAGjgeYwgeMwHQYDVR0OBBYEFHWjM9OQldrDLMcAfPnUVfGxlzOp
|
||||
MIGzBgNVHSMEgaswgaiAFHWjM9OQldrDLMcAfPnUVfGxlzOpoYGEpIGBMH8xCzAJ
|
||||
BgNVBAYTAlVLMRMwEQYDVQQIEwpEZXJieXNoaXJlMQ8wDQYDVQQHEwZCZWxwZXIx
|
||||
FzAVBgNVBAoTDk5hZ2lvcyBQbHVnaW5zMREwDwYDVQQDEwhUb24gVm9vbjEeMBwG
|
||||
CSqGSIb3DQEJARYPdG9udm9vbkBtYWMuY29tggkAkhLNxfvV/mkwDAYDVR0TBAUw
|
||||
AwEB/zANBgkqhkiG9w0BAQQFAAOBgQDHjoXoGwBamCiNplTt93jH/TO08RATdZP5
|
||||
45hlxv2+PKCjjTiFa2mjAvopFiqmYsr40XYEmpeYMiaOzOW5rBjtqBAT/JJWyfda
|
||||
SCmj3swqyKus63rv/iuokIhZzBdhbB+eOJJrmwT2SEc5KdRaipH0QAGF1nZAAGzo
|
||||
6xW7hkzYog==
|
||||
-----END CERTIFICATE-----
|
15
plugins/tests/certs/expired-key.pem
Normal file
15
plugins/tests/certs/expired-key.pem
Normal file
|
@ -0,0 +1,15 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQDkBz+CZ8wAouKuqrlwIivoE0n3xussoxFfiosrrUYARdjHRdN1
|
||||
+ZbNMBDcP+X5zE6x8p5eF6BqFf6w+AkdoRk9Ju3b+1btDES5TydUgohXjLkEt9M8
|
||||
yzCa9AOyFvOvakZSkJs8bNSU+lw20qDULhdeeM6McDbCpTI6F7SUhzdmKQIDAQAB
|
||||
AoGARgI3rHjjuDpKMGg4IMZNBqaNaiZHY9/44IVvrww21rSbFqtIfgsQEpU0R/rS
|
||||
R7xDWPztRGQqmwd/t6OfYNpqHbjO1MWzasVBVnzue5P59Y1xy1h0LZF8+a9GY++0
|
||||
uAGUC24jsXSmypNVzoX+ZKyinA3oYV/etdPYx1W8Ms5XIzUCQQD7xwhMuLok6Kbq
|
||||
UEgiSfBTbx+haP3IiqqMF14z8QoEyD3jchydNaXEYdQxN8jEl2aPrMqTc6x8Jq4/
|
||||
ai0OkB+fAkEA59pAmN81HylV7+CsVjLOSbJqzau7NDxSs2uutxhHZRwz0e25wVer
|
||||
fA03l08u0ebC/TDHkmHV6ikCryM5HU2FNwJAVZJFzd2S1myEHmr+uTisB49jDrbi
|
||||
WkBWypo+mCS6JPnxntXvx7auClq9haTSBY73eqldiFPuMZvr6P2rJqHxPQJBAOTM
|
||||
quaxjti7kATy8N73sD9mBKQGju1TgkFxSK+DFCGhnTnToXY9MAtxd6SoDYoyccYu
|
||||
dyPrzJAR/IYc+mYCdC0CQDKlZuMPVXEgvGaQapzMQ++5yJRvMZF4tWvONBs0OCE9
|
||||
QYarsTi5M20cymMBXHOLZIjqwsni4G/C9kqJSvC75Vg=
|
||||
-----END RSA PRIVATE KEY-----
|
21
plugins/tests/certs/server-cert.pem
Normal file
21
plugins/tests/certs/server-cert.pem
Normal file
|
@ -0,0 +1,21 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDYzCCAsygAwIBAgIJAL8LkpNwzYdxMA0GCSqGSIb3DQEBBAUAMH8xCzAJBgNV
|
||||
BAYTAlVLMRMwEQYDVQQIEwpEZXJieXNoaXJlMQ8wDQYDVQQHEwZCZWxwZXIxFzAV
|
||||
BgNVBAoTDk5hZ2lvcyBQbHVnaW5zMREwDwYDVQQDEwhUb24gVm9vbjEeMBwGCSqG
|
||||
SIb3DQEJARYPdG9udm9vbkBtYWMuY29tMB4XDTA5MDMwNTIxNDEyOFoXDTE5MDMw
|
||||
MzIxNDEyOFowfzELMAkGA1UEBhMCVUsxEzARBgNVBAgTCkRlcmJ5c2hpcmUxDzAN
|
||||
BgNVBAcTBkJlbHBlcjEXMBUGA1UEChMOTmFnaW9zIFBsdWdpbnMxETAPBgNVBAMT
|
||||
CFRvbiBWb29uMR4wHAYJKoZIhvcNAQkBFg90b252b29uQG1hYy5jb20wgZ8wDQYJ
|
||||
KoZIhvcNAQEBBQADgY0AMIGJAoGBAKcWMBtNtfY8vZXk0SN6/EYTVN/LOvaOSegy
|
||||
oVdLoGwuwjagk+XmCzvCqHZRp8lnCLay7AO8AQI7TSN02ihCcSrgGA9OT+HciIJ1
|
||||
l5/kEYUAuA1PR6YKK/T713zUAlMzy2tsugx5+xSsSEwsXkmne52jJiG/wuE5CLT0
|
||||
9pF8HQqHAgMBAAGjgeYwgeMwHQYDVR0OBBYEFGioSPQ/rdE19+zaeY2YvHTXlUDI
|
||||
MIGzBgNVHSMEgaswgaiAFGioSPQ/rdE19+zaeY2YvHTXlUDIoYGEpIGBMH8xCzAJ
|
||||
BgNVBAYTAlVLMRMwEQYDVQQIEwpEZXJieXNoaXJlMQ8wDQYDVQQHEwZCZWxwZXIx
|
||||
FzAVBgNVBAoTDk5hZ2lvcyBQbHVnaW5zMREwDwYDVQQDEwhUb24gVm9vbjEeMBwG
|
||||
CSqGSIb3DQEJARYPdG9udm9vbkBtYWMuY29tggkAvwuSk3DNh3EwDAYDVR0TBAUw
|
||||
AwEB/zANBgkqhkiG9w0BAQQFAAOBgQCdqasaIO6JiV5ONFG6Tr1++85UfEdZKMUX
|
||||
N2NHiNNUunolIZEYR+dW99ezKmHlDiQ/tMgoLVYpl2Ubho2pAkLGQR+W0ZASgWQ1
|
||||
NjfV27Rv0y6lYQMTA0lVAU93L1x9reo3FMedmL5+H+lIEpLCxEPtAJNISrJOneZB
|
||||
W5jDadwkoQ==
|
||||
-----END CERTIFICATE-----
|
15
plugins/tests/certs/server-key.pem
Normal file
15
plugins/tests/certs/server-key.pem
Normal file
|
@ -0,0 +1,15 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICWwIBAAKBgQCnFjAbTbX2PL2V5NEjevxGE1Tfyzr2jknoMqFXS6BsLsI2oJPl
|
||||
5gs7wqh2UafJZwi2suwDvAECO00jdNooQnEq4BgPTk/h3IiCdZef5BGFALgNT0em
|
||||
Civ0+9d81AJTM8trbLoMefsUrEhMLF5Jp3udoyYhv8LhOQi09PaRfB0KhwIDAQAB
|
||||
AoGAfpxclcP8N3vteXErXURrd7pcXT0GECDgNjhvc9PV20RPXM+vYs1AA+fMeeQE
|
||||
TaRqwO6x016aMRO4rz5ztYArecTBznkds1k59pkN/Ne/nsueU4tvGK8MNyS2o986
|
||||
Voohqkaq4Lcy1bcHJb9su1ELjegEr1R76Mz452Hsy+uTbAECQQDcg/tZWKVeh5CQ
|
||||
dOEB3YWHwfn0NDgfPm/X2i2kAZ7n7URaUy/ffdlfsrr1mBtHCfedLoOxmmlNfEpM
|
||||
hXAAurSHAkEAwfk7fEb0iN0Sj9gTozO7c6Ky10KwePZyjVzqSQIiJq3NX8BEaIeb
|
||||
51TXxE5VxaLjjMLRkA0hWTYXClgERFZ6AQJAN7ChPqwzf08PRFwwIw911JY5cOHr
|
||||
NoDHMCUql5vNLNdwBruxgGjBB/kUXEfgw60RusFvgt/zLh1wiii844JDawJAGQBF
|
||||
sYP3urg7zzx7c3qUe5gJ0wLuefjR1PSX4ecbfb7DDMdcSdjIuG1QDiZGmd2f1KG7
|
||||
nwSCOtxk5dloW2KGAQJAQh/iBn0QhfKLFAP5eZBVk8E8XlZuw+S2DLy5SnBlIiYJ
|
||||
GB5I2OClgtudXMv1labFrcST8O9eFrtsrhU1iUGUOw==
|
||||
-----END RSA PRIVATE KEY-----
|
398
plugins/tests/check_http.t
Executable file
398
plugins/tests/check_http.t
Executable file
|
@ -0,0 +1,398 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Test check_http by having an actual HTTP server running
|
||||
#
|
||||
# To create the https server certificate:
|
||||
# openssl req -new -x509 -keyout server-key.pem -out server-cert.pem -days 3650 -nodes
|
||||
# Country Name (2 letter code) [AU]:UK
|
||||
# State or Province Name (full name) [Some-State]:Derbyshire
|
||||
# Locality Name (eg, city) []:Belper
|
||||
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Nagios Plugins
|
||||
# Organizational Unit Name (eg, section) []:
|
||||
# Common Name (eg, YOUR name) []:Ton Voon
|
||||
# Email Address []:tonvoon@mac.com
|
||||
|
||||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
use FindBin qw($Bin);
|
||||
|
||||
use HTTP::Daemon;
|
||||
use HTTP::Status;
|
||||
use HTTP::Response;
|
||||
|
||||
my $servers = { http => 0 }; # HTTP::Daemon should always be available
|
||||
eval { require HTTP::Daemon::SSL };
|
||||
if ($@) {
|
||||
diag "Cannot load HTTP::Daemon::SSL: $@";
|
||||
} else {
|
||||
$servers->{https} = 0;
|
||||
}
|
||||
|
||||
# set a fixed version, so the header size doesn't vary
|
||||
$HTTP::Daemon::VERSION = "1.00";
|
||||
|
||||
my $port_http = 50000 + int(rand(1000));
|
||||
my $port_https = $port_http + 1;
|
||||
my $port_https_expired = $port_http + 2;
|
||||
|
||||
# This array keeps sockets around for implementing timeouts
|
||||
my @persist;
|
||||
|
||||
# Start up all servers
|
||||
my @pids;
|
||||
my $pid = fork();
|
||||
if ($pid) {
|
||||
# Parent
|
||||
push @pids, $pid;
|
||||
if (exists $servers->{https}) {
|
||||
# Fork a normal HTTPS server
|
||||
$pid = fork();
|
||||
if ($pid) {
|
||||
# Parent
|
||||
push @pids, $pid;
|
||||
# Fork an expired cert server
|
||||
$pid = fork();
|
||||
if ($pid) {
|
||||
push @pids, $pid;
|
||||
} else {
|
||||
my $d = HTTP::Daemon::SSL->new(
|
||||
LocalPort => $port_https_expired,
|
||||
LocalAddr => "127.0.0.1",
|
||||
SSL_cert_file => "$Bin/certs/expired-cert.pem",
|
||||
SSL_key_file => "$Bin/certs/expired-key.pem",
|
||||
) || die;
|
||||
print "Please contact https expired at: <URL:", $d->url, ">\n";
|
||||
run_server( $d );
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
my $d = HTTP::Daemon::SSL->new(
|
||||
LocalPort => $port_https,
|
||||
LocalAddr => "127.0.0.1",
|
||||
SSL_cert_file => "$Bin/certs/server-cert.pem",
|
||||
SSL_key_file => "$Bin/certs/server-key.pem",
|
||||
) || die;
|
||||
print "Please contact https at: <URL:", $d->url, ">\n";
|
||||
run_server( $d );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
# give our webservers some time to startup
|
||||
sleep(1);
|
||||
} else {
|
||||
# Child
|
||||
#print "child\n";
|
||||
my $d = HTTP::Daemon->new(
|
||||
LocalPort => $port_http,
|
||||
LocalAddr => "127.0.0.1",
|
||||
) || die;
|
||||
print "Please contact http at: <URL:", $d->url, ">\n";
|
||||
run_server( $d );
|
||||
exit;
|
||||
}
|
||||
|
||||
# Run the same server on http and https
|
||||
sub run_server {
|
||||
my $d = shift;
|
||||
MAINLOOP: while (my $c = $d->accept ) {
|
||||
while (my $r = $c->get_request) {
|
||||
if ($r->method eq "GET" and $r->url->path =~ m^/statuscode/(\d+)^) {
|
||||
$c->send_basic_header($1);
|
||||
$c->send_crlf;
|
||||
} elsif ($r->method eq "GET" and $r->url->path =~ m^/file/(.*)^) {
|
||||
$c->send_basic_header;
|
||||
$c->send_crlf;
|
||||
$c->send_file_response("$Bin/var/$1");
|
||||
} elsif ($r->method eq "GET" and $r->url->path eq "/slow") {
|
||||
$c->send_basic_header;
|
||||
$c->send_crlf;
|
||||
sleep 1;
|
||||
$c->send_response("slow");
|
||||
} elsif ($r->url->path eq "/method") {
|
||||
if ($r->method eq "DELETE") {
|
||||
$c->send_error(RC_METHOD_NOT_ALLOWED);
|
||||
} elsif ($r->method eq "foo") {
|
||||
$c->send_error(RC_NOT_IMPLEMENTED);
|
||||
} else {
|
||||
$c->send_status_line(200, $r->method);
|
||||
}
|
||||
} elsif ($r->url->path eq "/postdata") {
|
||||
$c->send_basic_header;
|
||||
$c->send_crlf;
|
||||
$c->send_response($r->method.":".$r->content);
|
||||
} elsif ($r->url->path eq "/redirect") {
|
||||
$c->send_redirect( "/redirect2" );
|
||||
} elsif ($r->url->path eq "/redir_external") {
|
||||
$c->send_redirect(($d->isa('HTTP::Daemon::SSL') ? "https" : "http") . "://169.254.169.254/redirect2" );
|
||||
} elsif ($r->url->path eq "/redirect2") {
|
||||
$c->send_basic_header;
|
||||
$c->send_crlf;
|
||||
$c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' ));
|
||||
} elsif ($r->url->path eq "/redir_timeout") {
|
||||
$c->send_redirect( "/timeout" );
|
||||
} elsif ($r->url->path eq "/timeout") {
|
||||
# Keep $c from being destroyed, but prevent severe leaks
|
||||
unshift @persist, $c;
|
||||
delete($persist[1000]);
|
||||
next MAINLOOP;
|
||||
} else {
|
||||
$c->send_error(RC_FORBIDDEN);
|
||||
}
|
||||
$c->close;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
foreach my $pid (@pids) {
|
||||
if ($pid) { print "Killing $pid\n"; kill "INT", $pid }
|
||||
}
|
||||
};
|
||||
|
||||
if ($ARGV[0] && $ARGV[0] eq "-d") {
|
||||
while (1) {
|
||||
sleep 100;
|
||||
}
|
||||
}
|
||||
|
||||
my $common_tests = 66;
|
||||
my $ssl_only_tests = 6;
|
||||
if (-x "./check_http") {
|
||||
plan tests => $common_tests * 2 + $ssl_only_tests;
|
||||
} else {
|
||||
plan skip_all => "No check_http compiled";
|
||||
}
|
||||
|
||||
my $result;
|
||||
my $command = "./check_http -H 127.0.0.1";
|
||||
|
||||
run_common_tests( { command => "$command -p $port_http" } );
|
||||
SKIP: {
|
||||
skip "HTTP::Daemon::SSL not installed", $common_tests + $ssl_only_tests if ! exists $servers->{https};
|
||||
run_common_tests( { command => "$command -p $port_https", ssl => 1 } );
|
||||
|
||||
$result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
|
||||
is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
|
||||
is( $result->output, 'OK - Certificate will expire on 03/03/2019 21:41.', "output ok" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
|
||||
is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
|
||||
like( $result->output, '/WARNING - Certificate expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
|
||||
|
||||
# Expired cert tests
|
||||
$result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
|
||||
is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
|
||||
is( $result->output,
|
||||
'CRITICAL - Certificate expired on 03/05/2009 00:13.',
|
||||
"output ok" );
|
||||
|
||||
}
|
||||
|
||||
sub run_common_tests {
|
||||
my ($opts) = @_;
|
||||
my $command = $opts->{command};
|
||||
if ($opts->{ssl}) {
|
||||
$command .= " --ssl";
|
||||
}
|
||||
|
||||
$result = NPTest->testCmd( "$command -u /file/root" );
|
||||
is( $result->return_code, 0, "/file/root");
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u /file/root -s Root" );
|
||||
is( $result->return_code, 0, "/file/root search for string");
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u /file/root -s NonRoot" );
|
||||
is( $result->return_code, 2, "Missing string check");
|
||||
like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRoot' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
|
||||
|
||||
$result = NPTest->testCmd( "$command -u /file/root -s NonRootWithOver30charsAndMoreFunThanAWetFish" );
|
||||
is( $result->return_code, 2, "Missing string check");
|
||||
like( $result->output, qr%HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRootWithOver30charsAndM...' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
|
||||
|
||||
|
||||
my $cmd;
|
||||
$cmd = "$command -u /slow";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, "$cmd");
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
$result->output =~ /in ([\d\.]+) second/;
|
||||
cmp_ok( $1, ">", 1, "Time is > 1 second" );
|
||||
|
||||
$cmd = "$command -u /statuscode/200";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/200 -e 200";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: Status line output matched "200" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/201";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/201 -e 201";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: Status line output matched "201" - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/201 -e 200";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 2, $cmd);
|
||||
like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port \d+: HTTP/1.1 201 Created/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/200 -e 200,201,202";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/201 -e 200,201,202";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /statuscode/203 -e 200,201,202";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 2, $cmd);
|
||||
like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port (\d+): HTTP/1.1 203 Non-Authoritative Information/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j HEAD -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 HEAD - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j POST -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j GET -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -P foo -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j DELETE -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 1, $cmd);
|
||||
like( $result->output, '/^HTTP WARNING: HTTP/1.1 405 Method Not Allowed/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j foo -u /method";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 2, $cmd);
|
||||
like( $result->output, '/^HTTP CRITICAL: HTTP/1.1 501 Not Implemented/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -P stufftoinclude -u /postdata -s POST:stufftoinclude";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -j PUT -P stufftoinclude -u /postdata -s PUT:stufftoinclude";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
# To confirm that the free doesn't segfault
|
||||
$cmd = "$command -P stufftoinclude -j PUT -u /postdata -s PUT:stufftoinclude";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /redirect";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -f follow -u /redirect";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -u /redirect -k 'follow: me'";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -f follow -u /redirect -k 'follow: me'";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -f sticky -u /redirect -k 'follow: me'";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
$cmd = "$command -f stickyport -u /redirect -k 'follow: me'";
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
is( $result->return_code, 0, $cmd);
|
||||
like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
|
||||
|
||||
# These tests may block
|
||||
print "ALRM\n";
|
||||
|
||||
# stickyport - on full urlS port is set back to 80 otherwise
|
||||
$cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected";
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
||||
alarm(2);
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
alarm(0); };
|
||||
isnt( $@, "alarm\n", $cmd );
|
||||
is( $result->return_code, 0, $cmd );
|
||||
|
||||
# Let's hope there won't be any web server on :80 returning "redirected"!
|
||||
$cmd = "$command -f sticky -u /redir_external -t 5 -s redirected";
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
||||
alarm(2);
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
alarm(0); };
|
||||
isnt( $@, "alarm\n", $cmd );
|
||||
isnt( $result->return_code, 0, $cmd );
|
||||
|
||||
# Test an external address - timeout
|
||||
SKIP: {
|
||||
skip "This doesn't seems to work all the time", 1 unless ($ENV{HTTP_EXTERNAL});
|
||||
$cmd = "$command -f follow -u /redir_external -t 5";
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
||||
alarm(2);
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
alarm(0); };
|
||||
is( $@, "alarm\n", $cmd );
|
||||
}
|
||||
|
||||
$cmd = "$command -u /timeout -t 5";
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
||||
alarm(2);
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
alarm(0); };
|
||||
is( $@, "alarm\n", $cmd );
|
||||
|
||||
$cmd = "$command -f follow -u /redir_timeout -t 2";
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
||||
alarm(5);
|
||||
$result = NPTest->testCmd( $cmd );
|
||||
alarm(0); };
|
||||
isnt( $@, "alarm\n", $cmd );
|
||||
|
||||
}
|
||||
|
80
plugins/tests/check_nt.t
Executable file
80
plugins/tests/check_nt.t
Executable file
|
@ -0,0 +1,80 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Test check_nt by having a stub check_nt daemon
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
use FindBin qw($Bin);
|
||||
|
||||
use IO::Socket;
|
||||
use IO::Select;
|
||||
use POSIX;
|
||||
|
||||
my $port = 50000 + int(rand(1000));
|
||||
|
||||
my $pid = fork();
|
||||
if ($pid) {
|
||||
# Parent
|
||||
#print "parent\n";
|
||||
# give our webserver some time to startup
|
||||
sleep(1);
|
||||
} else {
|
||||
# Child
|
||||
#print "child\n";
|
||||
|
||||
my $server = IO::Socket::INET->new(
|
||||
LocalPort => $port,
|
||||
Type => SOCK_STREAM,
|
||||
Reuse => 1,
|
||||
Proto => "tcp",
|
||||
Listen => 10,
|
||||
) or die "Cannot be a tcp server on port $port: $@";
|
||||
|
||||
$server->autoflush(1);
|
||||
|
||||
print "Please contact me at port $port\n";
|
||||
while (my $client = $server->accept ) {
|
||||
my $data = "";
|
||||
my $rv = $client->recv($data, POSIX::BUFSIZ, 0);
|
||||
|
||||
my ($password, $command, $arg) = split('&', $data);
|
||||
|
||||
if ($command eq "4") {
|
||||
if ($arg eq "c") {
|
||||
print $client "930000000&1000000000";
|
||||
} elsif ($arg eq "d") {
|
||||
print $client "UNKNOWN: Drive is not a fixed drive";
|
||||
}
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
END { if ($pid) { print "Killing $pid\n"; kill "INT", $pid } };
|
||||
|
||||
if ($ARGV[0] && $ARGV[0] eq "-d") {
|
||||
sleep 1000;
|
||||
}
|
||||
|
||||
if (-x "./check_nt") {
|
||||
plan tests => 5;
|
||||
} else {
|
||||
plan skip_all => "No check_nt compiled";
|
||||
}
|
||||
|
||||
my $result;
|
||||
my $command = "./check_nt -H 127.0.0.1 -p $port";
|
||||
|
||||
$result = NPTest->testCmd( "$command -v USEDDISKSPACE -l c" );
|
||||
is( $result->return_code, 0, "USEDDISKSPACE c");
|
||||
is( $result->output, q{c:\ - total: 0.93 Gb - used: 0.07 Gb (7%) - free 0.87 Gb (93%) | 'c:\ Used Space'=0.07Gb;0.00;0.00;0.00;0.93}, "Output right" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -v USEDDISKSPACE -l d" );
|
||||
is( $result->return_code, 3, "USEDDISKSPACE d - invalid");
|
||||
is( $result->output, "Free disk space : Invalid drive", "Output right" );
|
||||
|
||||
$result = NPTest->testCmd( "./check_nt -v USEDDISKSPACE -l d" );
|
||||
is( $result->return_code, 3, "Fail if -H missing");
|
||||
|
115
plugins/tests/check_procs.t
Normal file
115
plugins/tests/check_procs.t
Normal file
|
@ -0,0 +1,115 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Test check_procs using input files
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
|
||||
if (-x "./check_procs") {
|
||||
plan tests => 48;
|
||||
} else {
|
||||
plan skip_all => "No check_procs compiled";
|
||||
}
|
||||
|
||||
my $result;
|
||||
my $command = "./check_procs --input-file=tests/var/ps-axwo.darwin";
|
||||
|
||||
$result = NPTest->testCmd( "$command" );
|
||||
is( $result->return_code, 0, "Run with no options" );
|
||||
like( $result->output, '/^PROCS OK: 95 processes$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -w 5" );
|
||||
is( $result->return_code, 1, "Checking > 5 processes" );
|
||||
like( $result->output, '/^PROCS WARNING: 95 processes$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -w 4 -c 44" );
|
||||
is( $result->return_code, 2, "Checking critical" );
|
||||
like( $result->output, '/^PROCS CRITICAL: 95 processes$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -w 100 -c 200" );
|
||||
is( $result->return_code, 0, "Checking no threshold breeched" );
|
||||
like( $result->output, '/^PROCS OK: 95 processes$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -C launchd -c 5" );
|
||||
is( $result->return_code, 2, "Checking processes filtered by command name" );
|
||||
like( $result->output, '/^PROCS CRITICAL: 6 processes with command name \'launchd\'$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u 501 -w 39 -c 41" );
|
||||
is( $result->return_code, 1, "Checking processes filtered by userid" );
|
||||
like( $result->output, '/^PROCS WARNING: 40 processes with UID = 501 (.*)$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -C launchd -u 501" );
|
||||
is( $result->return_code, 0, "Checking processes filtered by command name and userid" );
|
||||
like( $result->output, '/^PROCS OK: 1 process with command name \'launchd\', UID = 501 (.*)$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u -2 -w 2:2" );
|
||||
is( $result->return_code, 1, "Checking processes with userid=-2" );
|
||||
like( $result->output, '/^PROCS WARNING: 3 processes with UID = -2 \(nobody\)$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u -2 -w 3:3" );
|
||||
is( $result->return_code, 0, "Checking processes with userid=-2 past threshold" );
|
||||
like( $result->output, '/^PROCS OK: 3 processes with UID = -2 \(nobody\)$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u -2 -a usb" );
|
||||
is( $result->return_code, 0, "Checking processes with userid=-2 and usb in arguments" );
|
||||
like( $result->output, '/^PROCS OK: 1 process with UID = -2 \(nobody\), args \'usb\'/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -u -2 -a UsB" );
|
||||
is( $result->return_code, 0, "Checking case sensitivity of args" );
|
||||
like( $result->output, '/^PROCS OK: 0 processes with UID = -2 \(nobody\), args \'UsB\'/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" );
|
||||
is( $result->return_code, 0, "Checking regexp search of arguments" );
|
||||
is( $result->output, "PROCS OK: 1 process with regex args 'mdworker.*501'", "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --vsz 1000000" );
|
||||
is( $result->return_code, 0, "Checking filter by VSZ" );
|
||||
like( $result->output, '/^PROCS OK: 24 processes with VSZ >= 1000000$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --rss 100000" );
|
||||
is( $result->return_code, 0, "Checking filter by RSS" );
|
||||
like( $result->output, '/^PROCS OK: 3 processes with RSS >= 100000$/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -s S" );
|
||||
is( $result->return_code, 0, "Checking filter for sleeping processes" );
|
||||
like( $result->output, '/^PROCS OK: 44 processes with STATE = S/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -s Z" );
|
||||
is( $result->return_code, 0, "Checking filter for zombies" );
|
||||
like( $result->output, '/^PROCS OK: 1 process with STATE = Z/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -p 1 -c 30" );
|
||||
is( $result->return_code, 2, "Checking filter for parent id = 1" );
|
||||
like( $result->output, '/^PROCS CRITICAL: 39 processes with PPID = 1/', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -P 0.71" );
|
||||
is( $result->return_code, 0, "Checking filter for percentage cpu > 0.71" );
|
||||
is( $result->output, 'PROCS OK: 7 processes with PCPU >= 0.71', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command -P 0.70" );
|
||||
is( $result->return_code, 0, "Checking filter for percentage cpu > 0.70" );
|
||||
is( $result->output, 'PROCS OK: 8 processes with PCPU >= 0.70', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --metric=CPU -w 8" );
|
||||
is( $result->return_code, 1, "Checking against metric of CPU > 8" );
|
||||
is( $result->output, 'CPU WARNING: 1 warn out of 95 processes', "Output correct" );
|
||||
|
||||
# TODO: Because of a conversion to int, if CPU is 1.45%, will not alert, but 2.01% will.
|
||||
$result = NPTest->testCmd( "$command --metric=CPU -w 1 -u 501 -v" );
|
||||
is( $result->return_code, 1, "Checking against metric of CPU > 1 with uid=501 - TODO" );
|
||||
is( $result->output, 'CPU WARNING: 2 warn out of 40 processes with UID = 501 (tonvoon) [Skype, PubSubAgent]', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --metric=VSZ -w 1200000 -v" );
|
||||
is( $result->return_code, 1, "Checking against VSZ > 1.2GB" );
|
||||
is( $result->output, 'VSZ WARNING: 4 warn out of 95 processes [WindowServer, Safari, Mail, Skype]', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --metric=VSZ -w 1200000 -v" );
|
||||
is( $result->return_code, 1, "Checking against VSZ > 1.2GB" );
|
||||
is( $result->output, 'VSZ WARNING: 4 warn out of 95 processes [WindowServer, Safari, Mail, Skype]', "Output correct" );
|
||||
|
||||
$result = NPTest->testCmd( "$command --metric=RSS -c 70000 -v" );
|
||||
is( $result->return_code, 2, "Checking against RSS > 70MB" );
|
||||
is( $result->output, 'RSS CRITICAL: 5 crit, 0 warn out of 95 processes [WindowServer, SystemUIServer, Safari, Mail, Safari]', "Output correct" );
|
||||
|
174
plugins/tests/check_snmp.t
Executable file
174
plugins/tests/check_snmp.t
Executable file
|
@ -0,0 +1,174 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Test check_snmp by having an actual SNMP agent running
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
use FindBin qw($Bin);
|
||||
|
||||
# Check that all dependent modules are available
|
||||
eval {
|
||||
require NetSNMP::OID;
|
||||
require NetSNMP::agent;
|
||||
require NetSNMP::ASN;
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
plan skip_all => "Missing required module for test: $@";
|
||||
}
|
||||
|
||||
my $port_snmp = 16100 + int(rand(100));
|
||||
|
||||
|
||||
# Start up server
|
||||
my @pids;
|
||||
my $pid = fork();
|
||||
if ($pid) {
|
||||
# Parent
|
||||
push @pids, $pid;
|
||||
# give our agent some time to startup
|
||||
sleep(1);
|
||||
} else {
|
||||
# Child
|
||||
#print "child\n";
|
||||
|
||||
print "Please contact SNMP at: $port_snmp\n";
|
||||
close(STDERR); # Coment out to debug snmpd problems (most errors sent there are OK)
|
||||
exec("snmpd -c tests/conf/snmpd.conf -C -f -r udp:$port_snmp");
|
||||
}
|
||||
|
||||
END {
|
||||
foreach my $pid (@pids) {
|
||||
if ($pid) { print "Killing $pid\n"; kill "INT", $pid }
|
||||
}
|
||||
};
|
||||
|
||||
if ($ARGV[0] && $ARGV[0] eq "-d") {
|
||||
while (1) {
|
||||
sleep 100;
|
||||
}
|
||||
}
|
||||
|
||||
my $tests = 33;
|
||||
if (-x "./check_snmp") {
|
||||
plan tests => $tests;
|
||||
} else {
|
||||
plan skip_all => "No check_snmp compiled";
|
||||
}
|
||||
|
||||
my $res;
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.0");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying a multi-line string" );
|
||||
like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
|
||||
like($res->output, '/'.quotemeta('SNMP OK - Cisco Internetwork Operating System Software |
|
||||
.1.3.6.1.4.1.8072.3.2.67.0:
|
||||
"Cisco Internetwork Operating System Software
|
||||
IOS (tm) Catalyst 4000 \"L3\" Switch Software (cat4000-I9K91S-M), Version
|
||||
12.2(20)EWA, RELEASE SOFTWARE (fc1)
|
||||
Technical Support: http://www.cisco.com/techsupport
|
||||
Copyright (c) 1986-2004 by cisco Systems, Inc.
|
||||
"').'/m', "String contains all lines");
|
||||
|
||||
# sysContact.0 is "Alice" (from our snmpd.conf)
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.0 -o sysContact.0 -o .1.3.6.1.4.1.8072.3.2.67.1");
|
||||
cmp_ok( $res->return_code, '==', 0, "Exit OK when querying multi-line OIDs" );
|
||||
like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
|
||||
like($res->output, '/'.quotemeta('SNMP OK - Cisco Internetwork Operating System Software Alice Kisco Outernetwork Oserating Gystem Totware |
|
||||
.1.3.6.1.4.1.8072.3.2.67.0:
|
||||
"Cisco Internetwork Operating System Software
|
||||
IOS (tm) Catalyst 4000 \"L3\" Switch Software (cat4000-I9K91S-M), Version
|
||||
12.2(20)EWA, RELEASE SOFTWARE (fc1)
|
||||
Technical Support: http://www.cisco.com/techsupport
|
||||
Copyright (c) 1986-2004 by cisco Systems, Inc.
|
||||
"
|
||||
.1.3.6.1.4.1.8072.3.2.67.1:
|
||||
"Kisco Outernetwork Oserating Gystem Totware
|
||||
Copyleft (c) 2400-2689 by kisco Systrems, Inc."').'/m', "String contains all lines with multiple OIDs");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.2");
|
||||
like($res->output, '/'.quotemeta('SNMP OK - This should not confuse check_snmp \"parser\" |
|
||||
.1.3.6.1.4.1.8072.3.2.67.2:
|
||||
"This should not confuse check_snmp \"parser\"
|
||||
into thinking there is no 2nd line"').'/m', "Attempt to confuse parser No.1");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.3");
|
||||
like($res->output, '/'.quotemeta('SNMP OK - It\'s getting even harder if the line |
|
||||
.1.3.6.1.4.1.8072.3.2.67.3:
|
||||
"It\'s getting even harder if the line
|
||||
ends with with this: C:\\\\"').'/m', "Attempt to confuse parser No.2");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.4");
|
||||
like($res->output, '/'.quotemeta('SNMP OK - And now have fun with with this: \"C:\\\\\" |
|
||||
.1.3.6.1.4.1.8072.3.2.67.4:
|
||||
"And now have fun with with this: \"C:\\\\\"
|
||||
because we\'re not done yet!"').'/m', "Attempt to confuse parser No.3");
|
||||
|
||||
system("rm /usr/local/nagios/var/check_snmp/*");
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
|
||||
is($res->return_code, 0, "Returns OK");
|
||||
is($res->output, "No previous data to calculate rate - assume okay");
|
||||
|
||||
# Need to sleep, otherwise duration=0
|
||||
sleep 1;
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
|
||||
is($res->return_code, 1, "WARNING - due to going above rate calculation" );
|
||||
is($res->output, "SNMP RATE WARNING - *666* | iso.3.6.1.4.1.8072.3.2.67.10=666 ");
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
|
||||
is($res->return_code, 3, "UNKNOWN - basically the divide by zero error" );
|
||||
is($res->output, "Time duration between plugin calls is invalid");
|
||||
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
|
||||
is($res->return_code, 0, "OK for first call" );
|
||||
is($res->output, "No previous data to calculate rate - assume okay" );
|
||||
|
||||
# Need to sleep, otherwise duration=0
|
||||
sleep 1;
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
|
||||
is($res->return_code, 0, "OK as no thresholds" );
|
||||
is($res->output, "SNMP RATE OK - inoctets 666 | inoctets=666 ", "Check label");
|
||||
|
||||
sleep 2;
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
|
||||
is($res->return_code, 0, "OK as no thresholds" );
|
||||
is($res->output, "SNMP RATE OK - inoctets 333 | inoctets=333 ", "Check rate decreases due to longer interval");
|
||||
|
||||
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" );
|
||||
is($res->return_code, 0, "OK for first call" );
|
||||
is($res->output, "No previous data to calculate rate - assume okay" );
|
||||
|
||||
# Need to sleep, otherwise duration=0
|
||||
sleep 1;
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" );
|
||||
is($res->return_code, 0, "OK as no thresholds" );
|
||||
is($res->output, "SNMP RATE OK - inoctets_per_minute 39960 | inoctets_per_minute=39960 ", "Checking multiplier");
|
||||
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s '\"stringtests\"'" );
|
||||
is($res->return_code, 0, "OK as string matches" );
|
||||
is($res->output, 'SNMP OK - "stringtests" | ', "Good string match" );
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s ring" );
|
||||
is($res->return_code, 2, "CRITICAL as string doesn't match (though is a substring)" );
|
||||
is($res->output, 'SNMP CRITICAL - *"stringtests"* | ', "Failed string match" );
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 --invert-search -s '\"stringtests\"'" );
|
||||
is($res->return_code, 2, "CRITICAL as string matches but inverted" );
|
||||
is($res->output, 'SNMP CRITICAL - *"stringtests"* | ', "Inverted string match" );
|
||||
|
||||
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 --invert-search -s ring" );
|
||||
is($res->return_code, 0, "OK as string doesn't match but inverted" );
|
||||
is($res->output, 'SNMP OK - "stringtests" | ', "OK as inverted string no match" );
|
||||
|
||||
|
||||
|
110
plugins/tests/check_snmp_agent.pl
Normal file
110
plugins/tests/check_snmp_agent.pl
Normal file
|
@ -0,0 +1,110 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Subagent for testing check_snmp
|
||||
#
|
||||
|
||||
#use strict; # Doesn't work
|
||||
use NetSNMP::OID qw(:all);
|
||||
use NetSNMP::agent;
|
||||
use NetSNMP::ASN qw(ASN_OCTET_STR ASN_COUNTER ASN_COUNTER64 ASN_INTEGER ASN_INTEGER64 ASN_UNSIGNED ASN_UNSIGNED64);
|
||||
#use Math::Int64 qw(uint64); # Skip that module whie we don't need it
|
||||
sub uint64 { return $_ }
|
||||
|
||||
if (!$agent) {
|
||||
print "This program must run as an embedded NetSNMP agent\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $baseoid = '.1.3.6.1.4.1.8072.3.2.67';
|
||||
# Next are arrays of indexes (Type, initial value and increments)
|
||||
# Undef miltipliers are randomized
|
||||
my $multiline = 'Cisco Internetwork Operating System Software
|
||||
IOS (tm) Catalyst 4000 "L3" Switch Software (cat4000-I9K91S-M), Version
|
||||
12.2(20)EWA, RELEASE SOFTWARE (fc1)
|
||||
Technical Support: http://www.cisco.com/techsupport
|
||||
Copyright (c) 1986-2004 by cisco Systems, Inc.
|
||||
';
|
||||
my $multilin2 = "Kisco Outernetwork Oserating Gystem Totware
|
||||
Copyleft (c) 2400-2689 by kisco Systrems, Inc.";
|
||||
my $multilin3 = 'This should not confuse check_snmp "parser"
|
||||
into thinking there is no 2nd line';
|
||||
my $multilin4 = 'It\'s getting even harder if the line
|
||||
ends with with this: C:\\';
|
||||
my $multilin5 = 'And now have fun with with this: "C:\\"
|
||||
because we\'re not done yet!';
|
||||
|
||||
my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR);
|
||||
my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests");
|
||||
my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef);
|
||||
|
||||
# Number of elements in our OID
|
||||
my $oidelts;
|
||||
{
|
||||
my @oid = split(/\./, $baseoid);
|
||||
$oidelts = scalar(@oid);
|
||||
}
|
||||
|
||||
my $regoid = new NetSNMP::OID($baseoid);
|
||||
$agent->register('check_snmp_agent', $regoid, \&my_snmp_handler);
|
||||
|
||||
sub my_snmp_handler {
|
||||
my ($handler, $registration_info, $request_info, $requests) = @_;
|
||||
|
||||
for (my $request = $requests; $request; $request = $request->next) {
|
||||
my $oid = $request->getOID();
|
||||
my $index;
|
||||
my $next_index;
|
||||
|
||||
# Validate the OID
|
||||
my @numarray = $oid->to_array();
|
||||
if (@numarray != $oidelts) {
|
||||
if ($request_info->getMode() == MODE_GETNEXT && @numarray == ($oidelts - 1)) {
|
||||
# GETNEXT for the base oid; set it to the first index
|
||||
push(@numarray, 0);
|
||||
$next_index = 0;
|
||||
} else {
|
||||
# We got a request for the base OID or with extra elements
|
||||
$request->setError($request_info, SNMP_ERR_NOERROR);
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
$index = pop(@numarray);
|
||||
if ($index >= scalar(@fields)) {
|
||||
# Index is out of bounds
|
||||
$request->setError($request_info, SNMP_ERR_NOERROR);
|
||||
next;
|
||||
}
|
||||
|
||||
# Handle the request
|
||||
if ($request_info->getMode() == MODE_GETNEXT) {
|
||||
if (++$index >= scalar(@fields)) {
|
||||
# Index will grow out of bounds
|
||||
$request->setError($request_info, SNMP_ERR_NOERROR);
|
||||
next;
|
||||
}
|
||||
$index = (defined($next_index) ? $next_index : $index);
|
||||
$request->setOID("$baseoid.$index");
|
||||
} elsif ($request_info->getMode() != MODE_GET) {
|
||||
# Everything else is write-related modes
|
||||
$request->setError($request_info, SNMP_ERR_READONLY);
|
||||
next;
|
||||
}
|
||||
|
||||
# Set the response... setValue is a bit touchy about the data type, but accepts plain strings.
|
||||
my $value = sprintf("%s", $values[$index]);
|
||||
$request->setValue($fields[$index], $value);
|
||||
|
||||
# And update the value
|
||||
if (defined($incrts[$index])) {
|
||||
$values[$index] += $incrts[$index];
|
||||
} elsif ($fields[$index] != ASN_OCTET_STR) {
|
||||
my $minus = int(rand(2))*-1;
|
||||
$minus = 1 unless ($minus);
|
||||
my $exp = 32;
|
||||
$exp = 64 if ($fields[$index] == ASN_COUNTER64 || $fields[$index] == ASN_INTEGER64 || $fields[$index] == ASN_UNSIGNED64);
|
||||
$values[$index] = int(rand(2**$exp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
23
plugins/tests/conf/snmpd.conf
Normal file
23
plugins/tests/conf/snmpd.conf
Normal file
|
@ -0,0 +1,23 @@
|
|||
###############################################################################
|
||||
# Access Control
|
||||
###############################################################################
|
||||
|
||||
com2sec readonly localhost public
|
||||
|
||||
group MyROGroup v1 readonly
|
||||
group MyROGroup v2c readonly
|
||||
|
||||
view all included .1 80
|
||||
|
||||
access MyROGroup "" any noauth exact all none none
|
||||
|
||||
syslocation Wonderland
|
||||
syscontact Alice
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Embedded Subagents
|
||||
###############################################################################
|
||||
|
||||
perl do "tests/check_snmp_agent.pl";
|
||||
|
96
plugins/tests/var/ps-axwo.darwin
Normal file
96
plugins/tests/var/ps-axwo.darwin
Normal file
|
@ -0,0 +1,96 @@
|
|||
STAT UID PID PPID VSZ RSS %CPU UCOMM COMMAND
|
||||
Ss 0 1 0 603456 976 0.0 launchd /sbin/launchd
|
||||
Ss 0 10 1 612820 3608 0.0 kextd /usr/libexec/kextd
|
||||
Ss 0 11 1 632980 8680 0.0 DirectoryService /usr/sbin/DirectoryService
|
||||
Ss 0 12 1 602832 720 0.0 notifyd /usr/sbin/notifyd
|
||||
Ss 0 13 1 603916 1136 0.0 syslogd /usr/sbin/syslogd
|
||||
Ss 0 14 1 614928 4928 0.0 configd /usr/sbin/configd
|
||||
Ss 65 15 1 615496 5616 0.0 mDNSResponder /usr/sbin/mDNSResponder -launchd
|
||||
Ss 1 16 1 608960 2212 0.0 distnoted /usr/sbin/distnoted
|
||||
Ss 65 18 1 602432 504 0.0 launchd /sbin/launchd
|
||||
Ss 0 20 1 614836 5844 0.3 securityd /usr/sbin/securityd -i
|
||||
Ss 0 24 1 610536 2704 0.0 ntpd /usr/sbin/ntpd -n -g -p /var/run/ntpd.pid -f /var/db/ntp.drift
|
||||
Ss 0 25 1 602228 496 0.0 update /usr/sbin/update
|
||||
Ss 0 26 1 609900 2320 0.0 SystemStarter /sbin/SystemStarter
|
||||
Ss 0 30 1 834352 36264 0.3 mds /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds
|
||||
Ss 501 31 1 1110572 23948 0.0 loginwindow /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console
|
||||
Ss 0 32 1 609448 2616 0.0 KernelEventAgent /usr/sbin/KernelEventAgent
|
||||
Ss 0 34 1 609892 2204 0.0 hidd /usr/libexec/hidd
|
||||
Ss 0 35 1 624704 4284 0.0 fseventsd /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Support/fseventsd
|
||||
Ss 0 36 1 610256 2876 0.0 dynamic_pager /sbin/dynamic_pager -F /private/var/vm/swapfile
|
||||
Ss 0 39 1 613408 4140 0.0 diskarbitrationd /usr/sbin/diskarbitrationd
|
||||
Ss 0 43 1 665708 8024 0.0 blued /usr/sbin/blued
|
||||
Ss 0 44 1 609408 2828 0.0 autofsd autofsd
|
||||
Ss 0 45 1 654084 9600 0.0 socketfilterfw /usr/libexec/ApplicationFirewall/socketfilterfw
|
||||
Ss 0 46 1 704764 12788 0.0 ccc_helper /Applications/Carbon Copy Cloner.app/Contents/Resources/ccc_helper.app/Contents/MacOS/ccc_helper 3231BC22-F30F-45D8-BDE8-47A098D57ABD
|
||||
Ss 0 54 1 667956 19212 0.0 coreservicesd /System/Library/CoreServices/coreservicesd
|
||||
Ss 88 56 1 1205840 85700 1.6 WindowServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon
|
||||
Ss 0 67 1 602992 612 0.0 llipd /Library/StartupItems/ParallelsTransporter/llipd
|
||||
S 0 83 1 613352 2312 0.0 pvsnatd /Library/StartupItems/Parallels/pvsnatd
|
||||
Ss 0 94 1 712036 15056 0.0 coreaudiod /usr/sbin/coreaudiod
|
||||
Ss 501 102 1 602432 1040 0.0 launchd /sbin/launchd
|
||||
S 501 109 102 1176668 28068 0.0 Spotlight /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight
|
||||
S 501 110 102 941796 10988 0.0 UserEventAgent /usr/sbin/UserEventAgent -l Aqua
|
||||
S 501 112 102 610028 2056 0.0 pboard /usr/sbin/pboard
|
||||
S 501 114 102 1090056 29196 1.3 Dock /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_24582
|
||||
S 501 115 102 685360 14048 0.0 ATSServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Support/ATSServer
|
||||
S 501 117 102 1121904 94432 0.1 SystemUIServer /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer -psn_0_32776
|
||||
S 501 118 102 1110388 42064 1.4 Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_36873
|
||||
S 501 123 102 718264 34752 0.0 FileSyncAgent /System/Library/CoreServices/FileSyncAgent.app/Contents/MacOS/FileSyncAgent -launchedByLaunchd
|
||||
S 501 127 102 1048388 25344 0.0 smcFanControl /Applications/smcFanControl.app/Contents/MacOS/smcFanControl -psn_0_53261
|
||||
S 501 128 102 970912 12924 0.0 iTunesHelper /Applications/iTunes.app/Contents/Resources/iTunesHelper.app/Contents/MacOS/iTunesHelper -psn_0_57358
|
||||
S 501 129 102 1095920 23364 1.4 Activity Monitor /Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor -psn_0_61455
|
||||
S 501 132 102 657212 8356 0.0 dmnotifyd /System/Library/PrivateFrameworks/DMNotification.framework/Versions/Current/Resources/dmnotifyd
|
||||
Ss -2 133 1 610464 2328 0.0 usbmuxd /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/Resources/usbmuxd -launchd
|
||||
Ss 0 136 129 637456 6340 10.6 pmTool /Applications/Utilities/Activity Monitor.app/Contents/Resources/pmTool
|
||||
Ss 501 142 1 676652 8984 0.1 diskimages-helpe /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-helper -uuid F2225770-5EFF-467C-91FD-C990F056B22F -post-exec
|
||||
Ss 0 147 1 627640 5928 0.0 hdiejectd /System/Library/PrivateFrameworks/DiskImages.framework/Resources/hdiejectd
|
||||
S 501 157 102 1045492 27480 0.0 GrowlHelperApp /Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/Contents/MacOS/GrowlHelperApp -psn_0_81940
|
||||
U 501 158 102 1878012 388136 0.7 Safari /Applications/Safari.app/Contents/MacOS/Safari -psn_0_86037
|
||||
S 501 172 102 645560 11344 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_98328
|
||||
S 501 175 102 1055412 33396 0.0 Terminal /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_102425
|
||||
Z 501 186 158 0 0 0.0 Meeting Manager (Meeting Manager)
|
||||
S 501 214 102 616988 3808 0.0 ssh-agent /usr/bin/ssh-agent -l
|
||||
Ss 502 217 1 602432 1016 0.0 launchd /sbin/launchd
|
||||
S 501 499 102 1313808 130396 0.3 Mail /Applications/Mail.app/Contents/MacOS/Mail -psn_0_180268
|
||||
S 501 502 102 1091652 52168 0.0 NetNewsWire Lite /Applications/NetNewsWire Lite.app/Contents/MacOS/NetNewsWire Lite -psn_0_184365
|
||||
Ss 502 572 56 818908 20988 0.0 loginwindow /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
|
||||
S 502 585 217 741824 19056 0.0 Spotlight /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight
|
||||
S 502 586 217 941900 11044 0.0 UserEventAgent /usr/sbin/UserEventAgent -l Aqua
|
||||
S 502 588 217 757320 18080 0.0 Dock /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_237626
|
||||
S 502 590 217 610072 2068 0.0 pboard /usr/sbin/pboard
|
||||
S 502 592 217 794140 25456 0.0 SystemUIServer /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer -psn_0_245820
|
||||
S 502 593 217 845552 30596 0.0 Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_249917
|
||||
S 502 594 217 671780 7872 0.0 ATSServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Support/ATSServer
|
||||
U 502 605 217 938844 64964 0.0 Pages /Applications/iWork '08/Pages.app/Contents/MacOS/Pages -psn_0_266305
|
||||
S 502 609 217 644432 10828 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_270402
|
||||
S 502 610 217 638552 5216 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_274499
|
||||
U 502 710 217 1029148 223312 0.0 Safari /Applications/Safari.app/Contents/MacOS/Safari -psn_0_331857
|
||||
S 502 712 217 904056 62928 0.3 Mail /Applications/Mail.app/Contents/MacOS/Mail -psn_0_335954
|
||||
U 501 998 102 1068272 26532 0.0 Address Book /Applications/Address Book.app/Contents/MacOS/Address Book -psn_0_417894
|
||||
S 502 2228 217 820940 30600 0.0 TextEdit /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_729266
|
||||
S 501 2431 102 1067868 43492 0.0 iCal /Applications/iCal.app/Contents/MacOS/iCal -psn_0_803012
|
||||
S 501 2531 102 1250108 68792 2.4 Skype /Applications/Skype.app/Contents/MacOS/Skype -psn_0_823497
|
||||
Ss 92 3143 1 602432 828 0.0 launchd /sbin/launchd
|
||||
S 501 3491 102 1048620 31256 0.0 TextEdit /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_962795
|
||||
S 501 3536 102 1073340 30524 0.0 Preview /Applications/Preview.app/Contents/MacOS/Preview -psn_0_983280
|
||||
S 501 4045 102 1041544 29168 0.0 PasswordWallet /Applications/PasswordWallet.app/Contents/MacOS/PasswordWallet -psn_0_1138966
|
||||
S 501 4892 114 1064948 43488 0.0 DashboardClient /System/Library/CoreServices/Dock.app/Contents/Resources/DashboardClient.app/Contents/MacOS/DashboardClient
|
||||
S 501 6806 102 1163836 67356 0.0 Colloquy /Applications/Colloquy.app/Contents/MacOS/Colloquy -psn_0_2220574
|
||||
U 501 6969 102 1156804 58764 0.0 Adium /Applications/Adium.app/Contents/MacOS/Adium -psn_0_2294320
|
||||
S 501 7530 102 671612 17440 0.0 helpdatad /System/Library/PrivateFrameworks/HelpData.framework/Versions/A/Resources/helpdatad
|
||||
Ss -2 38255 1 602432 952 0.0 launchd /sbin/launchd
|
||||
S 501 40569 102 1160664 49484 0.0 Dictionary /Applications/Dictionary.app/Contents/MacOS/Dictionary -psn_0_4387887
|
||||
SNs 501 42683 1 744096 21084 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.501
|
||||
S 501 62225 102 711004 18040 0.0 SyncServer /System/Library/Frameworks/SyncServices.framework/Versions/Current/Resources/SyncServer.app/Contents/MacOS/SyncServer
|
||||
SNs -2 62284 1 671812 10880 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.-2
|
||||
Ss 0 62285 1 617056 5472 0.0 cupsd /usr/sbin/cupsd -l
|
||||
S 502 62287 217 632360 10044 0.0 PubSubAgent /System/Library/Frameworks/PubSub.framework/Versions/A/Resources/PubSubAgent.app/Contents/MacOS/PubSubAgent
|
||||
SNs 502 62288 1 668876 10440 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.502
|
||||
S 501 62296 102 643688 11980 2.2 PubSubAgent /System/Library/Frameworks/PubSub.framework/Versions/A/Resources/PubSubAgent.app/Contents/MacOS/PubSubAgent
|
||||
Ss 0 4558 175 630816 6960 0.0 login login -pf tonvoon
|
||||
S 501 4559 4558 603600 1736 0.0 bash -bash
|
||||
R+ 0 62297 4559 602388 852 0.0 ps /bin/ps -axwo stat
|
||||
Ss 0 7301 175 630816 6960 0.0 login login -pf tonvoon
|
||||
S 501 7302 7301 603600 1584 0.0 bash -bash
|
||||
S+ 501 41381 7302 615408 4196 0.0 ssh ssh dev.net.altinity
|
84
plugins/tests/var/ps_axwo.debian
Normal file
84
plugins/tests/var/ps_axwo.debian
Normal file
|
@ -0,0 +1,84 @@
|
|||
STAT UID PID PPID VSZ RSS %CPU COMMAND COMMAND
|
||||
S 0 1 0 1504 428 0.0 init init [2]
|
||||
SN 0 2 1 0 0 0.0 ksoftirqd/0 [ksoftirqd/0]
|
||||
S< 0 3 1 0 0 0.0 events/0 [events/0]
|
||||
S< 0 4 3 0 0 0.0 khelper [khelper]
|
||||
S< 0 5 3 0 0 0.0 kacpid [kacpid]
|
||||
S< 0 38 3 0 0 0.0 kblockd/0 [kblockd/0]
|
||||
S 0 48 3 0 0 0.0 pdflush [pdflush]
|
||||
S< 0 51 3 0 0 0.0 aio/0 [aio/0]
|
||||
S 0 50 1 0 0 0.0 kswapd0 [kswapd0]
|
||||
S 0 193 1 0 0 0.0 kseriod [kseriod]
|
||||
S 0 214 1 0 0 0.0 scsi_eh_0 [scsi_eh_0]
|
||||
S 0 221 1 0 0 0.0 khubd [khubd]
|
||||
S 0 299 1 0 0 0.3 kjournald [kjournald]
|
||||
S 0 1148 1 0 0 0.0 pciehpd_event [pciehpd_event]
|
||||
S 0 1168 1 0 0 0.0 shpchpd_event [shpchpd_event]
|
||||
Ss 1 1795 1 1612 276 0.0 portmap /sbin/portmap
|
||||
Ss 0 2200 1 1652 568 0.0 vmware-guestd /usr/sbin/vmware-guestd --background /var/run/vmware-guestd.pid
|
||||
Ss 0 2209 1 2240 532 0.0 inetd /usr/sbin/inetd
|
||||
Ss 0 2319 1 3468 792 0.0 sshd /usr/sbin/sshd
|
||||
Ss 0 2323 1 2468 676 0.0 rpc.statd /sbin/rpc.statd
|
||||
Ss 1 2332 1 1684 488 0.0 atd /usr/sbin/atd
|
||||
Ss 0 2335 1 1764 636 0.0 cron /usr/sbin/cron
|
||||
Ss+ 0 2350 1 1500 348 0.0 getty /sbin/getty 38400 tty1
|
||||
Ss+ 0 2351 1 1500 348 0.0 getty /sbin/getty 38400 tty2
|
||||
Ss+ 0 2352 1 1500 348 0.0 getty /sbin/getty 38400 tty3
|
||||
Ss+ 0 2353 1 1500 348 0.0 getty /sbin/getty 38400 tty4
|
||||
Ss+ 0 2354 1 1500 348 0.0 getty /sbin/getty 38400 tty5
|
||||
Ss+ 0 2355 1 1500 348 0.0 getty /sbin/getty 38400 tty6
|
||||
S 0 6907 1 2308 892 0.0 mysqld_safe /bin/sh /usr/bin/mysqld_safe
|
||||
S 103 6944 6907 123220 27724 0.0 mysqld /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
|
||||
S 0 6945 6907 1488 420 0.0 logger logger -p daemon.err -t mysqld_safe -i -t mysqld
|
||||
S 1001 17778 1 6436 1588 0.0 snmpd /usr/sbin/snmpd -u nagios -Lsd -Lf /dev/null -p/var/run/snmpd.pid
|
||||
Ss 0 17789 1 9496 5556 0.0 snmptrapd /usr/sbin/snmptrapd -t -m ALL -M /usr/share/snmp/mibs:/usr/local/nagios/snmp/load -p /var/run/snmptrapd.pid
|
||||
Ss 0 847 2319 14452 1752 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 857 847 14616 1832 0.0 sshd sshd: tonvoon@pts/3
|
||||
Ss 1000 860 857 2984 1620 0.0 bash -bash
|
||||
S 0 868 860 2588 1428 0.0 bash -su
|
||||
S+ 1001 877 868 2652 1568 0.0 bash -su
|
||||
S 0 6086 3 0 0 0.0 pdflush [pdflush]
|
||||
Ss 0 17832 2319 14452 1752 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 18155 17832 14620 1840 0.0 sshd sshd: tonvoon@pts/0
|
||||
Ss 1000 18156 18155 2984 1620 0.0 bash -bash
|
||||
S 0 18518 18156 2588 1428 0.0 bash -su
|
||||
S 1001 18955 18518 2672 1600 0.0 bash -su
|
||||
Ss 0 21683 2319 14452 1756 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 21742 21683 14620 1896 0.0 sshd sshd: tonvoon@pts/1
|
||||
Ss 1000 21743 21742 2984 1620 0.0 bash -bash
|
||||
S 0 21748 21743 2592 1432 0.0 bash -su
|
||||
S 1001 21757 21748 2620 1540 0.0 bash -su
|
||||
Ss 0 2334 2319 14452 1756 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 2343 2334 14620 1840 0.0 sshd sshd: tonvoon@pts/2
|
||||
Ss 1000 2344 2343 2984 1620 0.0 bash -bash
|
||||
S 0 2349 2344 2592 1432 0.0 bash -su
|
||||
S+ 1001 2364 2349 2620 1520 0.0 bash -su
|
||||
T 1001 2454 2364 2096 1032 0.0 vi vi configure.in.rej
|
||||
S+ 1001 8500 21757 69604 52576 0.0 opsview_web_ser /usr/bin/perl -w ./script/opsview_web_server.pl -f -d
|
||||
Ss 0 7609 2319 14452 1756 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 7617 7609 14460 1828 0.0 sshd sshd: tonvoon@pts/4
|
||||
Ss 1000 7618 7617 2984 1620 0.0 bash -bash
|
||||
S 0 7623 7618 2592 1432 0.0 bash -su
|
||||
S+ 1001 7632 7623 2620 1528 0.0 bash -su
|
||||
Ss 1001 12678 1 20784 17728 0.0 opsviewd opsviewd
|
||||
Ss 0 832 1 14512 6360 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
S 33 842 832 14648 6596 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
S 33 843 832 14512 6504 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
S 33 844 832 14512 6476 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
S 33 845 832 14512 6476 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
S 33 846 832 14512 6476 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
Ss 7 4081 1 2464 884 0.0 lpd /usr/sbin/lpd -s
|
||||
S 33 26484 832 14512 6476 0.0 apache2 /usr/sbin/apache2 -k start -DSSL
|
||||
Ss 1001 22324 1 20252 1612 0.1 nagios ../../bin/nagios -d /usr/local/nagios/etc/nagios.cfg
|
||||
Ss 0 23336 2319 14452 1756 0.0 sshd sshd: tonvoon [priv]
|
||||
S 1000 23339 23336 14620 1840 0.0 sshd sshd: tonvoon@pts/5
|
||||
Ss 1000 23340 23339 2996 1636 0.0 bash -bash
|
||||
S 0 23367 23340 3020 1628 0.0 bash bash
|
||||
S 1001 23370 23367 3064 1748 0.0 bash bash
|
||||
Ss 1001 23783 1 3220 764 0.0 ndo2db /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
|
||||
Ss 1001 23784 1 6428 4948 0.0 import_ndologsd import_ndologsd
|
||||
S+ 1001 9803 18955 4132 1936 0.0 ssh ssh altinity@cube02.lei.altinity
|
||||
S 1001 22505 22324 20256 1616 0.0 nagios ../../bin/nagios -d /usr/local/nagios/etc/nagios.cfg
|
||||
S 1001 22506 22505 1676 608 0.0 check_ping /usr/local/nagios/libexec/check_ping -H 192.168.10.23 -w 3000.0,80% -c 5000.0,100% -p 1
|
||||
S 1001 22507 22506 1660 492 0.0 ping /bin/ping -n -U -w 10 -c 1 192.168.10.23
|
||||
R+ 1001 22508 23370 2308 680 0.0 ps ps axwo stat uid pid ppid vsz rss pcpu comm args
|
1
plugins/tests/var/root
Normal file
1
plugins/tests/var/root
Normal file
|
@ -0,0 +1 @@
|
|||
Root
|
|
@ -174,7 +174,7 @@ print_help (void)
|
|||
|
||||
print_usage ();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (UT_HELP_VRSN);
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Examples:"));
|
||||
|
@ -186,7 +186,7 @@ print_help (void)
|
|||
printf (" %s\n\n", _("You probably want:"));
|
||||
printf (" %s\n", _("urlize http://example.com/ \"check_http -H example.com -r 'two words'\""));
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
printf (UT_SUPPORT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -194,6 +194,6 @@ print_help (void)
|
|||
void
|
||||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf ("%s\n", _("Usage:"));
|
||||
printf ("%s <url> <plugin> <arg1> ... <argN>\n", progname);
|
||||
}
|
||||
|
|
|
@ -137,73 +137,71 @@ char *fperfdata (const char *,
|
|||
#define COPYRIGHT "Copyright (c) %s Nagios Plugin Development Team\n\
|
||||
\t<%s>\n\n"
|
||||
|
||||
#define UT_HLP_VRS "\
|
||||
#define UT_HLP_VRS _("\
|
||||
%s (-h | --help) for detailed help\n\
|
||||
%s (-V | --version) for version information\n"
|
||||
%s (-V | --version) for version information\n")
|
||||
|
||||
#define UT_HELP_VRSN "\
|
||||
#define UT_HELP_VRSN _("\
|
||||
\nOptions:\n\
|
||||
-h, --help\n\
|
||||
Print detailed help screen\n\
|
||||
-V, --version\n\
|
||||
Print version information\n"
|
||||
Print version information\n")
|
||||
|
||||
#define UT_HOST_PORT "\
|
||||
#define UT_HOST_PORT _("\
|
||||
-H, --hostname=ADDRESS\n\
|
||||
Host name, IP Address, or unix socket (must be an absolute path)\n\
|
||||
-%c, --port=INTEGER\n\
|
||||
Port number (default: %s)\n"
|
||||
Port number (default: %s)\n")
|
||||
|
||||
#define UT_IPv46 "\
|
||||
#define UT_IPv46 _("\
|
||||
-4, --use-ipv4\n\
|
||||
Use IPv4 connection\n\
|
||||
-6, --use-ipv6\n\
|
||||
Use IPv6 connection\n"
|
||||
Use IPv6 connection\n")
|
||||
|
||||
#define UT_VERBOSE "\
|
||||
#define UT_VERBOSE _("\
|
||||
-v, --verbose\n\
|
||||
Show details for command-line debugging (Nagios may truncate output)\n"
|
||||
Show details for command-line debugging (Nagios may truncate output)\n")
|
||||
|
||||
#define UT_WARN_CRIT "\
|
||||
#define UT_WARN_CRIT _("\
|
||||
-w, --warning=DOUBLE\n\
|
||||
Response time to result in warning status (seconds)\n\
|
||||
-c, --critical=DOUBLE\n\
|
||||
Response time to result in critical status (seconds)\n"
|
||||
Response time to result in critical status (seconds)\n")
|
||||
|
||||
#define UT_WARN_CRIT_RANGE "\
|
||||
#define UT_WARN_CRIT_RANGE _("\
|
||||
-w, --warning=RANGE\n\
|
||||
Warning range (format: start:end). Alert if outside this range\n\
|
||||
-c, --critical=RANGE\n\
|
||||
Critical range\n"
|
||||
Critical range\n")
|
||||
|
||||
#define UT_TIMEOUT "\
|
||||
#define UT_TIMEOUT _("\
|
||||
-t, --timeout=INTEGER\n\
|
||||
Seconds before connection times out (default: %d)\n"
|
||||
Seconds before connection times out (default: %d)\n")
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
#define UT_EXTRA_OPTS "\
|
||||
#define UT_EXTRA_OPTS _("\
|
||||
--extra-opts=[section][@file]\n\
|
||||
Read additionnal options from ini file\n"
|
||||
#define UT_EXTRA_OPTS_NOTES "\
|
||||
See: http://nagiosplugins.org/extra-opts for --extra-opts usage and examples.\n"
|
||||
Read options from an ini file. See http://nagiosplugins.org/extra-opts\n\
|
||||
for usage and examples.\n")
|
||||
#else
|
||||
#define UT_EXTRA_OPTS ""
|
||||
#define UT_EXTRA_OPTS_NOTES ""
|
||||
#endif
|
||||
|
||||
#define UT_THRESHOLDS_NOTES "\
|
||||
#define UT_THRESHOLDS_NOTES _("\
|
||||
See:\n\
|
||||
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT\n\
|
||||
for THRESHOLD format and examples.\n"
|
||||
for THRESHOLD format and examples.\n")
|
||||
|
||||
#define UT_SUPPORT "\n\
|
||||
#define UT_SUPPORT _("\n\
|
||||
Send email to nagios-users@lists.sourceforge.net if you have questions\n\
|
||||
regarding use of this software. To submit patches or suggest improvements,\n\
|
||||
send email to nagiosplug-devel@lists.sourceforge.net\n\n"
|
||||
send email to nagiosplug-devel@lists.sourceforge.net\n\n")
|
||||
|
||||
#define UT_NOWARRANTY "\n\
|
||||
#define UT_NOWARRANTY _("\n\
|
||||
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n\
|
||||
copies of the plugins under the terms of the GNU General Public License.\n\
|
||||
For more information about these matters, see the file named COPYING.\n"
|
||||
For more information about these matters, see the file named COPYING.\n")
|
||||
|
||||
#endif /* NP_UTILS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue