diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
commit | 7373ce3d6988706388f136e1c06afd20a3e8d5be (patch) | |
tree | e9ae5af7d102667e5706187646db45de8238e8c4 /plugins-scripts | |
parent | Initial commit. (diff) | |
download | monitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.tar.xz monitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.zip |
Adding upstream version 2.3.5.upstream/2.3.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins-scripts')
27 files changed, 7543 insertions, 0 deletions
diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am new file mode 100644 index 0000000..7879791 --- /dev/null +++ b/plugins-scripts/Makefile.am @@ -0,0 +1,60 @@ +## Process this file with automake to produce Makefile.in + +if RELEASE_PRESENT +NP_VERSION = @NP_RELEASE@ +else +NP-VERSION-FILE: .FORCE-NP-VERSION-FILE + @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN +.FORCE-NP-VERSION-FILE: +-include NP-VERSION-FILE +endif + +SUFFIXES = .pl .sh + +VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t + +libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \ + check_log check_oracle check_rpc check_sensors check_wave \ + check_ifstatus check_ifoperstatus check_mailq check_file_age \ + check_uptime check_mssql \ + utils.sh utils.pm + +EXTRA_DIST=check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \ + check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \ + check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \ + check_uptime.pl check_mssql.pl \ + utils.sh.in utils.pm.in t + +EDIT = sed \ + -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \ + -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \ + -e 's|[@]PERL[@]|$(PERL)|g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' + +TESTS_ENVIRONMENT=perl -I $(top_builddir) -I $(top_srcdir) + +TESTS = @SCRIPT_TEST@ + +test: + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test + for SCRIPT in *.pl; do perl -wc $$SCRIPT || exit 1; done + set -e; for SCRIPT in *.sh; do sh -n $$SCRIPT || exit 1; done + +test-debug: + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test + +CLEANFILES=$(libexec_SCRIPTS) + +.pl : + $(EDIT) $< > $@ + chmod +x $@ + +.sh : + $(EDIT) $< > $@ + chmod +x $@ + +clean-local: + rm -f NP-VERSION-FILE + diff --git a/plugins-scripts/Makefile.in b/plugins-scripts/Makefile.in new file mode 100644 index 0000000..f22ee03 --- /dev/null +++ b/plugins-scripts/Makefile.in @@ -0,0 +1,2331 @@ +# Makefile.in generated by automake 1.16.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins-scripts +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \ + $(top_srcdir)/m4/np_mysqlclient.m4 \ + $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \ + $(top_srcdir)/gl/m4/__inline.m4 \ + $(top_srcdir)/gl/m4/absolute-header.m4 \ + $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ + $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \ + $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/builtin-expect.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \ + $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/double-slash-root.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/exponentd.m4 \ + $(top_srcdir)/gl/m4/extensions.m4 \ + $(top_srcdir)/gl/m4/extern-inline.m4 \ + $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \ + $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \ + $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \ + $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \ + $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \ + $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \ + $(top_srcdir)/gl/m4/ftello.m4 \ + $(top_srcdir)/gl/m4/getaddrinfo.m4 \ + $(top_srcdir)/gl/m4/getdelim.m4 \ + $(top_srcdir)/gl/m4/getdtablesize.m4 \ + $(top_srcdir)/gl/m4/gethostname.m4 \ + $(top_srcdir)/gl/m4/getline.m4 \ + $(top_srcdir)/gl/m4/getloadavg.m4 \ + $(top_srcdir)/gl/m4/getopt.m4 \ + $(top_srcdir)/gl/m4/getprogname.m4 \ + $(top_srcdir)/gl/m4/gl-openssl.m4 \ + $(top_srcdir)/gl/m4/gnulib-common.m4 \ + $(top_srcdir)/gl/m4/gnulib-comp.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \ + $(top_srcdir)/gl/m4/include_next.m4 \ + $(top_srcdir)/gl/m4/inet_ntop.m4 \ + $(top_srcdir)/gl/m4/intmax_t.m4 \ + $(top_srcdir)/gl/m4/inttypes.m4 \ + $(top_srcdir)/gl/m4/inttypes_h.m4 \ + $(top_srcdir)/gl/m4/langinfo_h.m4 \ + $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.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/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \ + $(top_srcdir)/gl/m4/lseek.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/mbtowc.m4 \ + $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.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/msvc-inval.m4 \ + $(top_srcdir)/gl/m4/msvc-nothrow.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/nl_langinfo.m4 \ + $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \ + $(top_srcdir)/gl/m4/open-cloexec.m4 \ + $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \ + $(top_srcdir)/gl/m4/printf.m4 \ + $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \ + $(top_srcdir)/gl/m4/realloc.m4 \ + $(top_srcdir)/gl/m4/reallocarray.m4 \ + $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \ + $(top_srcdir)/gl/m4/setenv.m4 \ + $(top_srcdir)/gl/m4/setlocale_null.m4 \ + $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/snprintf.m4 \ + $(top_srcdir)/gl/m4/socketlib.m4 \ + $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \ + $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ + $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \ + $(top_srcdir)/gl/m4/std-gnu11.m4 \ + $(top_srcdir)/gl/m4/stdalign.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strcasestr.m4 \ + $(top_srcdir)/gl/m4/strerror.m4 \ + $(top_srcdir)/gl/m4/string_h.m4 \ + $(top_srcdir)/gl/m4/strings_h.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/sys_types_h.m4 \ + $(top_srcdir)/gl/m4/sys_uio_h.m4 \ + $(top_srcdir)/gl/m4/threadlib.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/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \ + $(top_srcdir)/gl/m4/unlocked-io.m4 \ + $(top_srcdir)/gl/m4/vararrays.m4 \ + $(top_srcdir)/gl/m4/vasnprintf.m4 \ + $(top_srcdir)/gl/m4/vasprintf.m4 \ + $(top_srcdir)/gl/m4/visibility.m4 \ + $(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/xalloc.m4 \ + $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = utils.pm utils.sh +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libexecdir)" +SCRIPTS = $(libexec_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/utils.pm.in \ + $(srcdir)/utils.sh.in $(top_srcdir)/build-aux/mkinstalldirs \ + $(top_srcdir)/build-aux/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +VPATH = $(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +ASSERT_H = @ASSERT_H@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASENAME = @BASENAME@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBILIBS = @DBILIBS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPLIBS = @DEPLIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +EXEEXT = @EXEEXT@ +EXTRAS = @EXTRAS@ +EXTRAS_ROOT = @EXTRAS_ROOT@ +EXTRA_NETOBJS = @EXTRA_NETOBJS@ +EXTRA_TEST = @EXTRA_TEST@ +FGREP = @FGREP@ +FLOAT_H = @FLOAT_H@ +FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ +GETHOSTNAME_LIB = @GETHOSTNAME_LIB@ +GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ +GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ +GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@ +GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@ +GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@ +GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@ +GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@ +GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@ +GL_GNULIB_ASINF = @GL_GNULIB_ASINF@ +GL_GNULIB_ASINL = @GL_GNULIB_ASINL@ +GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@ +GL_GNULIB_ATANF = @GL_GNULIB_ATANF@ +GL_GNULIB_ATANL = @GL_GNULIB_ATANL@ +GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@ +GL_GNULIB_BIND = @GL_GNULIB_BIND@ +GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@ +GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ +GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ +GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_GNULIB_CBRT = @GL_GNULIB_CBRT@ +GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@ +GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@ +GL_GNULIB_CEIL = @GL_GNULIB_CEIL@ +GL_GNULIB_CEILF = @GL_GNULIB_CEILF@ +GL_GNULIB_CEILL = @GL_GNULIB_CEILL@ +GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@ +GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@ +GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@ +GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@ +GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@ +GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@ +GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@ +GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@ +GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@ +GL_GNULIB_COSF = @GL_GNULIB_COSF@ +GL_GNULIB_COSHF = @GL_GNULIB_COSHF@ +GL_GNULIB_COSL = @GL_GNULIB_COSL@ +GL_GNULIB_CREAT = @GL_GNULIB_CREAT@ +GL_GNULIB_CTIME = @GL_GNULIB_CTIME@ +GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@ +GL_GNULIB_DUP = @GL_GNULIB_DUP@ +GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@ +GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@ +GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@ +GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@ +GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@ +GL_GNULIB_EXECL = @GL_GNULIB_EXECL@ +GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@ +GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@ +GL_GNULIB_EXECV = @GL_GNULIB_EXECV@ +GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@ +GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@ +GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@ +GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@ +GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@ +GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@ +GL_GNULIB_EXPF = @GL_GNULIB_EXPF@ +GL_GNULIB_EXPL = @GL_GNULIB_EXPL@ +GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@ +GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@ +GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@ +GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@ +GL_GNULIB_FABSF = @GL_GNULIB_FABSF@ +GL_GNULIB_FABSL = @GL_GNULIB_FABSL@ +GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@ +GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@ +GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@ +GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@ +GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@ +GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@ +GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@ +GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@ +GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@ +GL_GNULIB_FFS = @GL_GNULIB_FFS@ +GL_GNULIB_FFSL = @GL_GNULIB_FFSL@ +GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@ +GL_GNULIB_FGETC = @GL_GNULIB_FGETC@ +GL_GNULIB_FGETS = @GL_GNULIB_FGETS@ +GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@ +GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@ +GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@ +GL_GNULIB_FMA = @GL_GNULIB_FMA@ +GL_GNULIB_FMAF = @GL_GNULIB_FMAF@ +GL_GNULIB_FMAL = @GL_GNULIB_FMAL@ +GL_GNULIB_FMOD = @GL_GNULIB_FMOD@ +GL_GNULIB_FMODF = @GL_GNULIB_FMODF@ +GL_GNULIB_FMODL = @GL_GNULIB_FMODL@ +GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@ +GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@ +GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@ +GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@ +GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@ +GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@ +GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@ +GL_GNULIB_FREAD = @GL_GNULIB_FREAD@ +GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@ +GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@ +GL_GNULIB_FREXP = @GL_GNULIB_FREXP@ +GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@ +GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@ +GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@ +GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@ +GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@ +GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@ +GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@ +GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@ +GL_GNULIB_FTELL = @GL_GNULIB_FTELL@ +GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@ +GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@ +GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@ +GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@ +GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@ +GL_GNULIB_GETC = @GL_GNULIB_GETC@ +GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@ +GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@ +GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@ +GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@ +GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@ +GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@ +GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@ +GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@ +GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@ +GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@ +GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@ +GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@ +GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@ +GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@ +GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@ +GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@ +GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@ +GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@ +GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@ +GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@ +GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@ +GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@ +GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@ +GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@ +GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@ +GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@ +GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@ +GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@ +GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@ +GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@ +GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@ +GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@ +GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@ +GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@ +GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@ +GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@ +GL_GNULIB_ISINF = @GL_GNULIB_ISINF@ +GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@ +GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@ +GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@ +GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@ +GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@ +GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@ +GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@ +GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@ +GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@ +GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@ +GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@ +GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@ +GL_GNULIB_LINK = @GL_GNULIB_LINK@ +GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@ +GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@ +GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@ +GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@ +GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@ +GL_GNULIB_LOG = @GL_GNULIB_LOG@ +GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@ +GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@ +GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@ +GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@ +GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@ +GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@ +GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@ +GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@ +GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@ +GL_GNULIB_LOGB = @GL_GNULIB_LOGB@ +GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@ +GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@ +GL_GNULIB_LOGF = @GL_GNULIB_LOGF@ +GL_GNULIB_LOGL = @GL_GNULIB_LOGL@ +GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@ +GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@ +GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@ +GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@ +GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@ +GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@ +GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@ +GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@ +GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@ +GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@ +GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@ +GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@ +GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@ +GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@ +GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@ +GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@ +GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@ +GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@ +GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@ +GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@ +GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@ +GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@ +GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@ +GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@ +GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@ +GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@ +GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@ +GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@ +GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@ +GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@ +GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@ +GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@ +GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@ +GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@ +GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@ +GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@ +GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@ +GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@ +GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@ +GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@ +GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@ +GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@ +GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@ +GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@ +GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@ +GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@ +GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@ +GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@ +GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@ +GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@ +GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@ +GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@ +GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@ +GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@ +GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@ +GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@ +GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@ +GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@ +GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@ +GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@ +GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@ +GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@ +GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@ +GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@ +GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@ +GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@ +GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@ +GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@ +GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@ +GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@ +GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@ +GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@ +GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@ +GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@ +GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@ +GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@ +GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@ +GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@ +GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@ +GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@ +GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@ +GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@ +GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@ +GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@ +GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@ +GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@ +GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@ +GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@ +GL_GNULIB_MODF = @GL_GNULIB_MODF@ +GL_GNULIB_MODFF = @GL_GNULIB_MODFF@ +GL_GNULIB_MODFL = @GL_GNULIB_MODFL@ +GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@ +GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@ +GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@ +GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@ +GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@ +GL_GNULIB_OPEN = @GL_GNULIB_OPEN@ +GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@ +GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@ +GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@ +GL_GNULIB_PERROR = @GL_GNULIB_PERROR@ +GL_GNULIB_PIPE = @GL_GNULIB_PIPE@ +GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@ +GL_GNULIB_POPEN = @GL_GNULIB_POPEN@ +GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@ +GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@ +GL_GNULIB_POWF = @GL_GNULIB_POWF@ +GL_GNULIB_PREAD = @GL_GNULIB_PREAD@ +GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@ +GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@ +GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@ +GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@ +GL_GNULIB_PUTC = @GL_GNULIB_PUTC@ +GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@ +GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@ +GL_GNULIB_PUTS = @GL_GNULIB_PUTS@ +GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@ +GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@ +GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@ +GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@ +GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@ +GL_GNULIB_READ = @GL_GNULIB_READ@ +GL_GNULIB_READLINK = @GL_GNULIB_READLINK@ +GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@ +GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@ +GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@ +GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@ +GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@ +GL_GNULIB_RECV = @GL_GNULIB_RECV@ +GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@ +GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@ +GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@ +GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@ +GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@ +GL_GNULIB_RENAME = @GL_GNULIB_RENAME@ +GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@ +GL_GNULIB_RINT = @GL_GNULIB_RINT@ +GL_GNULIB_RINTF = @GL_GNULIB_RINTF@ +GL_GNULIB_RINTL = @GL_GNULIB_RINTL@ +GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@ +GL_GNULIB_ROUND = @GL_GNULIB_ROUND@ +GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@ +GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@ +GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@ +GL_GNULIB_SCANF = @GL_GNULIB_SCANF@ +GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@ +GL_GNULIB_SEND = @GL_GNULIB_SEND@ +GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@ +GL_GNULIB_SETENV = @GL_GNULIB_SETENV@ +GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@ +GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@ +GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@ +GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@ +GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@ +GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@ +GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@ +GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@ +GL_GNULIB_SINF = @GL_GNULIB_SINF@ +GL_GNULIB_SINHF = @GL_GNULIB_SINHF@ +GL_GNULIB_SINL = @GL_GNULIB_SINL@ +GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@ +GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@ +GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@ +GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@ +GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@ +GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@ +GL_GNULIB_STAT = @GL_GNULIB_STAT@ +GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@ +GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@ +GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@ +GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@ +GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@ +GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@ +GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@ +GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@ +GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@ +GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@ +GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@ +GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@ +GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@ +GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@ +GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@ +GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@ +GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ +GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ +GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ +GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@ +GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ +GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ +GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@ +GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@ +GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@ +GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@ +GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@ +GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@ +GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ +GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ +GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ +GL_GNULIB_TANF = @GL_GNULIB_TANF@ +GL_GNULIB_TANHF = @GL_GNULIB_TANHF@ +GL_GNULIB_TANL = @GL_GNULIB_TANL@ +GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@ +GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@ +GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@ +GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@ +GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@ +GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@ +GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@ +GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@ +GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@ +GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@ +GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@ +GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@ +GL_GNULIB_TZSET = @GL_GNULIB_TZSET@ +GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@ +GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@ +GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@ +GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@ +GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@ +GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@ +GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@ +GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@ +GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@ +GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@ +GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@ +GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@ +GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@ +GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@ +GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@ +GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@ +GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@ +GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@ +GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@ +GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@ +GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@ +GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@ +GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@ +GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@ +GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@ +GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@ +GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@ +GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@ +GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@ +GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@ +GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@ +GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@ +GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@ +GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@ +GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@ +GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@ +GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@ +GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@ +GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@ +GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@ +GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@ +GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@ +GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@ +GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@ +GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@ +GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@ +GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ +GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@ +GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@ +GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@ +GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@ +GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@ +GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@ +GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@ +GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@ +GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@ +GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ +GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GREP = @GREP@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ACOSF = @HAVE_ACOSF@ +HAVE_ACOSL = @HAVE_ACOSL@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ASINF = @HAVE_ASINF@ +HAVE_ASINL = @HAVE_ASINL@ +HAVE_ATAN2F = @HAVE_ATAN2F@ +HAVE_ATANF = @HAVE_ATANF@ +HAVE_ATANL = @HAVE_ATANL@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CBRT = @HAVE_CBRT@ +HAVE_CBRTF = @HAVE_CBRTF@ +HAVE_CBRTL = @HAVE_CBRTL@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_COPYSIGN = @HAVE_COPYSIGN@ +HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ +HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ +HAVE_COSF = @HAVE_COSF@ +HAVE_COSHF = @HAVE_COSHF@ +HAVE_COSL = @HAVE_COSL@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ +HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ +HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ +HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ +HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ +HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ +HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ +HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +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_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +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_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ +HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ +HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ +HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ +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_REMAINDER = @HAVE_DECL_REMAINDER@ +HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ +HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ +HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ +HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ +HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@ +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_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ +HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ +HAVE_EXPF = @HAVE_EXPF@ +HAVE_EXPL = @HAVE_EXPL@ +HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ +HAVE_EXPM1 = @HAVE_EXPM1@ +HAVE_EXPM1F = @HAVE_EXPM1F@ +HAVE_FABSF = @HAVE_FABSF@ +HAVE_FABSL = @HAVE_FABSL@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FMA = @HAVE_FMA@ +HAVE_FMAF = @HAVE_FMAF@ +HAVE_FMAL = @HAVE_FMAL@ +HAVE_FMODF = @HAVE_FMODF@ +HAVE_FMODL = @HAVE_FMODL@ +HAVE_FREELOCALE = @HAVE_FREELOCALE@ +HAVE_FREXPF = @HAVE_FREXPF@ +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_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETENTROPY = @HAVE_GETENTROPY@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUMASK = @HAVE_GETUMASK@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_HYPOTF = @HAVE_HYPOTF@ +HAVE_HYPOTL = @HAVE_HYPOTL@ +HAVE_ILOGB = @HAVE_ILOGB@ +HAVE_ILOGBF = @HAVE_ILOGBF@ +HAVE_ILOGBL = @HAVE_ILOGBL@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ +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_ALTMON = @HAVE_LANGINFO_ALTMON@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LDEXPF = @HAVE_LDEXPF@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LOG10F = @HAVE_LOG10F@ +HAVE_LOG10L = @HAVE_LOG10L@ +HAVE_LOG1P = @HAVE_LOG1P@ +HAVE_LOG1PF = @HAVE_LOG1PF@ +HAVE_LOG1PL = @HAVE_LOG1PL@ +HAVE_LOGBF = @HAVE_LOGBF@ +HAVE_LOGBL = @HAVE_LOGBL@ +HAVE_LOGF = @HAVE_LOGF@ +HAVE_LOGL = @HAVE_LOGL@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +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_MBTOWC = @HAVE_MBTOWC@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@ +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_MODFF = @HAVE_MODFF@ +HAVE_MODFL = @HAVE_MODFL@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POWF = @HAVE_POWF@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +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_REALLOCARRAY = @HAVE_REALLOCARRAY@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_REMAINDER = @HAVE_REMAINDER@ +HAVE_REMAINDERF = @HAVE_REMAINDERF@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RINT = @HAVE_RINT@ +HAVE_RINTL = @HAVE_RINTL@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ +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_SINF = @HAVE_SINF@ +HAVE_SINHF = @HAVE_SINHF@ +HAVE_SINL = @HAVE_SINL@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SQRTF = @HAVE_SQRTF@ +HAVE_SQRTL = @HAVE_SQRTL@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOL = @HAVE_STRTOL@ +HAVE_STRTOLD = @HAVE_STRTOLD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOUL = @HAVE_STRTOUL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_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_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TANF = @HAVE_TANF@ +HAVE_TANHF = @HAVE_TANHF@ +HAVE_TANL = @HAVE_TANL@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ +HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__EXIT = @HAVE__EXIT@ +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@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRBINCLUDE = @KRBINCLUDE@ +LD = @LD@ +LDAPINCLUDE = @LDAPINCLUDE@ +LDAPLIBS = @LDAPLIBS@ +LDFLAGS = @LDFLAGS@ +LIBCURL = @LIBCURL@ +LIBCURLCFLAGS = @LIBCURLCFLAGS@ +LIBCURLINCLUDE = @LIBCURLINCLUDE@ +LIBCURLLIBS = @LIBCURLLIBS@ +LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ +LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ +LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPMULTITHREAD = @LIBPMULTITHREAD@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBSTDTHREAD = @LIBSTDTHREAD@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIB_CRYPTO = @LIB_CRYPTO@ +LIB_HARD_LOCALE = @LIB_HARD_LOCALE@ +LIB_MBRTOWC = @LIB_MBRTOWC@ +LIB_NL_LANGINFO = @LIB_NL_LANGINFO@ +LIB_SCHED_YIELD = @LIB_SCHED_YIELD@ +LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@ +LIMITS_H = @LIMITS_H@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MATHLIBS = @MATHLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MYSQLCFLAGS = @MYSQLCFLAGS@ +MYSQLINCLUDE = @MYSQLINCLUDE@ +MYSQLLIBS = @MYSQLLIBS@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ASSERT_H = @NEXT_ASSERT_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_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_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_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_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_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_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_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_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_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@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TO_APTGET = @PATH_TO_APTGET@ +PATH_TO_DIG = @PATH_TO_DIG@ +PATH_TO_ENV = @PATH_TO_ENV@ +PATH_TO_FPING = @PATH_TO_FPING@ +PATH_TO_FPING6 = @PATH_TO_FPING6@ +PATH_TO_LMSTAT = @PATH_TO_LMSTAT@ +PATH_TO_LSPS = @PATH_TO_LSPS@ +PATH_TO_MAILQ = @PATH_TO_MAILQ@ +PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@ +PATH_TO_PING = @PATH_TO_PING@ +PATH_TO_PING6 = @PATH_TO_PING6@ +PATH_TO_PS = @PATH_TO_PS@ +PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@ +PATH_TO_QSTAT = @PATH_TO_QSTAT@ +PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@ +PATH_TO_RPCINFO = @PATH_TO_RPCINFO@ +PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@ +PATH_TO_SNMPGET = @PATH_TO_SNMPGET@ +PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@ +PATH_TO_SSH = @PATH_TO_SSH@ +PATH_TO_SUDO = @PATH_TO_SUDO@ +PATH_TO_SWAP = @PATH_TO_SWAP@ +PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@ +PATH_TO_UPTIME = @PATH_TO_UPTIME@ +PATH_TO_WHO = @PATH_TO_WHO@ +PERL = @PERL@ +PERLMODS_DIR = @PERLMODS_DIR@ +PGINCLUDE = @PGINCLUDE@ +PGLIBS = @PGLIBS@ +PKGCONFIG = @PKGCONFIG@ +PKG_ARCH = @PKG_ARCH@ +PLUGIN_TEST = @PLUGIN_TEST@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PST3CFLAGS = @PST3CFLAGS@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RADIUSLIBS = @RADIUSLIBS@ +RANLIB = @RANLIB@ +RELEASE = @RELEASE@ +REPLACE_ACCESS = @REPLACE_ACCESS@ +REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ +REPLACE_ASINF = @REPLACE_ASINF@ +REPLACE_ATAN2F = @REPLACE_ATAN2F@ +REPLACE_ATANF = @REPLACE_ATANF@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ +REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CBRTF = @REPLACE_CBRTF@ +REPLACE_CBRTL = @REPLACE_CBRTL@ +REPLACE_CEIL = @REPLACE_CEIL@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ +REPLACE_CHMOD = @REPLACE_CHMOD@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@ +REPLACE_COSF = @REPLACE_COSF@ +REPLACE_COSHF = @REPLACE_COSHF@ +REPLACE_CREAT = @REPLACE_CREAT@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ +REPLACE_EXP2 = @REPLACE_EXP2@ +REPLACE_EXP2L = @REPLACE_EXP2L@ +REPLACE_EXPF = @REPLACE_EXPF@ +REPLACE_EXPL = @REPLACE_EXPL@ +REPLACE_EXPM1 = @REPLACE_EXPM1@ +REPLACE_EXPM1F = @REPLACE_EXPM1F@ +REPLACE_EXPM1L = @REPLACE_EXPM1L@ +REPLACE_FABSL = @REPLACE_FABSL@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ +REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ +REPLACE_FLOOR = @REPLACE_FLOOR@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FMA = @REPLACE_FMA@ +REPLACE_FMAF = @REPLACE_FMAF@ +REPLACE_FMAL = @REPLACE_FMAL@ +REPLACE_FMOD = @REPLACE_FMOD@ +REPLACE_FMODF = @REPLACE_FMODF@ +REPLACE_FMODL = @REPLACE_FMODL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ +REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPF = @REPLACE_FREXPF@ +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_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ +REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ +REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_HYPOT = @REPLACE_HYPOT@ +REPLACE_HYPOTF = @REPLACE_HYPOTF@ +REPLACE_HYPOTL = @REPLACE_HYPOTL@ +REPLACE_ILOGB = @REPLACE_ILOGB@ +REPLACE_ILOGBF = @REPLACE_ILOGBF@ +REPLACE_ILOGBL = @REPLACE_ILOGBL@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@ +REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LOG = @REPLACE_LOG@ +REPLACE_LOG10 = @REPLACE_LOG10@ +REPLACE_LOG10F = @REPLACE_LOG10F@ +REPLACE_LOG10L = @REPLACE_LOG10L@ +REPLACE_LOG1P = @REPLACE_LOG1P@ +REPLACE_LOG1PF = @REPLACE_LOG1PF@ +REPLACE_LOG1PL = @REPLACE_LOG1PL@ +REPLACE_LOG2 = @REPLACE_LOG2@ +REPLACE_LOG2F = @REPLACE_LOG2F@ +REPLACE_LOG2L = @REPLACE_LOG2L@ +REPLACE_LOGB = @REPLACE_LOGB@ +REPLACE_LOGBF = @REPLACE_LOGBF@ +REPLACE_LOGBL = @REPLACE_LOGBL@ +REPLACE_LOGF = @REPLACE_LOGF@ +REPLACE_LOGL = @REPLACE_LOGL@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ +REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@ +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_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_MODF = @REPLACE_MODF@ +REPLACE_MODFF = @REPLACE_MODFF@ +REPLACE_MODFL = @REPLACE_MODFL@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ +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_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RANDOM = @REPLACE_RANDOM@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@ +REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@ +REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMAINDER = @REPLACE_REMAINDER@ +REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ +REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RINTL = @REPLACE_RINTL@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@ +REPLACE_SINF = @REPLACE_SINF@ +REPLACE_SINHF = @REPLACE_SINHF@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_SQRTF = @REPLACE_SQRTF@ +REPLACE_SQRTL = @REPLACE_SQRTL@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +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_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOL = @REPLACE_STRTOL@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ +REPLACE_STRTOLL = @REPLACE_STRTOLL@ +REPLACE_STRTOUL = @REPLACE_STRTOUL@ +REPLACE_STRTOULL = @REPLACE_STRTOULL@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TANF = @REPLACE_TANF@ +REPLACE_TANHF = @REPLACE_TANHF@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNC = @REPLACE_TRUNC@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TRUNCF = @REPLACE_TRUNCF@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +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@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSTOK = @REPLACE_WCSTOK@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +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@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SOCKETLIBS = @SOCKETLIBS@ +SSLINCLUDE = @SSLINCLUDE@ +SSLLIBS = @SSLLIBS@ +STDALIGN_H = @STDALIGN_H@ +STDCKDINT_H = @STDCKDINT_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SUPPORT = @SUPPORT@ +SYSTEMDINCLUDE = @SYSTEMDINCLUDE@ +SYSTEMDLIBS = @SYSTEMDLIBS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@ +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@ +URIPARSER = @URIPARSER@ +URIPARSERCFLAGS = @URIPARSERCFLAGS@ +URIPARSERINCLUDE = @URIPARSERINCLUDE@ +URIPARSERLIBS = @URIPARSERLIBS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARRANTY = @WARRANTY@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +WTSAPI32LIBS = @WTSAPI32LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +_libcurl_config = @_libcurl_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +check_tcp_ssl = @check_tcp_ssl@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +np_mysql_config = @np_mysql_config@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_trusted_path = @with_trusted_path@ +@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@ +SUFFIXES = .pl .sh +libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \ + check_log check_oracle check_rpc check_sensors check_wave \ + check_ifstatus check_ifoperstatus check_mailq check_file_age \ + check_uptime check_mssql \ + utils.sh utils.pm + +EXTRA_DIST = check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \ + check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \ + check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \ + check_uptime.pl check_mssql.pl \ + utils.sh.in utils.pm.in t + +EDIT = sed \ + -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \ + -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \ + -e 's|[@]PERL[@]|$(PERL)|g' \ + -e 's|[@]libexecdir[@]|$(libexecdir)|g' + +TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) +TESTS = @SCRIPT_TEST@ +CLEANFILES = $(libexec_SCRIPTS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .pl .sh .log .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins-scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins-scripts/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +utils.pm: $(top_builddir)/config.status $(srcdir)/utils.pm.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +utils.sh: $(top_builddir)/config.status $(srcdir)/utils.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libexecSCRIPTS: $(libexec_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(libexecdir)'; $(am__uninstall_files_from_dir) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libexecSCRIPTS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libexecSCRIPTS + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + clean-libtool clean-local cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libexecSCRIPTS install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \ + uninstall uninstall-am uninstall-libexecSCRIPTS + +.PRECIOUS: Makefile + +@RELEASE_PRESENT_FALSE@NP-VERSION-FILE: .FORCE-NP-VERSION-FILE +@RELEASE_PRESENT_FALSE@ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN +@RELEASE_PRESENT_FALSE@.FORCE-NP-VERSION-FILE: +@RELEASE_PRESENT_FALSE@-include NP-VERSION-FILE + +test: + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test + for SCRIPT in *.pl; do perl -wc $$SCRIPT || exit 1; done + set -e; for SCRIPT in *.sh; do sh -n $$SCRIPT || exit 1; done + +test-debug: + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test + +.pl : + $(EDIT) $< > $@ + chmod +x $@ + +.sh : + $(EDIT) $< > $@ + chmod +x $@ + +clean-local: + rm -f NP-VERSION-FILE + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl new file mode 100755 index 0000000..531625c --- /dev/null +++ b/plugins-scripts/check_breeze.pl @@ -0,0 +1,89 @@ +#!@PERL@ -w + + +use strict; +use Getopt::Long; +use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw(%ERRORS &print_revision &support &usage); + +$PROGNAME = "check_breeze"; + +sub print_help (); +sub print_usage (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$ENV{'CDPATH'}=''; + +Getopt::Long::Configure('bundling'); +GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "w=s" => \$opt_w, "warning=s" => \$opt_w, + "c=s" => \$opt_c, "critical=s" => \$opt_c, + "H=s" => \$opt_H, "hostname=s" => \$opt_H, + "C=s" => \$opt_C, "community=s" => \$opt_C); + +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; +} + +if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} + +($opt_H) || usage("Host name/address not specified\n"); +my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); +($host) || usage("Invalid host: $opt_H\n"); + +($opt_w) || usage("Warning threshold not specified\n"); +my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/); +($warning) || usage("Invalid warning threshold: $opt_w\n"); + +($opt_c) || usage("Critical threshold not specified\n"); +my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/); +($critical) || usage("Invalid critical threshold: $opt_c\n"); + +($opt_C) || ($opt_C = "public") ; + +my $sig=0; +$sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`; +my @test=split(/ /,$sig); +$sig=$test[2]; +$sig=int($sig); +if ($sig>100){$sig=100} + +print "Signal Strength at: $sig%\n"; + +exit $ERRORS{'CRITICAL'} if ($sig<$critical); +exit $ERRORS{'WARNING'} if ($sig<$warning); +exit $ERRORS{'OK'}; + + +sub print_usage () { + print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop + +This plugin reports the signal strength of a Breezecom wireless equipment + +"; + print_usage(); + print " +-H, --hostname=HOST + Name or IP address of host to check +-C, --community=community + SNMPv1 community (default public) +-w, --warning=INTEGER + Percentage strength below which a WARNING status will result +-c, --critical=INTEGER + Percentage strength below which a CRITICAL status will result + +"; + support(); +} diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl new file mode 100644 index 0000000..eda8dd4 --- /dev/null +++ b/plugins-scripts/check_disk_smb.pl @@ -0,0 +1,349 @@ +#!@PERL@ -w +# +# +# check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port] +# +# Monitoring host script to get the disk usage from a SMB share +# +# Changes and Modifications +# ========================= +# 7-Aug-1999 - Michael Anthon +# Created from check_disk.pl script provided with netsaint_statd (basically +# cause I was too lazy (or is that smart?) to write it from scratch) +# 8-Aug-1999 - Michael Anthon +# Modified [warn] and [critical] parameters to accept format of nnn[M|G] to +# allow setting of limits in MBytes or GBytes. Percentage settings for large +# drives is a pain in the butt +# 2-May-2002 - SGhosh fix for embedded perl +# +# + +require 5.004; +use POSIX qw(setsid); +use strict; +use Getopt::Long; +use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $opt_C $opt_t $verbose); +use vars qw($PROGNAME); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); + +# make us session leader which makes all children exit if we do +setsid; + +sub print_help (); +sub print_usage (); + +$PROGNAME = "check_disk_smb"; + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +Getopt::Long::Configure('bundling'); +GetOptions + ("v" => \$verbose, "verbose" => \$verbose, + "t=i" => \$opt_t, "timeout=i" => \$opt_t, + "P=s" => \$opt_P, "port=s" => \$opt_P, + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "w=s" => \$opt_w, "warning=s" => \$opt_w, + "c=s" => \$opt_c, "critical=s" => \$opt_c, + "p=s" => \$opt_p, "password=s" => \$opt_p, + "u=s" => \$opt_u, "username=s" => \$opt_u, + "s=s" => \$opt_s, "share=s" => \$opt_s, + "W=s" => \$opt_W, "workgroup=s" => \$opt_W, + "H=s" => \$opt_H, "hostname=s" => \$opt_H, + "a=s" => \$opt_a, "address=s" => \$opt_a, + "C=s" => \$opt_C, "configfile=s" => \$opt_C); + +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); #' + exit $ERRORS{'UNKNOWN'}; +} + +if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} + +my $smbclient = $utils::PATH_TO_SMBCLIENT; +$smbclient || usage("check requires smbclient, smbclient not set\n"); +-x $smbclient || usage("check requires smbclient, $smbclient: $!\n"); + +# Options checking + +($opt_H) || ($opt_H = shift @ARGV) || usage("Host name not specified\n"); +my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/); +($host) || usage("Invalid host: $opt_H\n"); + +($opt_s) || ($opt_s = shift @ARGV) || usage("Share volume not specified\n"); +my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9 ]+\$?)$/); +($share) || usage("Invalid share: $opt_s\n"); + +defined($opt_u) || ($opt_u = shift @ARGV) || ($opt_u = "guest"); +my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]*)$/); +defined($user) || usage("Invalid user: $opt_u\n"); + +defined($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = ""); +my $pass = $1 if ($opt_p =~ /(.*)/); + +($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 85); +my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/); +($warn) || usage("Invalid warning threshold: $opt_w\n"); + +($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 95); +my $crit = $1 if ($opt_c =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/); +($crit) || usage("Invalid critical threshold: $opt_c\n"); + +($opt_C) || ($opt_C = shift @ARGV) || ($opt_C = ""); +my $configfile = $opt_C if ($opt_C); +usage("Unable to read config file $configfile\n") if ($configfile) && (! -r $configfile); + +if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } + +# Execute the given command line and return anything it writes to STDOUT and/or +# STDERR. (This might be useful for other plugins, too, so it should possibly +# be moved to utils.pm.) +sub output_and_error_of { + local *CMD; + local $/ = undef; + my $pid = open CMD, "-|"; + if (defined($pid)) { + if ($pid) { + return <CMD>; + } else { + open STDERR, ">&STDOUT" and exec @_; + exit(1); + } + } + return undef; +} + +# split the type from the unit value +#Check $warn and $crit for type (%/M/G) and set up for tests +#P = Percent, K = KBytes +my $warn_type; +my $crit_type; + +if ($opt_w =~ /^([0-9]+)\%?$/) { + $warn = "$1"; + $warn_type = "P"; +} elsif ($opt_w =~ /^([0-9]+)k$/) { + $warn_type = "K"; + $warn = $1; +} elsif ($opt_w =~ /^([0-9]+)M$/) { + $warn_type = "K"; + $warn = $1 * 1024; +} elsif ($opt_w =~ /^([0-9]+)G$/) { + $warn_type = "K"; + $warn = $1 * 1048576; +} +if ($opt_c =~ /^([0-9]+)\%?$/) { + $crit = "$1"; + $crit_type = "P"; +} elsif ($opt_c =~ /^([0-9]+)k$/) { + $crit_type = "K"; + $crit = $1; +} elsif ($opt_c =~ /^([0-9]+)M$/) { + $crit_type = "K"; + $crit = $1 * 1024; +} elsif ($opt_c =~ /^([0-9]+)G$/) { + $crit_type = "K"; + $crit = $1 * 1048576; +} + +# check if both warning and critical are percentage or size +unless( ( $warn_type eq "P" && $crit_type eq "P" ) || ( $warn_type ne "P" && $crit_type ne "P" ) ){ + $opt_w =~ s/\%/\%\%/g; + $opt_c =~ s/\%/\%\%/g; + usage("Both warning and critical should be same type- warning: $opt_w critical: $opt_c \n"); +} + +# verify warning is less than critical +if ( $warn_type eq "K") { + unless ( $warn > $crit) { + usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n"); + } +}else{ + unless ( $warn < $crit) { + $opt_w =~ s/\%/\%\%/g; + $opt_c =~ s/\%/\%\%/g; + usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n"); + } +} + +my $workgroup = $1 if (defined($opt_W) && $opt_W =~ /(.*)/); + +my $address = $1 if (defined($opt_a) && $opt_a =~ /(.*)/); + +# end of options checking + + +my $state = "OK"; +my $answer = undef; +my $res = undef; +my $perfdata = ""; +my @lines = undef; + +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print "No Answer from Client\n"; + $SIG{'INT'} = 'IGNORE'; + kill(-2, $$); + exit $ERRORS{"UNKNOWN"}; +}; +alarm($TIMEOUT); + +# Execute a "du" on the share using smbclient program +# get the results into $res +my @cmd = ( + $smbclient, + "//$host/$share", + "-U", "$user%$pass", + defined($workgroup) ? ("-W", $workgroup) : (), + defined($address) ? ("-I", $address) : (), + defined($opt_P) ? ("-p", $opt_P) : (), + defined($configfile) ? ("-s", $configfile) : (), + "-c", "du" +); + +print join(" ", @cmd) . "\n" if ($verbose); +$res = output_and_error_of(@cmd) or exit $ERRORS{"UNKNOWN"}; + +#Turn off alarm +alarm(0); + +#Split $res into an array of lines +@lines = split /\n/, $res; + +#Get the last line into $_ +$_ = $lines[$#lines-1]; +#print "$_\n"; + +#Process the last line to get free space. +#If line does not match required regexp, return an UNKNOWN error +if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) { + + my ($avail_bytes) = $3 * $2; + my ($total_bytes) = $1 * $2; + my ($occupied_bytes) = $1 * $2 - $avail_bytes; + my ($avail) = $avail_bytes/1024; + my ($capper); + if ($1!=0) { $capper = int(($3/$1)*100) } else { $capper=100 }; + my ($mountpt) = "\\\\$host\\$share"; + + # TODO : why is the kB the standard unit for args ? + my ($warn_bytes) = $total_bytes - $warn * 1024; + if ($warn_type eq "P") { + $warn_bytes = $warn * $1 * $2 / 100; + } + my ($crit_bytes) = $total_bytes - $crit * 1024; + if ($crit_type eq "P") { + $crit_bytes = $crit * $1 * $2 / 100; + } + + + if (int($avail / 1024) > 0) { + $avail = int($avail / 1024); + if (int($avail /1024) > 0) { + $avail = (int(($avail / 1024)*100))/100; + $avail = $avail ."G"; + } else { + $avail = $avail ."M"; + } + } else { + $avail = $avail ."K"; + } + +#print ":$warn:$warn_type:\n"; +#print ":$crit:$crit_type:\n"; +#print ":$avail:$avail_bytes:$capper:$mountpt:\n"; + $perfdata = "'" . $share . "'=" . $occupied_bytes . 'B;' + . $warn_bytes . ';' + . $crit_bytes . ';' + . '0;' + . $total_bytes; + + if ($occupied_bytes > $crit_bytes) { + $state = "CRITICAL"; + $answer = "CRITICAL: Only $avail ($capper%) free on $mountpt"; + } elsif ( $occupied_bytes > $warn_bytes ) { + $state = "WARNING"; + $answer = "WARNING: Only $avail ($capper%) free on $mountpt"; + } else { + $answer = "Disk ok - $avail ($capper%) free on $mountpt"; + } +} else { + $answer = "Result from smbclient not suitable"; + $state = "UNKNOWN"; + foreach (@lines) { + if (/(Access denied|NT_STATUS_LOGON_FAILURE|NT_STATUS_ACCESS_DENIED)/) { + $answer = "Access Denied"; + $state = "CRITICAL"; + last; + } + if (/(Unknown host \w*|Connection.*failed)/) { + $answer = "$1"; + $state = "CRITICAL"; + last; + } + if (/(You specified an invalid share name|NT_STATUS_BAD_NETWORK_NAME)/) { + $answer = "Invalid share name \\\\$host\\$share"; + $state = "CRITICAL"; + last; + } + } +} + + +print $answer; +print " | " . $perfdata if ($perfdata); +print "\n"; +print "$state\n" if ($verbose); +exit $ERRORS{$state}; + +sub print_usage () { + print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> + -w <warn> -c <crit> [-W <workgroup>] [-P <port>] [-a <IP>] [-t timeout] + [-C <configfile>]\n"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop + +Perl Check SMB Disk plugin for monitoring + +"; + print_usage(); + print " +-H, --hostname=HOST + NetBIOS name of the server +-s, --share=STRING + Share name to be tested +-W, --workgroup=STRING + Workgroup or Domain used (Defaults to \"WORKGROUP\") +-a, --address=IP + IP-address of HOST (only necessary if HOST is in another network) +-u, --user=STRING + Username to log in to server. (Defaults to \"guest\") +-p, --password=STRING + Password to log in to server. (Defaults to an empty password) +-w, --warning=INTEGER or INTEGER[kMG] + Percent of used space at which a warning will be generated (Default: 85%) +-c, --critical=INTEGER or INTEGER[kMG] + Percent of used space at which a critical will be generated (Defaults: 95%) +-t, --timeout=INTEGER + Seconds before connection times out (Default: 15) +-P, --port=INTEGER + Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default) +-C, --configfile=STRING + Path to configfile which should be used by smbclient (Defaults to smb.conf of your smb installation) + + If thresholds are followed by either a k, M, or G then check to see if that + much disk space is available (kilobytes, Megabytes, Gigabytes) + + Warning percentage should be less than critical + Warning (remaining) disk space should be greater than critical. + +"; + support(); +} diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl new file mode 100755 index 0000000..26281dd --- /dev/null +++ b/plugins-scripts/check_file_age.pl @@ -0,0 +1,161 @@ +#!@PERL@ -w + +# check_file_age.pl Copyright (C) 2003 Steven Grimm <koreth-nagios@midwinter.com> +# +# Checks a file's size and modification time to make sure it's not empty +# and that it's sufficiently recent. +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# you should have received a copy of the GNU General Public License +# along with this program if not, write to the Free Software Foundation, +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +use strict; +use English; +use Getopt::Long; +use File::stat; +use vars qw($PROGNAME); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw (%ERRORS &print_revision &support); + +sub print_help (); +sub print_usage (); + +my ($opt_c, $opt_f, $opt_w, $opt_C, $opt_W, $opt_h, $opt_V, $opt_i); +my ($result, $message, $age, $size, $st, $perfdata); + +$PROGNAME="check_file_age"; + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +$opt_w = 240; +$opt_c = 600; +$opt_f = ""; + +Getopt::Long::Configure('bundling'); +GetOptions( + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "i" => \$opt_i, "ignore-missing" => \$opt_i, + "f=s" => \$opt_f, "file" => \$opt_f, + "w=s" => \$opt_w, "warning-age=s" => \$opt_w, + "W=s" => \$opt_W, "warning-size=s" => \$opt_W, + "c=s" => \$opt_c, "critical-age=s" => \$opt_c, + "C=s" => \$opt_C, "critical-size=s" => \$opt_C); + +if ($opt_V) { + print_revision($PROGNAME, '@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; +} + +if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; +} + +$opt_f = shift unless ($opt_f); + +if (! $opt_f) { + print "FILE_AGE UNKNOWN: No file specified\n"; + exit $ERRORS{'UNKNOWN'}; +} + +# Check that file exists (can be directory or link) +unless (-e $opt_f) { + if ($opt_i) { + $result = 'OK'; + print "FILE_AGE $result: $opt_f doesn't exist, but ignore-missing was set\n"; + exit $ERRORS{$result}; + + } else { + print "FILE_AGE CRITICAL: File not found - $opt_f\n"; + exit $ERRORS{'CRITICAL'}; + } +} + +$st = File::stat::stat($opt_f); +$age = time - $st->mtime; +$size = $st->size; + +$result = 'OK'; + +if ($opt_c !~ m/^\d+$/ or ($opt_C and $opt_C !~ m/^\d+$/) + or $opt_w !~ m/^\d+$/ or ($opt_W and $opt_W !~ m/^\d+$/)) { + # range has been specified so use M::P::R to process + require Monitoring::Plugin::Range; + # use permissive range defaults for size when none specified + $opt_W = "0:" unless ($opt_W); + $opt_C = "0:" unless ($opt_C); + + if (Monitoring::Plugin::Range->parse_range_string($opt_c) + ->check_range($age) == 1) { # 1 means it raises an alert because it's OUTSIDE the range + $result = 'CRITICAL'; + } + elsif (Monitoring::Plugin::Range->parse_range_string($opt_C) + ->check_range($size) == 1) { + $result = 'CRITICAL'; + } + elsif (Monitoring::Plugin::Range->parse_range_string($opt_w) + ->check_range($age) == 1) { + $result = 'WARNING'; + } + elsif (Monitoring::Plugin::Range->parse_range_string($opt_W) + ->check_range($size) == 1) { + $result = 'WARNING'; + } +} +else { + # use permissive defaults for size when none specified + $opt_W = 0 unless ($opt_W); + $opt_C = 0 unless ($opt_C); + if ($age > $opt_c or $size < $opt_C) { + $result = 'CRITICAL'; + } + elsif ($age > $opt_w or $size < $opt_W) { + $result = 'WARNING'; + } +} + +$perfdata = "age=${age}s;${opt_w};${opt_c} size=${size}B;${opt_W};${opt_C};0"; +print "FILE_AGE $result: $opt_f is $age seconds old and $size bytes | $perfdata\n"; +exit $ERRORS{$result}; + +sub print_usage () { + print "Usage:\n"; + print " $PROGNAME [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file>\n"; + print " $PROGNAME [-h | --help]\n"; + print " $PROGNAME [-V | --version]\n"; +} + +sub print_help () { + print_revision($PROGNAME, '@NP_VERSION@'); + print "Copyright (c) 2003 Steven Grimm\n\n"; + print_usage(); + print "\n"; + print " -i | --ignore-missing : return OK if the file does not exist\n"; + print " <secs> File must be no more than this many seconds old (default: warn 240 secs, crit 600)\n"; + print " <size> File must be at least this many bytes long (default: file size is ignored (0 bytes))\n\n"; + print " Both <secs> and <size> can specify a range using the standard plugin syntax\n"; + print " If any of the warning and critical arguments are in range syntax (not just bare numbers)\n"; + print " then all warning and critical arguments will be interpreted as ranges.\n"; + print " To use range processing the perl module Monitoring::Plugin must be installed\n"; + print " For range syntax see https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"; + print " It is strongly recommended when using range syntax that all four of -w, -W, -c and -C are specified\n"; + print " otherwise it is unlikely that the size test will be doing what is desired\n"; + print "\n"; + support(); +} + diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl new file mode 100755 index 0000000..e3fe296 --- /dev/null +++ b/plugins-scripts/check_flexlm.pl @@ -0,0 +1,245 @@ +#!@PERL@ -w +# +# usage: +# check_flexlm.pl license_file +# +# Check available flexlm license managers. +# Use lmstat to check the status of the license server +# described by the license file given as argument. +# Check and interpret the output of lmstat +# and create returncodes and output. +# +# Contrary to most other plugins, this script takes +# a file, not a hostname as an argument and returns +# the status of hosts and services described in that +# file. Use these hosts.cfg entries as an example +# +#host[anchor]=any host will do;some.address.com;;check-host-alive;3;120;24x7;1;1;1; +#service[anchor]=yodel;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yodel_lic +#service[anchor]=yeehaw;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yeehaw_lic +#command[check_flexlm]=/some/path/libexec/check_flexlm.pl $ARG1$ +# +# Notes: +# - you need the lmstat utility which comes with flexlm. +# - set the correct path in the variable $lmstat. +# +# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com +# +# License: GPL +# +# lmstat output patches from Steve Rigler/Cliff Rice 13-Apr-2002 +# srigler@marathonoil.com,cerice@marathonoil.com + + + +use strict; +use Getopt::Long; +use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw(%ERRORS &print_revision &support &usage); + +$PROGNAME="check_flexlm"; + +sub print_help (); +sub print_usage (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +Getopt::Long::Configure('bundling'); +GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "v" => \$verbose, "verbose" => \$verbose, + "F=s" => \$opt_F, "filename=s" => \$opt_F, + "t=i" => \$opt_t, "timeout=i" => \$opt_t); + +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; +} + +unless (defined $opt_t) { + $opt_t = $utils::TIMEOUT ; # default timeout +} + + +if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} + +unless (defined $opt_F) { + print "Missing license.dat file\n"; + print_usage(); + exit $ERRORS{'UNKNOWN'}; +} +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print "Timeout: No Answer from Client\n"; + exit $ERRORS{'UNKNOWN'}; +}; +alarm($opt_t); + +my $lmstat = $utils::PATH_TO_LMSTAT ; +unless (-x $lmstat ) { + print "Cannot find \"lmstat\"\n"; + exit $ERRORS{'UNKNOWN'}; +} + +($opt_F) || ($opt_F = shift) || usage("License file not specified\n"); +my $licfile = $1 if ($opt_F =~ /^(.*)$/); +($licfile) || usage("Invalid filename: $opt_F\n"); + +print "$licfile\n" if $verbose; + +if ( ! open(CMD,"$lmstat -c $licfile |") ) { + print "ERROR: Could not open \"$lmstat -c $licfile\" ($!)\n"; + exit exit $ERRORS{'UNKNOWN'}; +} + +my $serverup = 0; +my @upsrv; +my @downsrv; # list of servers up and down + +#my ($ls1,$ls2,$ls3,$lf1,$lf2,$lf3,$servers); + +# key off of the term "license server" and +# grab the status. Keep going until "Vendor" is found +# + +# +# Collect list of license servers by their status +# Vendor daemon status is ignored for the moment. + +while ( <CMD> ) { + next if (/^lmstat/); # ignore 1st line - copyright + next if (/^Flexible/); # ignore 2nd line - timestamp + (/^Vendor/) && last; # ignore Vendor daemon status + print $_ if $verbose; + + if ($_ =~ /license server /) { # matched 1 (of possibly 3) license server + s/^\s*//; #some servers start at col 1, other have whitespace + # strip staring whitespace if any + if ( $_ =~ /UP/) { + $_ =~ /^(.*):/ ; + push(@upsrv, $1); + print "up:$1:\n" if $verbose; + } else { + $_ =~ /^(.*):/; + push(@downsrv, $1); + print "down:$1:\n" if $verbose; + } + + } + + +# if ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*)/ ) { +# $ls1 = $1; +# $ls2 = $2; +# $ls3 = $3; +# $lf1 = $lf2 = $lf3 = 0; +# $servers = 3; +# } elsif ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*)/ ) { +# $ls1 = $1; +# $ls2 = $ls3 = ""; +# $lf1 = $lf2 = $lf3 = 0; +# $servers = 1; +# } elsif ( / *$ls1: license server UP/ ) { +# print "$ls1 UP, "; +# $lf1 = 1 +# } elsif ( / *$ls2: license server UP/ ) { +# print "$ls2 UP, "; +# $lf2 = 1 +# } elsif ( / *$ls3: license server UP/ ) { +# print "$ls3 UP, "; +# $lf3 = 1 +# } elsif ( / *([^:]*: UP .*)/ ) { +# print " license server for $1\n"; +# $serverup = 1; +# } + +} + +#if ( $serverup == 0 ) { +# print " license server not running\n"; +# exit 2; +#} + +close CMD; + +if ($verbose) { + print "License Servers running: ".scalar(@upsrv) ."\n"; + foreach my $upserver (@upsrv) { + print "$upserver\n"; + } + print "License servers not running: ".scalar(@downsrv)."\n"; + foreach my $downserver (@downsrv) { + print "$downserver\n"; + } +} + +# +# print list of servers which are up. +# +if (scalar(@upsrv) > 0) { + print "License Servers running:"; + foreach my $upserver (@upsrv) { + print "$upserver,"; + } +} +# +# Ditto for those which are down. +# +if (scalar(@downsrv) > 0) { + print "License servers NOT running:"; + foreach my $downserver (@downsrv) { + print "$downserver,"; + } +} + +# perfdata +print "\n|flexlm::up:".scalar(@upsrv).";down:".scalar(@downsrv)."\n"; + +exit $ERRORS{'OK'} if ( scalar(@downsrv) == 0 ); +exit $ERRORS{'WARNING'} if ( (scalar(@upsrv) > 0) && (scalar(@downsrv) > 0)); + +#exit $ERRORS{'OK'} if ( $servers == $lf1 + $lf2 + $lf3 ); +#exit $ERRORS{'WARNING'} if ( $servers == 3 && $lf1 + $lf2 + $lf3 == 2 ); +exit $ERRORS{'CRITICAL'}; + + +sub print_usage () { + print "Usage: + $PROGNAME -F <filename> [-v] [-t] [-V] [-h] + $PROGNAME --help + $PROGNAME --version +"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2000 Ernst-Dieter Martin/Karl DeBisschop + +Check available flexlm license managers + +"; + print_usage(); + print " +-F, --filename=FILE + Name of license file (usually \"license.dat\") +-v, --verbose + Print some extra debugging information (not advised for normal operation) +-t, --timeout + Plugin time out in seconds (default = $utils::TIMEOUT ) +-V, --version + Show version and license information +-h, --help + Show this help screen + +Flexlm license managers usually run as a single server or three servers and a +quorum is needed. The plugin return OK if 1 (single) or 3 (triple) servers +are running, CRITICAL if 1(single) or 3 (triple) servers are down, and WARNING +if 1 or 2 of 3 servers are running\n +"; + support(); +} diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl new file mode 100755 index 0000000..e335cda --- /dev/null +++ b/plugins-scripts/check_ifoperstatus.pl @@ -0,0 +1,478 @@ +#!@PERL@ -w +# +# check_ifoperstatus.pl - monitoring plugin +# +# Copyright (C) 2000 Christoph Kron, +# Modified 5/2002 to conform to updated Monitoring Plugins Guidelines +# Added support for named interfaces per Valdimir Ivaschenko (S. Ghosh) +# Added SNMPv3 support (10/2003) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA +# +# +# Report bugs to: help@monitoring-plugins.org +# +# 11.01.2000 Version 1.0 +# +# Patches from Guy Van Den Bergh to warn on ifadminstatus down interfaces +# instead of critical. +# +# Primary MIB reference - RFC 2863 + + +use POSIX; +use strict; +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); + +use Net::SNMP; +use Getopt::Long; +&Getopt::Long::config('bundling'); + +my $PROGNAME = "check_ifoperstatus"; +sub print_help (); +sub usage ($); +sub print_usage (); +sub process_arguments (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +my $timeout; +my $status; +my %ifOperStatus = ('1','up', + '2','down', + '3','testing', + '4','unknown', + '5','dormant', + '6','notPresent', + '7','lowerLayerDown'); # down due to the state of lower layer interface(s) + +my $state = "UNKNOWN"; +my $answer = ""; +my $snmpkey = 0; +my $community = "public"; +my $maxmsgsize = 1472 ; # Net::SNMP default is 1472 +my ($seclevel, $authproto, $secname, $authpass, $privpass, $privproto, $auth, $priv, $context); +my $port = 161; +my @snmpoids; +my $sysUptime = '1.3.6.1.2.1.1.3.0'; +my $snmpIfDescr = '1.3.6.1.2.1.2.2.1.2'; +my $snmpIfType = '1.3.6.1.2.1.2.2.1.3'; +my $snmpIfAdminStatus = '1.3.6.1.2.1.2.2.1.7'; +my $snmpIfOperStatus = '1.3.6.1.2.1.2.2.1.8'; +my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1'; +my $snmpIfLastChange = '1.3.6.1.2.1.2.2.1.9'; +my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18'; +my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28'; +my $hostname; +my $ifName; +my $session; +my $error; +my $response; +my $snmp_version = 1 ; +my $ifXTable; +my $opt_h ; +my $opt_V ; +my $ifdescr; +my $iftype; +my $key; +my $lastc; +my $dormantWarn; +my $adminWarn; +my $name; +my %session_opts; + +### Validate Arguments + +$status = process_arguments(); + + +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print ("ERROR: No snmp response from $hostname (alarm)\n"); + exit $ERRORS{"UNKNOWN"}; +}; + +alarm($timeout); + +($session, $error) = Net::SNMP->session(%session_opts); + + +if (!defined($session)) { + $state='UNKNOWN'; + $answer=$error; + print ("$state: $answer\n"); + exit $ERRORS{$state}; +} + +## map ifdescr to ifindex - should look at being able to cache this value + +if (defined $ifdescr || defined $iftype) { + if (defined $iftype) { + $status=fetch_ifindex($snmpIfType, $iftype); + } else { + # escape "/" in ifdescr - very common in the Cisco world + $ifdescr =~ s/\//\\\//g; + $status=fetch_ifindex($snmpIfDescr, $ifdescr); # if using on device with large number of interfaces + # recommend use of SNMP v2 (get-bulk) + } + if ($status==0) { + $state = "UNKNOWN"; + printf "$state: could not retrieve ifdescr/iftype snmpkey - $status-$snmpkey\n"; + $session->close; + exit $ERRORS{$state}; + } +} + + +## Main function + +$snmpIfAdminStatus = $snmpIfAdminStatus . "." . $snmpkey; +$snmpIfOperStatus = $snmpIfOperStatus . "." . $snmpkey; +$snmpIfDescr = $snmpIfDescr . "." . $snmpkey; +$snmpIfName = $snmpIfName . "." . $snmpkey ; +$snmpIfAlias = $snmpIfAlias . "." . $snmpkey ; + +push(@snmpoids,$snmpIfAdminStatus); +push(@snmpoids,$snmpIfOperStatus); +push(@snmpoids,$snmpIfDescr); +push(@snmpoids,$snmpIfName) if (defined $ifXTable) ; +push(@snmpoids,$snmpIfAlias) if (defined $ifXTable) ; + +if (!defined($response = $session->get_request(@snmpoids))) { + $answer=$session->error; + $session->close; + $state = 'WARNING'; + print ("$state: SNMP error: $answer\n"); + exit $ERRORS{$state}; +} + +$answer = sprintf("host '%s', %s(%s) is %s\n", + $hostname, + $response->{$snmpIfDescr}, + $snmpkey, + $ifOperStatus{$response->{$snmpIfOperStatus}} +); + + +## Check to see if ifName match is requested and it matches - exit if no match +## not the interface we want to monitor +if ( defined $ifName && not ($response->{$snmpIfName} eq $ifName) ) { + $state = 'UNKNOWN'; + $answer = "Interface name ($ifName) doesn't match snmp value ($response->{$snmpIfName}) (index $snmpkey)"; + print ("$state: $answer\n"); + exit $ERRORS{$state}; +} + +## define the interface name +if (defined $ifXTable) { + $name = $response->{$snmpIfName} ." - " .$response->{$snmpIfAlias} ; +}else{ + $name = $response->{$snmpIfDescr} ; +} + +## if AdminStatus is down - some one made a conscious effort to change config +## +if ( not ($response->{$snmpIfAdminStatus} == 1) ) { + $answer = "Interface $name (index $snmpkey) is administratively down."; + if ( not defined $adminWarn or $adminWarn eq "w" ) { + $state = 'WARNING'; + } elsif ( $adminWarn eq "i" ) { + $state = 'OK'; + } elsif ( $adminWarn eq "c" ) { + $state = 'CRITICAL'; + } else { # If wrong value for -a, say warning + $state = 'WARNING'; + } +} +## Check operational status +elsif ( $response->{$snmpIfOperStatus} == 2 ) { + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) is down."; +} elsif ( $response->{$snmpIfOperStatus} == 5 ) { + if (defined $dormantWarn ) { + if ($dormantWarn eq "w") { + $state = 'WARNING'; + $answer = "Interface $name (index $snmpkey) is dormant."; + }elsif($dormantWarn eq "c") { + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) is dormant."; + }elsif($dormantWarn eq "i") { + $state = 'OK'; + $answer = "Interface $name (index $snmpkey) is dormant."; + } + }else{ + # dormant interface - but warning/critical/ignore not requested + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) is dormant."; + } +} elsif ( $response->{$snmpIfOperStatus} == 6 ) { + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) notPresent - possible hotswap in progress."; +} elsif ( $response->{$snmpIfOperStatus} == 7 ) { + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) down due to lower layer being down."; +} elsif ( $response->{$snmpIfOperStatus} == 3 || $response->{$snmpIfOperStatus} == 4 ) { + $state = 'CRITICAL'; + $answer = "Interface $name (index $snmpkey) down (testing/unknown)."; +} else { + $state = 'OK'; + $answer = "Interface $name (index $snmpkey) is up."; +} + + + +print ("$state: $answer\n"); +exit $ERRORS{$state}; + + +### subroutines + +sub fetch_ifindex { + my $oid = shift; + my $lookup = shift; + + if (!defined ($response = $session->get_table($oid))) { + $answer=$session->error; + $session->close; + $state = 'CRITICAL'; + printf ("$state: SNMP error with snmp version $snmp_version ($answer)\n"); + $session->close; + exit $ERRORS{$state}; + } + + foreach $key ( keys %{$response}) { + if ($response->{$key} =~ /^$lookup$/) { + $key =~ /.*\.(\d+)$/; + $snmpkey = $1; + #print "$lookup = $key / $snmpkey \n"; #debug + } + } + unless (defined $snmpkey) { + $session->close; + $state = 'CRITICAL'; + printf "$state: Could not match $ifdescr on $hostname\n"; + exit $ERRORS{$state}; + } + + return $snmpkey; +} + +sub usage($) { + print "$_[0]\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; +} + +sub print_usage() { + printf "\n"; + printf "usage: \n"; + printf "check_ifoperstatus -k <IF_KEY> -H <HOSTNAME> [-C <community>]\n"; + printf "Copyright (C) 2000 Christoph Kron\n"; + printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n"; + printf "This program is licensed under the terms of the "; + printf "GNU General Public License\n(check source code for details)\n"; + printf "\n\n"; +} + +sub print_help() { + print_revision($PROGNAME, '@NP_VERSION@'); + print_usage(); + printf "check_ifoperstatus plugin for monitoring operational \n"; + printf "status of a particular network interface on the target host\n"; + printf "\nUsage:\n"; + printf " -H (--hostname) Hostname to query - (required)\n"; + printf " -C (--community) SNMP read community (defaults to public,\n"; + printf " used with SNMP v1 and v2c\n"; + printf " -v (--snmp_version) 1 for SNMP v1 (default)\n"; + printf " 2 for SNMP v2c\n"; + printf " SNMP v2c will use get_bulk for less overhead\n"; + printf " if monitoring with -d\n"; + printf " -L (--seclevel) choice of \"noAuthNoPriv\", \"authNoPriv\", or \"authPriv\"\n"; + printf " -U (--secname) username for SNMPv3 context\n"; + printf " -c (--context) SNMPv3 context name (default is empty string)\n"; + printf " -A (--authpass) authentication password (cleartext ascii or localized key\n"; + printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n"; + printf " auth password and authEngineID\n"; + printf " -a (--authproto) Authentication protocol (MD5 or SHA1)\n"; + printf " -X (--privpass) privacy password (cleartext ascii or localized key\n"; + printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n"; + printf " privacy password and authEngineID\n"; + printf " -P (--privproto) privacy protocol (DES or AES; default: DES)\n"; + printf " -k (--key) SNMP IfIndex value\n"; + printf " -d (--descr) SNMP ifDescr value\n"; + printf " -T (--type) SNMP ifType integer value (see http://www.iana.org/assignments/ianaiftype-mib)\n"; + printf " -p (--port) SNMP port (default 161)\n"; + printf " -I (--ifmib) Agent supports IFMIB ifXTable. Do not use if\n"; + printf " you don't know what this is. \n"; + printf " -n (--name) the value should match the returned ifName\n"; + printf " (Implies the use of -I)\n"; + printf " -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical)\n"; + printf " -D (--admin-down =i|w|c) same for administratively down interfaces (default warning)\n"; + printf " -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n"; + printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n"; + printf " -V (--version) Plugin version\n"; + printf " -h (--help) usage help \n\n"; + printf " -k or -d or -T must be specified\n\n"; + printf "Note: either -k or -d or -T must be specified and -d and -T are much more network \n"; + printf "intensive. Use it sparingly or not at all. -n is used to match against\n"; + printf "a much more descriptive ifName value in the IfXTable to verify that the\n"; + printf "snmpkey has not changed to some other network interface after a reboot.\n\n"; + +} + +sub process_arguments() { + $status = GetOptions( + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "v=i" => \$snmp_version, "snmp_version=i" => \$snmp_version, + "C=s" => \$community, "community=s" => \$community, + "L=s" => \$seclevel, "seclevel=s" => \$seclevel, + "a=s" => \$authproto, "authproto=s" => \$authproto, + "U=s" => \$secname, "secname=s" => \$secname, + "A=s" => \$authpass, "authpass=s" => \$authpass, + "X=s" => \$privpass, "privpass=s" => \$privpass, + "P=s" => \$privproto, "privproto=s" => \$privproto, + "c=s" => \$context, "context=s" => \$context, + "k=i" => \$snmpkey, "key=i",\$snmpkey, + "d=s" => \$ifdescr, "descr=s" => \$ifdescr, + "l=s" => \$lastc, "lastchange=s" => \$lastc, + "p=i" => \$port, "port=i" =>\$port, + "H=s" => \$hostname, "hostname=s" => \$hostname, + "I" => \$ifXTable, "ifmib" => \$ifXTable, + "n=s" => \$ifName, "name=s" => \$ifName, + "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn, + "D=s" => \$adminWarn, "admin-down=s" => \$adminWarn, + "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize, + "t=i" => \$timeout, "timeout=i" => \$timeout, + "T=i" => \$iftype, "type=i" => \$iftype, + ); + + + if ($status == 0){ + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + if (! utils::is_hostname($hostname)){ + usage("Hostname invalid or not given"); + } + + unless ($snmpkey > 0 || defined $ifdescr || defined $iftype){ + usage("Either a valid snmp key (-k) or a ifDescr (-d) must be provided"); + } + + if (defined $ifName) { + $ifXTable=1; + } + + if (defined $dormantWarn) { + unless ($dormantWarn =~ /^(w|c|i)$/ ) { + printf "Dormant alerts must be one of w|c|i \n"; + exit $ERRORS{'UNKNOWN'}; + } + } + + unless (defined $timeout) { + $timeout = $TIMEOUT; + } + + if ($snmp_version !~ /[123]/){ + $state='UNKNOWN'; + print ("$state: No support for SNMP v$snmp_version yet\n"); + exit $ERRORS{$state}; + } + + %session_opts = ( + -hostname => $hostname, + -port => $port, + -version => $snmp_version, + -maxmsgsize => $maxmsgsize + ); + + $session_opts{'-community'} = $community if (defined $community && $snmp_version =~ /[12]/); + + if ($snmp_version =~ /3/ ) { + # Must define a security level even though default is noAuthNoPriv + # v3 requires a security username + if (defined $seclevel && defined $secname) { + $session_opts{'-username'} = $secname; + + # Must define a security level even though default is noAuthNoPriv + unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { + usage("Must define a valid security level even though default is noAuthNoPriv"); + } + + # Authentication wanted + if ( $seclevel eq 'authNoPriv' || $seclevel eq 'authPriv' ) { + if (defined $authproto && $authproto ne 'MD5' && $authproto ne 'SHA1') { + usage("Auth protocol can be either MD5 or SHA1"); + } + $session_opts{'-authprotocol'} = $authproto if(defined $authproto); + + if ( !defined $authpass) { + usage("Auth password/key is not defined"); + }else{ + if ($authpass =~ /^0x/ ) { + $session_opts{'-authkey'} = $authpass ; + }else{ + $session_opts{'-authpassword'} = $authpass ; + } + } + } + + # Privacy (DES encryption) wanted + if ($seclevel eq 'authPriv' ) { + if (! defined $privpass) { + usage("Privacy passphrase/key is not defined"); + }else{ + if ($privpass =~ /^0x/){ + $session_opts{'-privkey'} = $privpass; + }else{ + $session_opts{'-privpassword'} = $privpass; + } + } + + $session_opts{'-privprotocol'} = $privproto if(defined $privproto); + } + + # Context name defined or default + unless ( defined $context) { + $context = ""; + } + + }else { + usage("Security level or name is not defined"); + } + } # end snmpv3 + + +} +## End validation + diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl new file mode 100755 index 0000000..38b87fc --- /dev/null +++ b/plugins-scripts/check_ifstatus.pl @@ -0,0 +1,448 @@ +#!@PERL@ -w +# +# check_ifstatus.pl - monitoring plugin +# +# +# Copyright (C) 2000 Christoph Kron +# Modified 5/2002 to conform to updated Monitoring Plugins Guidelines (S. Ghosh) +# Added -x option (4/2003) +# Added -u option (4/2003) +# Added -M option (10/2003) +# Added SNMPv3 support (10/2003) +# Added -n option (07/2014) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +# +# Report bugs to: ck@zet.net, help@monitoring-plugins.org +# +# 11.01.2000 Version 1.0 +# + +use POSIX; +use strict; +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); + +use Net::SNMP; +use Getopt::Long; +Getopt::Long::Configure('bundling'); + +my $PROGNAME = "check_ifstatus"; + +sub print_help (); +sub usage ($); +sub print_usage (); +sub process_arguments (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +my $status; +my %ifOperStatus = ('1','up', + '2','down', + '3','testing', + '4','unknown', + '5','dormant', + '6','notPresent', + '7','lowerLayerDown'); # down due to the state of lower layer interface(s)); + +my $timeout ; +my $state = "UNKNOWN"; +my $answer = ""; +my $snmpkey=0; +my $snmpoid=0; +my $key=0; +my $community = "public"; +my $maxmsgsize = 1472 ; # Net::SNMP default is 1472 +my ($seclevel, $authproto, $secname, $authpass, $privpass, $privproto, $auth, $priv, $context); +my $port = 161; +my @snmpoids; +my $snmpIfAdminStatus = '1.3.6.1.2.1.2.2.1.7'; +my $snmpIfDescr = '1.3.6.1.2.1.2.2.1.2'; +my $snmpIfOperStatus = '1.3.6.1.2.1.2.2.1.8'; +my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1'; +my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18'; +my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28'; +my $snmpIfType = '1.3.6.1.2.1.2.2.1.3'; +my $hostname; +my $session; +my $error; +my $response; +my %ifStatus; +my $ifup =0 ; +my $ifdown =0; +my $ifdormant = 0; +my $ifexclude = 0 ; +my $ifunused = 0; +my $ifmessage = ""; +my $snmp_version = 1; +my $ifXTable; +my $opt_h ; +my $opt_V ; +my $opt_u; +my $opt_n; +my $opt_x ; +my %excluded ; +my %unused_names ; +my @unused_ports ; +my %session_opts; + + + + + +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print ("ERROR: No snmp response from $hostname (alarm timeout)\n"); + exit $ERRORS{"UNKNOWN"}; +}; + + +#Option checking +$status = process_arguments(); + +if ($status != 0) +{ + print_help() ; + exit $ERRORS{'UNKNOWN'}; +} + + +alarm($timeout); +($session, $error) = Net::SNMP->session(%session_opts); + +if (!defined($session)) { + $state='UNKNOWN'; + $answer=$error; + print ("$state: $answer\n"); + exit $ERRORS{$state}; +} + + +push(@snmpoids,$snmpIfOperStatus); +push(@snmpoids,$snmpIfAdminStatus); +push(@snmpoids,$snmpIfDescr); +push(@snmpoids,$snmpIfType); +push(@snmpoids,$snmpIfName) if ( defined $ifXTable); +push(@snmpoids,$snmpIfAlias) if ( defined $ifXTable); + + + + +foreach $snmpoid (@snmpoids) { + + if (!defined($response = $session->get_table($snmpoid))) { + $answer=$session->error; + $session->close; + $state = 'CRITICAL'; + if ( ( $snmpoid =~ $snmpIfName ) && defined $ifXTable ) { + print ("$state: Device does not support ifTable - try without -I option\n"); + }else{ + print ("$state: $answer for $snmpoid with snmp version $snmp_version\n"); + } + exit $ERRORS{$state}; + } + + foreach $snmpkey (keys %{$response}) { + $snmpkey =~ /.*\.(\d+)$/; + $key = $1; + $ifStatus{$key}{$snmpoid} = $response->{$snmpkey}; + } +} + + +$session->close; + +alarm(0); + +foreach $key (keys %ifStatus) { + + # skip unused interfaces + my $ifName = $ifStatus{$key}{$snmpIfDescr}; + + if (!defined($ifStatus{$key}{'notInUse'}) && !grep(/^${ifName}/, @unused_ports )) { + # check only if interface is administratively up + if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) { + #check only if interface is not excluded + if (!defined $unused_names{$ifStatus{$key}{$snmpIfDescr}} ) { + # check only if interface type is not listed in %excluded + if (!defined $excluded{$ifStatus{$key}{$snmpIfType}} ) { + if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ; } + if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) { + $ifdown++ ; + if (defined $ifXTable) { + $ifmessage .= sprintf("%s: down -> %s<BR>\n", $ifStatus{$key}{$snmpIfName}, $ifStatus{$key}{$snmpIfAlias}); + }else{ + $ifmessage .= sprintf("%s: down <BR>\n",$ifStatus{$key}{$snmpIfDescr}); + } + } + if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;} + } else { + $ifexclude++; + } + } else { + $ifunused++; + } + + } + }else{ + $ifunused++; + } +} + + if ($ifdown > 0) { + $state = 'CRITICAL'; + $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, excluded: %d, unused: %d<BR>", + $hostname, + $ifup, + $ifdown, + $ifdormant, + $ifexclude, + $ifunused); + $answer = $answer . $ifmessage . "\n"; + } + else { + $state = 'OK'; + $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, excluded: %d, unused: %d", + $hostname, + $ifup, + $ifdown, + $ifdormant, + $ifexclude, + $ifunused); + } +my $perfdata = sprintf("up=%d down=%d dormant=%d excluded=%d unused=%d",$ifup,$ifdown,$ifdormant,$ifexclude,$ifunused); +print ("$state: $answer |$perfdata\n"); +exit $ERRORS{$state}; + +sub usage($) { + print "$_[0]\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; +} + +sub print_usage() { + printf "\n"; + printf "usage: \n"; + printf "check_ifstatus -C <READCOMMUNITY> -p <PORT> -H <HOSTNAME>\n"; + printf "Copyright (C) 2000 Christoph Kron\n"; + printf "Updates 5/2002 Subhendu Ghosh\n"; + support(); + printf "\n\n"; +} + +sub print_help() { + print_revision($PROGNAME, '@NP_VERSION@'); + print_usage(); + printf "check_ifstatus plugin for monitoring operational \n"; + printf "status of each network interface on the target host\n"; + printf "\nUsage:\n"; + printf " -H (--hostname) Hostname to query - (required)\n"; + printf " -C (--community) SNMP read community (defaults to public,\n"; + printf " used with SNMP v1 and v2c\n"; + printf " -v (--snmp_version) 1 for SNMP v1 (default)\n"; + printf " 2 for SNMP v2c\n"; + printf " SNMP v2c will use get_bulk for less overhead\n"; + printf " 3 for SNMPv3 (requires -U option)"; + printf " -p (--port) SNMP port (default 161)\n"; + printf " -I (--ifmib) Agent supports IFMIB ifXTable. For Cisco - this will provide\n"; + printf " the descriptive name. Do not use if you don't know what this is. \n"; + printf " -x (--exclude) A comma separated list of ifType values that should be excluded \n"; + printf " from the report (default for an empty list is PPP(23).\n"; + printf " -n (--unused_ports_by_name) A comma separated list of ifDescr values that should be excluded \n"; + printf " from the report (default is an empty exclusion list).\n"; + printf " -u (--unused_ports) A comma separated list of ifIndex values that should be excluded \n"; + printf " from the report (default is an empty exclusion list).\n"; + printf " See the IANAifType-MIB for a list of interface types.\n"; + printf " -L (--seclevel) choice of \"noAuthNoPriv\", \"authNoPriv\", or \"authPriv\"\n"; + printf " -U (--secname) username for SNMPv3 context\n"; + printf " -c (--context) SNMPv3 context name (default is empty string)\n"; + printf " -A (--authpass) authentication password (cleartext ascii or localized key\n"; + printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n"; + printf " auth password and authEngineID\n"; + printf " -a (--authproto) Authentication protocol (MD5 or SHA1)\n"; + printf " -X (--privpass) privacy password (cleartext ascii or localized key\n"; + printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n"; + printf " privacy password and authEngineID\n"; + printf " -P (--privproto) privacy protocol (DES or AES; default: DES)\n"; + printf " -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n"; + printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n"; + printf " -V (--version) Plugin version\n"; + printf " -h (--help) usage help \n\n"; + print_revision($PROGNAME, '@NP_VERSION@'); + +} + +sub process_arguments() { + $status = GetOptions( + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "v=s" => \$snmp_version, "snmp_version=s" => \$snmp_version, + "C=s" => \$community,"community=s" => \$community, + "L=s" => \$seclevel, "seclevel=s" => \$seclevel, + "a=s" => \$authproto, "authproto=s" => \$authproto, + "U=s" => \$secname, "secname=s" => \$secname, + "A=s" => \$authpass, "authpass=s" => \$authpass, + "X=s" => \$privpass, "privpass=s" => \$privpass, + "P=s" => \$privproto, "privproto=s" => \$privproto, + "c=s" => \$context, "context=s" => \$context, + "p=i" =>\$port, "port=i" => \$port, + "H=s" => \$hostname, "hostname=s" => \$hostname, + "I" => \$ifXTable, "ifmib" => \$ifXTable, + "x:s" => \$opt_x, "exclude:s" => \$opt_x, + "u=s" => \$opt_u, "unused_ports=s" => \$opt_u, + "n=s" => \$opt_n, "unused_ports_by_name=s" => \$opt_n, + "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize, + "t=i" => \$timeout, "timeout=i" => \$timeout, + ); + + if ($status == 0){ + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + unless (defined $timeout) { + $timeout = $TIMEOUT; + } + + # Net::SNMP wants an integer + $snmp_version = 2 if $snmp_version eq "2c"; + + if ($snmp_version !~ /^[123]$/){ + $state='UNKNOWN'; + print ("$state: No support for SNMP v$snmp_version yet\n"); + exit $ERRORS{$state}; + } + + %session_opts = ( + -hostname => $hostname, + -port => $port, + -version => $snmp_version, + -maxmsgsize => $maxmsgsize + ); + + $session_opts{'-community'} = $community if (defined $community && $snmp_version =~ /[12]/); + + if ($snmp_version =~ /3/ ) { + # Must define a security level even though default is noAuthNoPriv + # v3 requires a security username + if (defined $seclevel && defined $secname) { + $session_opts{'-username'} = $secname; + + # Must define a security level even though default is noAuthNoPriv + unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { + usage("Must define a valid security level even though default is noAuthNoPriv"); + } + + # Authentication wanted + if ( $seclevel eq 'authNoPriv' || $seclevel eq 'authPriv' ) { + if (defined $authproto && $authproto ne 'MD5' && $authproto ne 'SHA1') { + usage("Auth protocol can be either MD5 or SHA1"); + } + $session_opts{'-authprotocol'} = $authproto if(defined $authproto); + + if ( !defined $authpass) { + usage("Auth password/key is not defined"); + }else{ + if ($authpass =~ /^0x/ ) { + $session_opts{'-authkey'} = $authpass ; + }else{ + $session_opts{'-authpassword'} = $authpass ; + } + } + } + + # Privacy (DES encryption) wanted + if ($seclevel eq 'authPriv' ) { + if (! defined $privpass) { + usage("Privacy passphrase/key is not defined"); + }else{ + if ($privpass =~ /^0x/){ + $session_opts{'-privkey'} = $privpass; + }else{ + $session_opts{'-privpassword'} = $privpass; + } + } + + $session_opts{'-privprotocol'} = $privproto if(defined $privproto); + } + + # Context name defined or default + unless ( defined $context) { + $context = ""; + } + + }else { + usage("Security level or name is not defined"); + } + } # end snmpv3 + + # Excluded interfaces types (ifType) (backup interfaces, dial-on demand interfaces, PPP interfaces + if (defined $opt_x) { + my @x = split(/,/, $opt_x); + if ( @x) { + foreach $key (@x){ + $excluded{$key} = 1; + } + }else{ + $excluded{23} = 1; # default PPP(23) if empty list - note (AIX seems to think PPP is 22 according to a post) + } + } + + # Excluded interface descriptors + if (defined $opt_n) { + my @unused = split(/,/,$opt_n); + if ( @unused ) { + foreach $key (@unused) { + $unused_names{$key} = 1; + } + } + } + + # Excluded interface ports (ifIndex) - management reasons + if ($opt_u) { + @unused_ports = split(/,/,$opt_u); + foreach $key (@unused_ports) { + $ifStatus{$key}{'notInUse'}++ ; + } + } + + if (! utils::is_hostname($hostname)){ + usage("Hostname invalid or not given"); + exit $ERRORS{"UNKNOWN"}; + } + + + if ($snmp_version !~ /[123]/) { + $state='UNKNOWN'; + print ("$state: No support for SNMP v$snmp_version yet\n"); + exit $ERRORS{$state}; + } + +return $ERRORS{"OK"}; +} diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl new file mode 100755 index 0000000..4822fe6 --- /dev/null +++ b/plugins-scripts/check_ircd.pl @@ -0,0 +1,238 @@ +#!@PERL@ -w + +# ----------------------------------------------------------------------------- +# File Name: check_ircd.pl +# +# Author: Richard Mayhew - South Africa +# +# Date: 1999/09/20 +# +# +# Description: This script will check to see if an IRCD is running +# about how many users it has +# +# Email: netsaint@splash.co.za +# +# ----------------------------------------------------------------------------- +# Copyright 1999 (c) Richard Mayhew +# +# If any changes are made to this script, please mail me a copy of the +# changes :) +# +# Some code taken from Charlie Cook (check_disk.pl) +# +# License GPL +# +# ----------------------------------------------------------------------------- +# Date Author Reason +# ---- ------ ------ +# +# 1999/09/20 RM Creation +# +# 1999/09/20 TP Changed script to use strict, more secure by +# specifying $ENV variables. The bind command is +# still insecure through. Did most of my work +# with perl -wT and 'use strict' +# +# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com) +# 2002/05/02 SG Fixed for Embedded Perl +# + +# ----------------------------------------------------------------[ Require ]-- + +require 5.004; + +# -------------------------------------------------------------------[ Uses ]-- + +use Socket; +use strict; +use Getopt::Long; +use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); +use vars qw($PROGNAME); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); + +# ----------------------------------------------------[ Function Prototypes ]-- + +sub print_help (); +sub print_usage (); +sub connection ($$$$); +sub bindRemote ($$); + +# -------------------------------------------------------------[ Environment ]-- + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +# -----------------------------------------------------------------[ Global ]-- + +$PROGNAME = "check_ircd"; +# nickname shouldn't be longer than 9 chars, this might happen with large PIDs +# To prevent this, we cut of the part over 10000 +my $NICK="ircd" . $$ % 10000; +my $USER_INFO="monitor localhost localhost : "; + +# -------------------------------------------------------------[ connection ]-- +sub connection ($$$$) +{ + my ($in_remotehost,$in_users,$in_warn,$in_crit) = @_; + my $state; + my $answer; + + print "connection(debug): users = $in_users\n" if $verbose; + $in_users =~ s/\ //g; + + if ($in_users >= 0) { + + if ($in_users > $in_crit) { + $state = "CRITICAL"; + $answer = "Critical Number Of Clients Connected : $in_users (Limit = $in_crit)\n"; + + } elsif ($in_users > $in_warn) { + $state = "WARNING"; + $answer = "Warning Number Of Clients Connected : $in_users (Limit = $in_warn)\n"; + + } else { + $state = "OK"; + $answer = "IRCD ok - Current Local Users: $in_users\n"; + } + + } else { + $state = "UNKNOWN"; + $answer = "Server $in_remotehost has less than 0 users! Something is Really WRONG!\n"; + } + + print ClientSocket "quit\n"; + print $answer; + exit $ERRORS{$state}; +} + +# ------------------------------------------------------------[ print_usage ]-- + +sub print_usage () { + print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>]\n"; +} + +# -------------------------------------------------------------[ print_help ]-- + +sub print_help () +{ + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop + +Perl Check IRCD plugin for monitoring + +"; + print_usage(); + print " +-H, --hostname=HOST + Name or IP address of host to check +-w, --warning=INTEGER + Number of connected users which generates a warning state (Default: 50) +-c, --critical=INTEGER + Number of connected users which generates a critical state (Default: 100) +-p, --port=INTEGER + Port that the ircd daemon is running on <host> (Default: 6667) +-v, --verbose + Print extra debugging information +"; +} + +# -------------------------------------------------------------[ bindRemote ]-- + +sub bindRemote ($$) +{ + my ($in_remotehost, $in_remoteport) = @_; + my $proto = getprotobyname('tcp'); + my $that; + my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost); + + if (!socket(ClientSocket,AF_INET, SOCK_STREAM, $proto)) { + print "IRCD UNKNOWN: Could not start socket ($!)\n"; + exit $ERRORS{"UNKNOWN"}; + } + $that = pack_sockaddr_in ($in_remoteport, $thataddr); + if (!connect(ClientSocket, $that)) { + print "IRCD UNKNOWN: Could not connect socket ($!)\n"; + exit $ERRORS{"UNKNOWN"}; + } + select(ClientSocket); $| = 1; select(STDOUT); + return \*ClientSocket; +} + +# ===================================================================[ MAIN ]== + +MAIN: +{ + my $hostname; + + Getopt::Long::Configure('bundling'); + GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "v" => \$verbose,"verbose" => \$verbose, + "t=i" => \$opt_t, "timeout=i" => \$opt_t, + "w=i" => \$opt_w, "warning=i" => \$opt_w, + "c=i" => \$opt_c, "critical=i" => \$opt_c, + "p=i" => \$opt_p, "port=i" => \$opt_p, + "H=s" => \$opt_H, "hostname=s" => \$opt_H); + + if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} + + ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n"); + my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); + ($remotehost) || usage("Invalid host: $opt_H\n"); + + ($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50); + my $warn = $1 if ($opt_w =~ /^([0-9]+)$/); + ($warn) || usage("Invalid warning threshold: $opt_w\n"); + + ($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 100); + my $crit = $1 if ($opt_c =~ /^([0-9]+)$/); + ($crit) || usage("Invalid critical threshold: $opt_c\n"); + + ($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = 6667); + my $remoteport = $1 if ($opt_p =~ /^([0-9]+)$/); + ($remoteport) || usage("Invalid port: $opt_p\n"); + + if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } + + # Just in case of problems, let's not hang the monitoring system + $SIG{'ALRM'} = sub { + print "Something is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; + exit $ERRORS{"UNKNOWN"}; + }; + + alarm($TIMEOUT); + + my ($name, $alias, $proto) = getprotobyname('tcp'); + + print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose; + my $ClientSocket = &bindRemote($remotehost,$remoteport); + + print ClientSocket "NICK $NICK\nUSER $USER_INFO\n"; + + while (<ClientSocket>) { + print "MAIN(debug): default var = $_\n" if $verbose; + + # DALnet,LagNet,UnderNet etc. Require this! + # Replies with a PONG when presented with a PING query. + # If a server doesn't require it, it will be ignored. + + if (m/^PING (.*)/) {print ClientSocket "PONG $1\n";} + + alarm(0); + + # Look for pattern in IRCD Output to gather Client Connections total. + connection($remotehost,$1,$warn,$crit) if (m/:I have\s+(\d+)/); + } + print "IRCD UNKNOWN: Unknown error - maybe could not authenticate\n"; + exit $ERRORS{"UNKNOWN"}; +} diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh new file mode 100755 index 0000000..8ecdd31 --- /dev/null +++ b/plugins-scripts/check_log.sh @@ -0,0 +1,244 @@ +#!/bin/sh +# +# Log file pattern detector plugin for monitoring +# Written originally by Ethan Galstad (nagios@nagios.org) +# +# Usage: ./check_log <log_file> <old_log_file> <pattern> +# +# Description: +# +# This plugin will scan a log file (specified by the <log_file> option) +# for a specific pattern (specified by the <pattern> option). Successive +# calls to the plugin script will only report *new* pattern matches in the +# log file, since an copy of the log file from the previous run is saved +# to <old_log_file>. +# +# Output: +# +# On the first run of the plugin, it will return an OK state with a message +# of "Log check data initialized". On successive runs, it will return an OK +# state if *no* pattern matches have been found in the *difference* between the +# log file and the older copy of the log file. If the plugin detects any +# pattern matches in the log diff, it will return a CRITICAL state and print +# out a message is the following format: "(x) last_match", where "x" is the +# total number of pattern matches found in the file and "last_match" is the +# last entry in the log file which matches the pattern. +# +# Notes: +# +# If you use this plugin make sure to keep the following in mind: +# +# 1. The "max_attempts" value for the service should be 1, as this will +# prevent the monitoring system from retrying the service check (the +# next time the check is run it will not produce the same results). +# +# 2. The "notify_recovery" value for the service should be 0, so that the +# monitoring system does not notify you of "recoveries" for the check. +# Since pattern matches in the log file will only be reported once and +# not the next time, there will always be "recoveries" for the service, +# even though recoveries really don't apply to this type of check. +# +# 3. You *must* supply a different <old_file_log> for each service that +# you define to use this plugin script - even if the different services +# check the same <log_file> for pattern matches. This is necessary +# because of the way the script operates. +# +# 4. This plugin does NOT have an understanding of logrotation or similar +# mechanisms. Therefore bad timing could lead to missing events +# +# +# Examples: +# +# Check for login failures in the syslog... +# +# check_log /var/log/messages ./check_log.badlogins.old "LOGIN FAILURE" +# +# Check for port scan alerts generated by Psionic's PortSentry software... +# +# check_log /var/log/message ./check_log.portscan.old "attackalert" +# + +# Paths to commands used in this script. These +# may have to be modified to match your system setup. + +PATH="@TRUSTED_PATH@" +export PATH +PROGNAME=$(basename "$0") +PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,') +REVISION="@NP_VERSION@" + +. "$PROGPATH"/utils.sh + +print_usage() { + echo "Usage: $PROGNAME -F logfile -O oldlog -q query" + echo "Usage: $PROGNAME --help" + echo "Usage: $PROGNAME --version" + echo "" + echo "Other parameters:" + echo " -a|--all : Print all matching lines" + echo " --exclude: Exclude a pattern (-p or -e also applies here when used)" + echo " -p|--perl-regex : Use perl style regular expressions in the query" + echo " -e|--extended-regex : Use extended style regular expressions in the query (not necessary for GNU grep)" +} + +print_help() { + print_revision "$PROGNAME" "$REVISION" + echo "" + print_usage + echo "" + echo "Log file pattern detector plugin for monitoring" + echo "" + support +} + +# Make sure the correct number of command line +# arguments have been supplied + +if [ $# -lt 1 ]; then + print_usage + exit "$STATE_UNKNOWN" +fi + +# Grab the command line arguments +exitstatus=$STATE_WARNING #default +while test -n "$1"; do + case "$1" in + -h | --help) + print_help + exit "$STATE_UNKNOWN" + ;; + -V | --version) + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; + -F | --filename) + logfile=$2 + shift 2 + ;; + -O | --oldlog) + oldlog=$2 + shift 2 + ;; + -q | --query) + query=$2 + shift 2 + ;; + --exclude) + exclude=$2 + shift 2 + ;; + -x | --exitstatus) + exitstatus=$2 + shift 2 + ;; + -e | --extended-regex) + ERE=1 + shift + ;; + -p | --perl-regex) + PRE=1 + shift + ;; + -a | --all) + ALL=1 + shift + ;; + *) + echo "Unknown argument: $1" + print_usage + exit "$STATE_UNKNOWN" + ;; + esac +done + +# Parameter sanity check +if [ $ERE ] && [ $PRE ] ; then + echo "Can not use extended and perl regex at the same time" + exit "$STATE_UNKNOWN" +fi + +GREP="grep" + +if [ $ERE ]; then + GREP="grep -E" +fi + +if [ $PRE ]; then + GREP="grep -P" +fi + +# If the source log file doesn't exist, exit + +if [ ! -e "$logfile" ]; then + echo "Log check error: Log file $logfile does not exist!" + exit "$STATE_UNKNOWN" +elif [ ! -r "$logfile" ] ; then + echo "Log check error: Log file $logfile is not readable!" + exit "$STATE_UNKNOWN" +fi +# If no oldlog was given this can not work properly, abort then +if [ -z "$oldlog" ]; then + echo "Oldlog parameter is needed" + exit $STATE_UNKNOWN +fi + +# If the old log file doesn't exist, this must be the first time +# we're running this test, so copy the original log file over to +# the old diff file and exit + +if [ ! -e "$oldlog" ]; then + cat "$logfile" > "$oldlog" + echo "Log check data initialized..." + exit "$STATE_OK" +fi + +# The old log file exists, so compare it to the original log now + +# The temporary file that the script should use while +# processing the log file. +if [ -x /bin/mktemp ]; then + + tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX) +else + tempdiff=$(/bin/date '+%H%M%S') + tempdiff="/tmp/check_log.${tempdiff}" + touch "$tempdiff" + chmod 600 "$tempdiff" +fi + +diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff" + + +if [ $ALL ]; then + # Get all matching entries in the diff file + if [ -n "$exclude" ]; then + entry=$($GREP "$query" "$tempdiff" | $GREP -v "$exclude") + count=$($GREP "$query" "$tempdiff" | $GREP -vc "$exclude") + else + entry=$($GREP "$query" "$tempdiff") + count=$($GREP -c "$query" "$tempdiff") + fi + +else + # Get the last matching entry in the diff file + if [ -n "$exclude" ]; then + entry=$($GREP "$query" "$tempdiff" | $GREP -v "$exclude" | tail -1) + count=$($GREP "$query" "$tempdiff" | $GREP -vc "$exclude") + else + entry=$($GREP "$query" "$tempdiff" | tail -1) + count=$($GREP -c "$query" "$tempdiff") + fi +fi + +rm -f "$tempdiff" +cat "$logfile" > "$oldlog" + +if [ "$count" = "0" ]; then # no matches, exit with no error + echo "Log check ok - 0 pattern matches found" + exitstatus=$STATE_OK +else # Print total match count and the last entry we found + echo "($count) $entry" + exitstatus=$STATE_CRITICAL +fi + +exit "$exitstatus" diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl new file mode 100755 index 0000000..49156af --- /dev/null +++ b/plugins-scripts/check_mailq.pl @@ -0,0 +1,719 @@ +#!@PERL@ -w + +# check_mailq - check to see how many messages are in the smtp queue awating +# transmittal. +# +# Initial version support sendmail's mailq command +# Support for multiple sendmail queues (Carlos Canau) +# Support for qmail (Benjamin Schmid) + +# License Information: +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA +# +############################################################################ + +use POSIX; +use strict; +use Getopt::Long; +use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t $opt_s $opt_d + $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq $mailq_args + @lines %srcdomains %dstdomains); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw(%ERRORS &print_revision &support &usage ); + +my ($sudo); + +sub print_help (); +sub print_usage (); +sub process_arguments (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$PROGNAME = "check_mailq"; +$mailq = 'sendmail'; # default +$msg_q = 0 ; +$msg_p = 0 ; +# If appended, must start with a space +$mailq_args = '' ; +$state = $ERRORS{'UNKNOWN'}; + +Getopt::Long::Configure('bundling'); +$status = process_arguments(); +if ($status){ + print "ERROR: processing arguments\n"; + exit $ERRORS{"UNKNOWN"}; +} + +if ($opt_s) { + if (defined $utils::PATH_TO_SUDO && -x $utils::PATH_TO_SUDO) { + $sudo = $utils::PATH_TO_SUDO; + } else { + print "ERROR: Cannot execute sudo\n"; + exit $ERRORS{'UNKNOWN'}; + } +} else { + $sudo = ""; +} + +if ($opt_d) { + $mailq_args = $mailq_args . ' -C ' . $opt_d; +} + +$SIG{'ALRM'} = sub { + print ("ERROR: timed out waiting for $utils::PATH_TO_MAILQ \n"); + exit $ERRORS{"WARNING"}; +}; +alarm($opt_t); + +# switch based on MTA + +if ($mailq eq "sendmail") { + + ## open mailq + if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { + if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { + print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; + exit $ERRORS{'UNKNOWN'}; + } + }elsif( defined $utils::PATH_TO_MAILQ){ + unless (-x $utils::PATH_TO_MAILQ) { + print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; + exit $ERRORS{'UNKNOWN'}; + } + } else { + print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; + exit $ERRORS{'UNKNOWN'}; + } +# single queue empty +##/var/spool/mqueue is empty +# single queue: 1 +## /var/spool/mqueue (1 request) +##----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------ +##h32E30p01763 2782 Wed Apr 2 15:03 <silvaATkpnqwest.pt> +## 8BITMIME +## <silvaATeunet.pt> + +# multi queue empty +##/var/spool/mqueue/q0/df is empty +##/var/spool/mqueue/q1/df is empty +##/var/spool/mqueue/q2/df is empty +##/var/spool/mqueue/q3/df is empty +##/var/spool/mqueue/q4/df is empty +##/var/spool/mqueue/q5/df is empty +##/var/spool/mqueue/q6/df is empty +##/var/spool/mqueue/q7/df is empty +##/var/spool/mqueue/q8/df is empty +##/var/spool/mqueue/q9/df is empty +##/var/spool/mqueue/qA/df is empty +##/var/spool/mqueue/qB/df is empty +##/var/spool/mqueue/qC/df is empty +##/var/spool/mqueue/qD/df is empty +##/var/spool/mqueue/qE/df is empty +##/var/spool/mqueue/qF/df is empty +## Total Requests: 0 +# multi queue: 1 +##/var/spool/mqueue/q0/df is empty +##/var/spool/mqueue/q1/df is empty +##/var/spool/mqueue/q2/df is empty +## /var/spool/mqueue/q3/df (1 request) +##----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------ +##h32De2f23534* 48 Wed Apr 2 14:40 nocol +## nouserATEUnet.pt +## canau +##/var/spool/mqueue/q4/df is empty +##/var/spool/mqueue/q5/df is empty +##/var/spool/mqueue/q6/df is empty +##/var/spool/mqueue/q7/df is empty +##/var/spool/mqueue/q8/df is empty +##/var/spool/mqueue/q9/df is empty +##/var/spool/mqueue/qA/df is empty +##/var/spool/mqueue/qB/df is empty +##/var/spool/mqueue/qC/df is empty +##/var/spool/mqueue/qD/df is empty +##/var/spool/mqueue/qE/df is empty +##/var/spool/mqueue/qF/df is empty +## Total Requests: 1 + +# separate submission/transport queues, empty +## MSP Queue status... +## /var/spool/mqueue-client is empty +## Total requests: 0 +## MTA Queue status... +## /var/spool/mqueue is empty +## Total requests: 0 +# separate submission/transport queues: 1 +## MSP Queue status... +## /var/spool/mqueue-client (1 request) +## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- +## oAJEfhdW014123 5 Fri Nov 19 14:41 jwm +## (Deferred: Connection refused by [127.0.0.1]) +## root +## Total requests: 1 +## MTA Queue status... +## /var/spool/mqueue is empty +## Total requests: 0 + + my $this_msg_q = 0; + while (<MAILQ>) { + + # match email addr on queue listing + if ( (/<.*@.*\.(\w+\.\w+)>/) || (/<.*@(\w+\.\w+)>/) ) { + my $domain = $1; + if (/^\w+/) { + print "$utils::PATH_TO_MAILQ = srcdomain = $domain \n" if $verbose ; + $srcdomains{$domain} ++; + } + next; + } + + # + # ... + # sendmail considers a message with more than one destiny, say N, to the same MX + # to have N messages in queue. + # we will only consider one in this code + if (( /\s\(reply:\sread\serror\sfrom\s.*\.(\w+\.\w+)\.$/ ) || ( /\s\(reply:\sread\serror\sfrom\s(\w+\.\w+)\.$/ ) || + ( /\s\(timeout\swriting\smessage\sto\s.*\.(\w+\.\w+)\.:/ ) || ( /\s\(timeout\swriting\smessage\sto\s(\w+\.\w+)\.:/ ) || + ( /\s\(host\smap:\slookup\s\(.*\.(\w+\.\w+)\):/ ) || ( /\s\(host\smap:\slookup\s\((\w+\.\w+)\):/ ) || + ( /\s\(Deferred:\s.*\s.*\.(\w+\.\w+)\.\)/ ) || ( /\s\(Deferred:\s.*\s(\w+\.\w+)\.\)/ ) ) { + + print "$utils::PATH_TO_MAILQ = dstdomain = $1 \n" if $verbose ; + $dstdomains{$1} ++; + } + + if (/\s+\(I\/O\serror\)/) { + print "$utils::PATH_TO_MAILQ = dstdomain = UNKNOWN \n" if $verbose ; + $dstdomains{'UNKNOWN'} ++; + } + + # Finally look at the overall queue length + # + if (/mqueue/) { + print "$utils::PATH_TO_MAILQ = $_ "if $verbose ; + if (/ \((\d+) request/) { + # + # single queue: first line + # multi queue: one for each queue. overwrite on multi queue below + $this_msg_q = $1 ; + $msg_q += $1 ; + } + } elsif (/^\s+Total\sRequests:\s(\d+)$/i) { + if ($this_msg_q) { + $this_msg_q = 0 ; + } else { + print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ; + # + # multi queue: last line + $msg_q += $1 ; + } + } + + } + + + ## close mailq + + close (MAILQ); + + if ( $? ) { + print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/; + exit $ERRORS{CRITICAL}; + } + + ## shut off the alarm + alarm(0); + + + + ## now check the queue length(s) + + if ($msg_q == 0) { + $msg = "OK: $mailq mailq is empty"; + $state = $ERRORS{'OK'}; + } else { + print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; + + # overall queue length + if ($msg_q < $opt_w) { + $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $state = $ERRORS{'OK'}; + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; + $state = $ERRORS{'WARNING'}; + }else { + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; + $state = $ERRORS{'CRITICAL'}; + } + + # check for domain specific queue lengths if requested + if (defined $opt_W) { + + # Apply threshold to queue lengths FROM domain + my @srckeys = sort { $srcdomains{$b} <=> $srcdomains{$a} } keys %srcdomains; + my $srcmaxkey = $srckeys[0]; + print "src max is $srcmaxkey with $srcdomains{$srcmaxkey} messages\n" if $verbose; + + if ($srcdomains{$srcmaxkey} >= $opt_W && $srcdomains{$srcmaxkey} < $opt_C) { + if ($state == $ERRORS{'OK'}) { + $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'WARNING'}; + } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){ + $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)"; + } else { + $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'WARNING'}; + } + } elsif ($srcdomains{$srcmaxkey} >= $opt_C) { + if ($state == $ERRORS{'OK'}) { + $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C)"; + $state = $ERRORS{'CRITICAL'}; + } elsif ($state == $ERRORS{'WARNING'}) { + $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C) -and- " . $msg; + $msg =~ s/WARNING: //; + } elsif ($state == $ERRORS{'CRITICAL'}) { + $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)"; + } else { + $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'CRITICAL'}; + } + } else { + if ($srcdomains{$srcmaxkey} > 0) { + $msg .= " $srcdomains{$srcmaxkey} msgs. FROM $srcmaxkey is below threshold ($opt_W/$opt_C)"; + } + } + + # Apply threshold to queue lengths TO domain + my @dstkeys = sort { $dstdomains{$b} <=> $dstdomains{$a} } keys %dstdomains; + my $dstmaxkey = $dstkeys[0]; + print "dst max is $dstmaxkey with $dstdomains{$dstmaxkey} messages\n" if $verbose; + + if ($dstdomains{$dstmaxkey} >= $opt_W && $dstdomains{$dstmaxkey} < $opt_C) { + if ($state == $ERRORS{'OK'}) { + $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'WARNING'}; + } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){ + $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)"; + } else { + $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'WARNING'}; + } + } elsif ($dstdomains{$dstmaxkey} >= $opt_C) { + if ($state == $ERRORS{'OK'}) { + $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C)"; + $state = $ERRORS{'CRITICAL'}; + } elsif ($state == $ERRORS{'WARNING'}) { + $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C) -and- " . $msg; + $msg =~ s/WARNING: //; + } elsif ($state == $ERRORS{'CRITICAL'}) { + $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)"; + } else { + $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)"; + $state = $ERRORS{'CRITICAL'}; + } + } else { + if ($dstdomains{$dstmaxkey} > 0) { + $msg .= " $dstdomains{$dstmaxkey} msgs. TO $dstmaxkey is below threshold ($opt_W/$opt_C)"; + } + } + + } # End of queue length thresholds + + } + +} # end of ($mailq eq "sendmail") +elsif ( $mailq eq "postfix" ) { + + ## open mailq + if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { + if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args | " ) ) { + print "ERROR: could not open $utils::PATH_TO_MAILQ$mailq_args \n"; + exit $ERRORS{'UNKNOWN'}; + } + }elsif( defined $utils::PATH_TO_MAILQ){ + unless (-x $utils::PATH_TO_MAILQ) { + print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; + exit $ERRORS{'UNKNOWN'}; + } + } else { + print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; + exit $ERRORS{'UNKNOWN'}; + } + + + @lines = reverse <MAILQ>; + + # close qmail-qstat + close MAILQ; + + if ( $? ) { + print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ$mailq_args",$/; + exit $ERRORS{CRITICAL}; + } + + ## shut off the alarm + alarm(0); + + # check queue length + if ($lines[0]=~/Kbytes in (\d+)/) { + $msg_q = $1 ; + }elsif ($lines[0]=~/Mail queue is empty/) { + $msg_q = 0; + }else{ + print "Couldn't match $utils::PATH_TO_MAILQ$mailq_args output\n"; + exit $ERRORS{'UNKNOWN'}; + } + + # check messages not processed + #if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) { + # my $msg_p = $1; + #}else{ + # print "Couldn't match $utils::PATH_TO_MAILQ output\n"; + # exit $ERRORS{'UNKNOWN'}; + #} + + # check queue length(s) + if ($msg_q == 0){ + $msg = "OK: $mailq mailq reports queue is empty"; + $state = $ERRORS{'OK'}; + } else { + print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; + + # overall queue length + if ($msg_q < $opt_w) { + $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $state = $ERRORS{'OK'}; + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; + $state = $ERRORS{'WARNING'}; + }else { + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; + $state = $ERRORS{'CRITICAL'}; + } + + # check messages not yet preprocessed (only compare is $opt_W and $opt_C + # are defined) + + #if (defined $opt_W) { + # $msg .= "[Preprocessed = $msg_p]"; + # if ($msg_p >= $opt_W && $msg_p < $opt_C ) { + # $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ; + # }elsif ($msg_p >= $opt_C ) { + # $state = $ERRORS{"CRITICAL"} ; + # } + #} + } +} # end of ($mailq eq "postfix") +elsif ( $mailq eq "qmail" ) { + + # open qmail-qstat + if ( defined $utils::PATH_TO_QMAIL_QSTAT && -x $utils::PATH_TO_QMAIL_QSTAT ) { + if (! open (MAILQ, "$sudo $utils::PATH_TO_QMAIL_QSTAT | " ) ) { + print "ERROR: could not open $utils::PATH_TO_QMAIL_QSTAT \n"; + exit $ERRORS{'UNKNOWN'}; + } + }elsif( defined $utils::PATH_TO_QMAIL_QSTAT){ + unless (-x $utils::PATH_TO_QMAIL_QSTAT) { + print "ERROR: $utils::PATH_TO_QMAIL_QSTAT is not executable by (uid $>:gid($)))\n"; + exit $ERRORS{'UNKNOWN'}; + } + } else { + print "ERROR: \$utils::PATH_TO_QMAIL_QSTAT is not defined\n"; + exit $ERRORS{'UNKNOWN'}; + } + + @lines = <MAILQ>; + + # close qmail-qstat + close MAILQ; + + if ( $? ) { + print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/; + exit $ERRORS{CRITICAL}; + } + + ## shut off the alarm + alarm(0); + + # check queue length + if ($lines[0]=~/^messages in queue: (\d+)/) { + $msg_q = $1 ; + }else{ + print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n"; + exit $ERRORS{'UNKNOWN'}; + } + + # check messages not processed + if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) { + my $msg_p = $1; + }else{ + print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n"; + exit $ERRORS{'UNKNOWN'}; + } + + + # check queue length(s) + if ($msg_q == 0){ + $msg = "OK: qmail-qstat reports queue is empty"; + $state = $ERRORS{'OK'}; + } else { + print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; + + # overall queue length + if ($msg_q < $opt_w) { + $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $state = $ERRORS{'OK'}; + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; + $state = $ERRORS{'WARNING'}; + }else { + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; + $state = $ERRORS{'CRITICAL'}; + } + + # check messages not yet preprocessed (only compare is $opt_W and $opt_C + # are defined) + + if (defined $opt_W) { + $msg .= "[Preprocessed = $msg_p]"; + if ($msg_p >= $opt_W && $msg_p < $opt_C ) { + $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ; + }elsif ($msg_p >= $opt_C ) { + $state = $ERRORS{"CRITICAL"} ; + } + } + } + + + +} # end of ($mailq eq "qmail") +elsif ( $mailq eq "exim" ) { + ## open mailq + if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { + if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { + print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; + exit $ERRORS{'UNKNOWN'}; + } + }elsif( defined $utils::PATH_TO_MAILQ){ + unless (-x $utils::PATH_TO_MAILQ) { + print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; + exit $ERRORS{'UNKNOWN'}; + } + } else { + print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; + exit $ERRORS{'UNKNOWN'}; + } + + while (<MAILQ>) { + #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen *** + #root@exlixams.glups.fr + + if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy + $msg_q++ ; + } + } + close(MAILQ) ; + + if ( $? ) { + print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/; + exit $ERRORS{CRITICAL}; + } + if ($msg_q < $opt_w) { + $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $state = $ERRORS{'OK'}; + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; + $state = $ERRORS{'WARNING'}; + }else { + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; + $state = $ERRORS{'CRITICAL'}; + } +} # end of ($mailq eq "exim") + +elsif ( $mailq eq "nullmailer" ) { + ## open mailq + if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { + if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { + print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; + exit $ERRORS{'UNKNOWN'}; + } + }elsif( defined $utils::PATH_TO_MAILQ){ + unless (-x $utils::PATH_TO_MAILQ) { + print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; + exit $ERRORS{'UNKNOWN'}; + } + } else { + print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; + exit $ERRORS{'UNKNOWN'}; + } + + while (<MAILQ>) { + #2022-08-25 01:30:40 502 bytes from <user@example.com> + + if (/^\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+\d+\sbytes/) { + $msg_q++ ; + } + } + close(MAILQ) ; + if ($msg_q < $opt_w) { + $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $state = $ERRORS{'OK'}; + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; + $state = $ERRORS{'WARNING'}; + }else { + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; + $state = $ERRORS{'CRITICAL'}; + } +} # end of ($mailq eq "nullmailer") + +# Perfdata support +print "$msg|unsent=$msg_q;$opt_w;$opt_c;0\n"; +exit $state; + + +##################################### +#### subs + + +sub process_arguments(){ + GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "v" => \$opt_v, "verbose" => \$opt_v, + "h" => \$opt_h, "help" => \$opt_h, + "M:s" => \$opt_M, "mailserver:s" => \$opt_M, # mailserver (default sendmail) + "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number + "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number + "W=i" => \$opt_W, "warning-domain=i" => \$opt_W, # Warning if above this number + "C=i" => \$opt_C, "critical-domain=i" => \$opt_C, # Critical if above this number + "t=i" => \$opt_t, "timeout=i" => \$opt_t, + "s" => \$opt_s, "sudo" => \$opt_s, + "d:s" => \$opt_d, "configdir:s" => \$opt_d, + ); + + if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + if (defined $opt_v ){ + $verbose = $opt_v; + } + + unless (defined $opt_t) { + $opt_t = $utils::TIMEOUT ; # default timeout + } + + unless ( defined $opt_w && defined $opt_c ) { + print_usage(); + exit $ERRORS{'UNKNOWN'}; + } + + if ( $opt_w >= $opt_c) { + print "Warning (-w) cannot be greater than Critical (-c)!\n"; + exit $ERRORS{'UNKNOWN'}; + } + + if (defined $opt_W && ! defined !$opt_C) { + print "Need -C if using -W\n"; + exit $ERRORS{'UNKNOWN'}; + }elsif(defined $opt_W && defined $opt_C) { + if ($opt_W >= $opt_C) { + print "Warning (-W) cannot be greater than Critical (-C)!\n"; + exit $ERRORS{'UNKNOWN'}; + } + } + + if (defined $opt_M) { + if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) { + $mailq = $opt_M ; + }elsif( $opt_M eq ''){ + $mailq = 'sendmail'; + }else{ + print "-M: $opt_M is not supported\n"; + exit $ERRORS{'UNKNOWN'}; + } + }else{ + if (defined $utils::PATH_TO_QMAIL_QSTAT + && -x $utils::PATH_TO_QMAIL_QSTAT) + { + $mailq = 'qmail'; + } + elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix' + || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix') + { + $mailq = 'postfix'; + } + elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4' + || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim') + { + $mailq = 'exim'; + } + elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer' + || -e '/usr/sbin/nullmailer-send' + || -e '/usr/local/sbin/nullmailer-send') + { + $mailq = 'nullmailer'; + } + else { + $mailq = 'sendmail'; + } + } + + return $ERRORS{'OK'}; +} + +sub print_usage () { + print "Usage: $PROGNAME -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-s] [-d <CONFIGDIR>] [-v]\n"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n"; + print "\n"; + print_usage(); + print "\n"; + print " Checks the number of messages in the mail queue (supports multiple sendmail queues, qmail)\n"; + print " Feedback/patches to support non-sendmail mailqueue welcome\n\n"; + print "-w (--warning) = Min. number of messages in queue to generate warning\n"; + print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; + print "-W (--warning-domain) = Min. number of messages for same domain in queue to generate warning\n"; + print "-C (--critical-domain) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; + print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; + print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n"; + print "-s (--sudo) = Use sudo to call the mailq command\n"; + print "-d (--configdir) = Config file or directory\n"; + print "-h (--help)\n"; + print "-V (--version)\n"; + print "-v (--verbose) = debugging output\n"; + print "\n\n"; + print "Note: -w and -c are required arguments. -W and -C are optional.\n"; + print " -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail)\n"; + print " -W and -C are applied message not yet preproccessed. (qmail)\n"; + print " This plugin tries to autodetect which mailserver you are running,\n"; + print " you can override the autodetection with -M.\n"; + print " This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)\n"; + print " to look at the queues. Mailq can usually only be accessed by root or \n"; + print " a TrustedUser. You will have to set appropriate permissions for the plugin to work.\n"; + print ""; + print "\n\n"; + support(); +} diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl new file mode 100755 index 0000000..bf3a651 --- /dev/null +++ b/plugins-scripts/check_mssql.pl @@ -0,0 +1,145 @@ +#!@PERL@ -w + +# +# Copyright 2003 Roy Sigurd Karlsbakk +# +# Requires freetds and DBD::Sybase +# http://www.freetds.org +# http://www.mbay.net/~mpeppler/ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. +# +# Report bugs to: help@monitoring-plugins.org +# +# + + +use DBI; +use DBD::Sybase; +use Getopt::Long; +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); +use strict; + +my $PROGNAME = "check_mssql"; + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; + +my ( + $server,$database,$username,$password,$query,$help,$verbose,$timeout, + $dbh,$sth,$row, + $s,$opt_V,$regex +); +my $exitcode = $ERRORS{'OK'}; + +process_arguments(); + +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n"); + exit $ERRORS{"UNKNOWN"}; +}; +alarm($timeout); + +unless ($dbh = DBI->connect("dbi:Sybase:server=".uc($server), "$username", "$password")) { + printf "SQL CRITICAL: Can't connect to mssql server $DBI::errstr\n"; + exit($ERRORS{'CRITICAL'}); +} + +if (defined $database) { # otherwise use default database + unless ($dbh->do("use $database")) { + printf ("SQL CRITICAL: Can't 'use $database': $dbh->errstr"); + exit($ERRORS{'CRITICAL'}); + } +} +$sth = $dbh->prepare($query); +unless ($sth->execute()) { + printf("SQL CRITICAL: Error in query: $dbh->errstr\n"); + exit($ERRORS{'CRITICAL'}); +} + +$row = join(";",$sth->fetchrow_array); + +$sth->finish; +$dbh->disconnect; + +alarm(0); +if (defined $regex) { + if ($row =~ /$regex/) { + printf "SQL CRITICAL: - $row|$row\n"; + exit $ERRORS{'CRITICAL'}; + }else{ + print "SQL OK: $row|$row\n"; + exit $ERRORS{'OK'}; + } +} + +print "SQL OK: $row|$row\n"; +exit $ERRORS{'OK'}; + +################################################## + +sub syntax { + $s = shift or $s = 'Unknown'; + printf("Error: ($s)\n") unless ($help); + printf("Runs a query against a MS-SQL server or Sybase server and returns the first row\n"); + printf("Returns an error if no responses are running. Row is passed to perfdata in\n"); + printf("semicolon delimited format\n"); + printf("A simple sql statement like \"select getdate()\" verifies server responsiveness\n\n"); + printf("Syntax: %s -s <server> -d <database> -u <username> -p <password> -q <query> [-v]\n", $PROGNAME); + printf(" --database -d Database name\n"); + printf(" --Hostname -H Server name\n"); + printf(" --username -u Username\n"); + printf(" --password -p Password\n"); + printf(" --query -q SQL query to run\n"); + printf(" --timeout -t Plugin timeout (default:$TIMEOUT)\n"); + printf(" --regex -r regex against SQL response(CRIT if MATCH)\n"); + printf(" --verbose -v verbose\n"); + printf("\nThe SQL response is concatenated into a string with a \";\" demarkation\n\n"); + exit($ERRORS{'UNKNOWN'}); +} + +sub process_arguments { + Getopt::Long::Configure('bundling'); + my $status = GetOptions + ("p=s" => \$password, "password=s" => \$password, + "u=s" => \$username, "username=s" => \$username, + "H=s" => \$server, "Hostname=s" => \$server, + "d=s" => \$database, "database=s" => \$database, + "q=s" => \$query, "query=s" => \$query, + "t=i" => \$timeout, "timeout=i" => \$timeout, + "r=s" => \$regex, "regex=s" => \$regex, + "h" => \$help, "help" => \$help, + "v" => \$verbose, "verbose" => \$verbose, + "V" => \$opt_V, "version" => \$opt_V); + + if (defined $opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + syntax("Help:") if ($help); + syntax("Missing username") unless (defined($username)); + syntax("Missing password") unless (defined($password)); + syntax("Missing server") unless (defined($server)); + syntax("Missing query string") unless (defined($query)); + $timeout = $TIMEOUT unless (defined($timeout)); + + return; + +} diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh new file mode 100755 index 0000000..5998138 --- /dev/null +++ b/plugins-scripts/check_oracle.sh @@ -0,0 +1,304 @@ +#!/bin/sh +# +# latigid010@yahoo.com +# 01/06/2000 +# +# This Monitoring plugin was created to check Oracle status +# + +PATH="@TRUSTED_PATH@" +export PATH +PROGNAME=$(basename "$0") +PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,') +REVISION="@NP_VERSION@" + +. "$PROGPATH"/utils.sh + + +print_usage() { + echo "Usage:" + echo " $PROGNAME --tns <Oracle Sid or Hostname/IP address>" + echo " $PROGNAME --db <ORACLE_SID>" + echo " $PROGNAME --login <ORACLE_SID>" + echo " $PROGNAME --connect <ORACLE_SID>" + echo " $PROGNAME --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING>" + echo " $PROGNAME --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>" + echo " $PROGNAME --oranames <Hostname>" + echo " $PROGNAME --help" + echo " $PROGNAME --version" +} + +print_help() { + print_revision "$PROGNAME" "$REVISION" + echo "" + print_usage + echo "" + echo "Check Oracle status" + echo "" + echo "--tns SID/IP Address" + echo " Check remote TNS server" + echo "--db SID" + echo " Check local database (search /bin/ps for PMON process) and check" + echo " filesystem for sgadefORACLE_SID.dbf" + echo "--login SID" + echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password" + echo "--connect SID" + echo " Attempt a login and alert if an ORA- error is returned" + echo "--cache" + echo " Check local database for library and buffer cache hit ratios" + echo " ---> Requires Oracle user/password and SID specified." + echo " ---> Requires select on v_$sysstat and v_$librarycache" + echo "--tablespace" + echo " Check local database for tablespace capacity in ORACLE_SID" + echo " ---> Requires Oracle user/password specified." + echo " ---> Requires select on dba_data_files and dba_free_space" + echo "--oranames Hostname" + echo " Check remote Oracle Names server" + echo "--help" + echo " Print this help screen" + echo "--version" + echo " Print version and license information" + echo "" + echo "If the plugin doesn't work, check that the ORACLE_HOME environment" + echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the" + echo "tnsnames.ora file is locatable and is properly configured." + echo "" + echo "When checking local database status your ORACLE_SID is case sensitive." + echo "" + echo "If you want to use a default Oracle home, add in your oratab file:" + echo "*:/opt/app/oracle/product/7.3.4:N" + echo "" + support +} + +case "$1" in +1) + cmd='--tns' + ;; +2) + cmd='--db' + ;; +*) + cmd="$1" + ;; +esac + +# Information options +case "$cmd" in +--help) + print_help + exit "$STATE_UNKNOWN" + ;; +-h) + print_help + exit "$STATE_UNKNOWN" + ;; +--version) + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; +-V) + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; +esac + +# Hunt down a reasonable ORACLE_HOME +if [ -z "$ORACLE_HOME" ] ; then + # Adjust to taste + for oratab in /var/opt/oracle/oratab /etc/oratab + do + [ ! -f $oratab ] && continue + ORACLE_HOME=`IFS=: + while read -r SID ORACLE_HOME junk; + do + if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then + echo "$ORACLE_HOME"; + exit; + fi; + done < $oratab` + [ -n "$ORACLE_HOME" ] && break + done +fi +# Last resort +[ -z "$ORACLE_HOME" ] && [ -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle + +if [ "$cmd" != "--db" ]; then + if [ -z "$ORACLE_HOME" ] || [ ! -d "$ORACLE_HOME" ] ; then + echo "Cannot determine ORACLE_HOME for sid $2" + exit "$STATE_UNKNOWN" + fi +fi +PATH=$PATH:$ORACLE_HOME/bin +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib +export ORACLE_HOME PATH LD_LIBRARY_PATH + +case "$cmd" in +--tns) + tnschk=$(tnsping "$2") + tnschk2=$(echo "$tnschk" | grep -c OK) + if [ "${tnschk2}" -eq 1 ] ; then + tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*} + echo "OK - reply time ${tnschk3} from $2" + exit "$STATE_OK" + else + echo "No TNS Listener on $2" + exit "$STATE_CRITICAL" + fi + ;; +--oranames) + namesctl status "$2" | awk ' + /Server has been running for:/ { + msg = "OK: Up" + for (i = 6; i <= NF; i++) { + msg = msg " " $i + } + status = '"$STATE_OK"' + } + /error/ { + msg = "CRITICAL: " $0 + status = '"$STATE_CRITICAL"' + } + END { + print msg + exit status + }' + ;; +--db) + pmonchk=$(pgrep -f "(asm|ora)_pmon_${2}$") + if [ "${pmonchk}" -ge 1 ] ; then + echo "${2} OK - ${pmonchk} PMON process(es) running" + exit "$STATE_OK" + #if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then + #if [ ${pmonchk} -eq 1 ] ; then + #utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55` + #echo "${2} OK - running since ${utime}" + #exit $STATE_OK + #fi + else + echo "${2} Database is DOWN" + exit "$STATE_CRITICAL" + fi + ;; +--login) + loginchk=$(sqlplus dummy/user@"$2" < /dev/null) + loginchk2=$(echo "$loginchk" | grep -c ORA-01017) + if [ "${loginchk2}" -eq 1 ] ; then + echo "OK - dummy login connected" + exit "$STATE_OK" + else + loginchk3=$(echo "$loginchk" | grep "ORA-" | head -1) + echo "CRITICAL - $loginchk3" + exit "$STATE_CRITICAL" + fi + ;; +--connect) + connectchk=$(sqlplus "$2" < /dev/null) + connectchk2=$(echo "$connectchk" | grep -c ORA-) + if [ "${connectchk2}" -eq 0 ] ; then + echo "OK - login successful" + exit "$STATE_OK" + else + connectchk3=$(echo "$connectchk" | grep "ORA-" | head -1) + echo "CRITICAL - $connectchk3" + exit "$STATE_CRITICAL" + fi + ;; +--cache) + if [ "${5}" -gt "${6}" ] ; then + echo "UNKNOWN - Warning level is less then Crit" + exit "$STATE_UNKNOWN" + fi + result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF +set pagesize 0 +set numf '9999999.99' +select (1-(pr.value/(dbg.value+cg.value)))*100 +from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg +where pr.name='physical reads' +and dbg.name='db block gets' +and cg.name='consistent gets'; +EOF` + + if echo "$result" | grep -q 'ORA-' ; then + error=$(echo "$result" | grep "ORA-" | head -1) + echo "CRITICAL - $error" + exit "$STATE_CRITICAL" + fi + + buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}') + buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}') + result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF +set pagesize 0 +set numf '9999999.99' +select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 +from v\\$librarycache lc; +EOF` + + if echo "$result" | grep -q 'ORA-' ; then + error=$(echo "$result" | grep "ORA-" | head -1) + echo "CRITICAL - $error" + exit "$STATE_CRITICAL" + fi + + lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}') + lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}') + + if [ "$buf_hr" -le "${5}" ] || [ "$lib_hr" -le "${5}" ] ; then + echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" + exit "$STATE_CRITICAL" + fi + if [ "$buf_hr" -le "${6}" ] || [ "$lib_hr" -le "${6}" ] ; then + echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" + exit "$STATE_WARNING" + fi + echo "${2} OK - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100" + + exit "$STATE_OK" + ;; +--tablespace) + if [ "${6}" -lt "${7}" ] ; then + echo "UNKNOWN - Warning level is more then Crit" + exit "$STATE_UNKNOWN" + fi + result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF +set pagesize 0 +set numf '9999999.99' +select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc +from ( +select tablespace_name,sum(bytes)/1024/1024 total +from dba_data_files group by tablespace_name) A +LEFT OUTER JOIN +( select tablespace_name,sum(bytes)/1024/1024 free +from dba_free_space group by tablespace_name) B +ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}'; +EOF` + + if echo "$result" | grep -q 'ORA-' ; then + error=$(echo "$result" | grep "ORA-" | head -1) + echo "CRITICAL - $error" + exit "$STATE_CRITICAL" + fi + + ts_free=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($1)}') + ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}') + ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}') + ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}') + if [ "$ts_free" -eq 0 ] && [ "$ts_total" -eq 0 ] && [ "$ts_pct" -eq 0 ] ; then + echo "No data returned by Oracle - tablespace $5 not found?" + exit "$STATE_UNKNOWN" + fi + if [ "$ts_pct" -ge "${6}" ] ; then + echo "${2} : ${5} CRITICAL - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" + exit "$STATE_CRITICAL" + fi + if [ "$ts_pct" -ge "${7}" ] ; then + echo "${2} : ${5} WARNING - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" + exit "$STATE_WARNING" + fi + echo "${2} : ${5} OK - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100" + exit "$STATE_OK" + ;; +*) + print_usage + exit "$STATE_UNKNOWN" +esac diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl new file mode 100755 index 0000000..8a56b9f --- /dev/null +++ b/plugins-scripts/check_rpc.pl @@ -0,0 +1,376 @@ +#!@PERL@ -w +# +# check_rpc plugin for monitoring +# +# usage: +# check_rpc host service +# +# Check if an rpc service is registered and running +# using rpcinfo - $proto $host $prognum 2>&1 |"; +# +# Use these hosts.cfg entries as examples +# +# command[check_nfs]=/some/path/libexec/check_rpc $HOSTADDRESS$ nfs +# service[check_nfs]=NFS;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_rpc +# +# initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop +# Modified May 2002 Subhendu Ghosh - support for ePN and patches +# +# Copyright Notice: GPL +# + +use strict; +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); +use vars qw($PROGNAME); +my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state); +my ($array_ref,$test,$element,@progkeys,$proto,$a,$b); +my ($opt_V,$opt_h,$opt_C,$opt_p,$opt_H,$opt_c,$opt_u,$opt_t); +my ($line, @progvers, $response2,$response3); +$opt_V = $opt_h = $opt_C = $opt_p = $opt_H = $opt_u = $opt_t =''; +$state = 'UNKNOWN'; +$progver = $response=$response2= $response3 =''; + +$PROGNAME = "check_rpc"; +sub print_help (); +sub print_usage (); +sub in ($$); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$ENV{'LC_ALL'}='C'; + +#Initialise protocol for each progname number +# 'u' for UDP, 't' for TCP +$proto[10003]='u'; +$proto[10004]='u'; +$proto[10007]='u'; + +use Getopt::Long; +Getopt::Long::Configure('bundling'); +GetOptions( + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "C=s" => \$opt_C, "command=s" => \$opt_C, + "p=i" => \$opt_p, "port=i" => \$opt_p, + "H=s" => \$opt_H, "hostname=s" => \$opt_H, + "c=s" => \$opt_c, "progver=s" => \$opt_c, + "v+" => \$verbose, "verbose+" => \$verbose, + "u" => \$opt_u, "udp" => \$opt_u, + "t" => \$opt_t, "tcp" => \$opt_t +); + +# -h means display verbose help screen +if ($opt_h) { print_help(); exit $ERRORS{'UNKNOWN'}; } + +# -V means display version number +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; +} + +# Hash containing all RPC program names and numbers +# Add to the hash if support for new RPC program is required + +%prognum = ( + "portmapper" => 100000 , + "portmap" => 100000 , + "sunrpc" => 100000 , + "rpcbind" => 100000 , + "rstatd" => 100001 , + "rstat" => 100001 , + "rup" => 100001 , + "perfmeter" => 100001 , + "rstat_svc" => 100001 , + "rusersd" => 100002 , + "rusers" => 100002 , + "nfs" => 100003 , + "nfsprog" => 100003 , + "ypserv" => 100004 , + "ypprog" => 100004 , + "mountd" => 100005 , + "mount" => 100005 , + "showmount" => 100005 , + "ypbind" => 100007 , + "walld" => 100008 , + "rwall" => 100008 , + "shutdown" => 100008 , + "yppasswdd" => 100009 , + "yppasswd" => 100009 , + "etherstatd" => 100010 , + "etherstat" => 100010 , + "rquotad" => 100011 , + "rquotaprog" => 100011 , + "quota" => 100011 , + "rquota" => 100011 , + "sprayd" => 100012 , + "spray" => 100012 , + "3270_mapper" => 100013 , + "rje_mapper" => 100014 , + "selection_svc" => 100015 , + "selnsvc" => 100015 , + "database_svc" => 100016 , + "rexd" => 100017 , + "rex" => 100017 , + "alis" => 100018 , + "sched" => 100019 , + "llockmgr" => 100020 , + "nlockmgr" => 100021 , + "x25_inr" => 100022 , + "statmon" => 100023 , + "status" => 100024 , + "bootparam" => 100026 , + "ypupdated" => 100028 , + "ypupdate" => 100028 , + "keyserv" => 100029 , + "keyserver" => 100029 , + "sunlink_mapper" => 100033 , + "tfsd" => 100037 , + "nsed" => 100038 , + "nsemntd" => 100039 , + "showfhd" => 100043 , + "showfh" => 100043 , + "ioadmd" => 100055 , + "rpc.ioadmd" => 100055 , + "NETlicense" => 100062 , + "sunisamd" => 100065 , + "debug_svc" => 100066 , + "dbsrv" => 100066 , + "ypxfrd" => 100069 , + "rpc.ypxfrd" => 100069 , + "bugtraqd" => 100071 , + "kerbd" => 100078 , + "event" => 100101 , + "na.event" => 100101 , + "logger" => 100102 , + "na.logger" => 100102 , + "sync" => 100104 , + "na.sync" => 100104 , + "hostperf" => 100107 , + "na.hostperf" => 100107 , + "activity" => 100109 , + "na.activity" => 100109 , + "hostmem" => 100112 , + "na.hostmem" => 100112 , + "sample" => 100113 , + "na.sample" => 100113 , + "x25" => 100114 , + "na.x25" => 100114 , + "ping" => 100115 , + "na.ping" => 100115 , + "rpcnfs" => 100116 , + "na.rpcnfs" => 100116 , + "hostif" => 100117 , + "na.hostif" => 100117 , + "etherif" => 100118 , + "na.etherif" => 100118 , + "iproutes" => 100120 , + "na.iproutes" => 100120 , + "layers" => 100121 , + "na.layers" => 100121 , + "snmp" => 100122 , + "na.snmp" => 100122 , + "snmp-cmc" => 100122 , + "snmp-synoptics" => 100122 , + "snmp-unisys" => 100122 , + "snmp-utk" => 100122 , + "traffic" => 100123 , + "na.traffic" => 100123 , + "nfs_acl" => 100227 , + "sadmind" => 100232 , + "nisd" => 100300 , + "rpc.nisd" => 100300 , + "nispasswd" => 100303 , + "rpc.nispasswdd" => 100303 , + "ufsd" => 100233 , + "ufsd" => 100233 , + "pcnfsd" => 150001 , + "pcnfs" => 150001 , + "amd" => 300019 , + "amq" => 300019 , + "bwnfsd" => 545580417 , + "fypxfrd" => 600100069 , + "freebsd-ypxfrd" => 600100069 , +); + +# -v means verbose, -v-v means verbose twice = print above hash +if (defined $verbose && ($verbose > 1) ){ + my $key; + print "Supported programs:\n"; + print " name\t=>\tnumber\n"; + print " ===============================\n"; + foreach $key (sort keys %prognum) { + print " $key \t=>\t$prognum{$key} \n"; + } + print "\n\n"; + print_usage(); + exit $ERRORS{'OK'}; +} + +# -H means host name +unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; } + +if (! utils::is_hostname($opt_H)){ + print "$opt_H is not a valid host name\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; +}else{ + $host = $opt_H; +} + +if ($opt_t && $opt_u) { + print "Cannot define tcp AND udp\n"; + print_usage(); + exit $ERRORS{'UNKNOWN'}; +} + + +# -C means command name or number +$opt_C = shift unless ($opt_C); +unless ($opt_C) { print_usage(); exit -1; } +@progkeys = keys %prognum; +if ($opt_C =~ m/^([0-9]+)$/){ +# $response = "RPC ok: program $opt_C (version "; + $prognum = $1; +} elsif ( in( \@progkeys, $opt_C)) { +# $response = "RPC ok: $opt_C (version "; + $prognum = $prognum{$opt_C}; +} else { + print "Program $opt_C is not defined\n"; + exit $ERRORS{'UNKNOWN'}; +} + +# -p means port number +if($opt_p =~ /^([0-9]+)$/){ + $port = "-n $1"; +} else { + $port = ""; +} + +$proto = 'u'; +$proto = $proto[$prognum] if ($proto[$prognum]); +$proto = 't' if ($opt_t); +$proto = 'u' if ($opt_u); + + +# Just in case of problems, let's not hang the monitoring system +$SIG{'ALRM'} = sub { + print ("ERROR: No response from RPC server (alarm)\n"); + exit $ERRORS{"UNKNOWN"}; +}; +alarm($TIMEOUT); + +# -c is progver - if we need to check multiple specified versions. +if (defined $opt_c ) { + my $vers; + @progvers = split(/,/ ,$opt_c ); + foreach $vers (sort @progvers) { + if($vers =~ /^([0-9]+)$/){ + $progver = "$1"; + print "Checking $opt_C version $progver proto $proto\n" if $verbose; + get_rpcinfo(); + }else{ + print "Version $vers is not an integer\n" if $verbose; + } + + } +}else{ + get_rpcinfo(); +} + + +## translate proto for output +if ($proto eq "u" ){ + $proto = "udp"; +}else{ + $proto = "tcp"; +} + +if ($state eq 'OK') { + print "$state: RPC program $opt_C".$response." $proto running\n"; +}else{ + if($response){ + print "$state: RPC program $opt_C".$response2." $proto is not running,".$response." $proto is running\n"; + }else{ + print "$state: RPC program $opt_C $response2 $proto is not running\n"; + } +} +exit $ERRORS{$state}; + + +######## Subroutines ========================== + +sub get_rpcinfo { + $cmd = "$utils::PATH_TO_RPCINFO $port -" . "$proto $host $prognum $progver 2>&1 |"; + print "$cmd\n" if ($verbose); + open CMD, $cmd or die "Can't fork for rpcinfo: $!\n" ; + + while ( $line = <CMD> ) { + printf "$line " if $verbose; + chomp $line; + + if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) { + $response .= " version $1"; + $state = 'OK' unless $state ne 'UNKNOWN'; + print "1:$response \n" if $verbose; + } + + if ( $line =~ /program $prognum version ([0-9]*) is not available/ ) { + $response2 .= " version $1"; + $state = 'CRITICAL'; + print "2:$response2 \n" if $verbose; + } + if ( $line =~ /program $prognum is not available/ ) { + $response3 = ""; + $response3 = "tcp" if $opt_t; + $response3 = "udp" if $opt_u; + $state = 'CRITICAL'; + print "3:$response3 \n" if $verbose; + } + } + close CMD; +} + + +sub print_help() { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2002 Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n"; + print "\n"; + print "Check if a rpc service is registered and running using\n"; + print " rpcinfo -H host -C rpc_command \n"; + print "\n"; + print_usage(); + print "\n"; + print " <host> The server providing the rpc service\n"; + print " <rpc_command> The program name (or number).\n"; + print " <program_version> The version you want to check for (one or more)\n"; + print " Should prevent checks of unknown versions being syslogged\n"; + print " e.g. 2,3,6 to check v2, v3, and v6\n"; + print " [-u | -t] Test UDP or TCP\n"; + print " [-v] Verbose \n"; + print " [-v -v] Verbose - will print supported programs and numbers \n"; + print "\n"; + support(); +} + +sub print_usage () { + print "Usage: \n"; + print " $PROGNAME -H host -C rpc_command [-p port] [-c program_version] [-u|-t] [-v]\n"; + print " $PROGNAME [-h | --help]\n"; + print " $PROGNAME [-V | --version]\n"; +} + +sub in ($$) { + $array_ref = shift; + $test = shift; + + while ( $element = shift @{$array_ref} ) { + if ($test eq $element) { + return 1; + } + } + return 0; +} + diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh new file mode 100755 index 0000000..866e0e0 --- /dev/null +++ b/plugins-scripts/check_sensors.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +PATH="@TRUSTED_PATH@" +export PATH +PROGNAME=$(basename "$0") +PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,') +REVISION="@NP_VERSION@" + +. "$PROGPATH"/utils.sh + +print_usage() { + echo "Usage: $PROGNAME" [--ignore-fault] +} + +print_help() { + print_revision "$PROGNAME" "$REVISION" + echo "" + print_usage + echo "" + echo "This plugin checks hardware status using the lm_sensors package." + echo "" + support + exit "$STATE_OK" +} + +case "$1" in + --help) + print_help + exit "$STATE_UNKNOWN" + ;; + -h) + print_help + exit "$STATE_UNKNOWN" + ;; + --version) + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; + -V) + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; + *) + sensordata=$(sensors 2>&1) + status=$? + if test ${status} -eq 127; then + text="SENSORS UNKNOWN - command not found (did you install lmsensors?)" + exit=$STATE_UNKNOWN + elif test "${status}" -ne 0; then + text="WARNING - sensors returned state $status" + exit=$STATE_WARNING + elif echo "${sensordata}" | grep -E ALARM > /dev/null; then + text="SENSOR CRITICAL - Sensor alarm detected!" + exit=$STATE_CRITICAL + elif echo "${sensordata}" | grep -E FAULT > /dev/null \ + && test "$1" != "-i" -a "$1" != "--ignore-fault"; then + text="SENSOR UNKNOWN - Sensor reported fault" + exit=$STATE_UNKNOWN + else + text="SENSORS OK" + exit=$STATE_OK + fi + + echo "$text" + if test "$1" = "-v" -o "$1" = "--verbose"; then + echo "${sensordata}" + fi + exit "$exit" + ;; +esac diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl new file mode 100755 index 0000000..d73e40e --- /dev/null +++ b/plugins-scripts/check_uptime.pl @@ -0,0 +1,328 @@ +#!@PERL@ -w + +# check_uptime - check uptime to see how long the system is running. +# + +# License Information: +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA +# +############################################################################ + +use POSIX; +use strict; +use Getopt::Long; +use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c + $opt_f $opt_s $opt_d + $lower_warn_threshold $upper_warn_threshold + $lower_crit_threshold $upper_crit_threshold + $status $state $msg); +use FindBin; +use lib "$FindBin::Bin"; +use utils qw(%ERRORS &print_revision &support &usage ); + +sub print_help (); +sub print_usage (); +sub process_arguments (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$PROGNAME = "check_uptime"; +$state = $ERRORS{'UNKNOWN'}; + +my $uptime_file = "/proc/uptime"; + + +# Process arguments + +Getopt::Long::Configure('bundling'); +$status = process_arguments(); +if ($status){ + print "ERROR: processing arguments\n"; + exit $ERRORS{"UNKNOWN"}; +} + + +# Get uptime info from file + +if ( ! -r $uptime_file ) { + print "ERROR: file '$uptime_file' is not readable\n"; + exit $ERRORS{"UNKNOWN"}; +} + +if ( ! open FILE, "<", $uptime_file ) { + print "ERROR: cannot read from file '$uptime_file'\n"; + exit $ERRORS{"UNKNOWN"}; +} + +chomp( my $file_content = <FILE> ); +close FILE; + +print "$uptime_file: $file_content\n" if $verbose; + +# Get first digit value (without fraction) +my ( $uptime_seconds ) = $file_content =~ /^([\d]+)/; + +# Bail out if value is not numeric +if ( $uptime_seconds !~ /^\d+$/ ) { + print "ERROR: no numeric value: $uptime_seconds\n"; + exit $ERRORS{"UNKNOWN"}; +} + + +# Do calculations for a "pretty" format (2 weeks, 5 days, ...) + +my ( $secs, $mins, $hours, $days, $weeks ); +$secs = $uptime_seconds; +$mins = $hours = $days = $weeks = 0; +if ( $secs > 100 ) { + $mins = int( $secs / 60 ); + $secs -= $mins * 60; +} +if ( $mins > 100 ) { + $hours = int( $mins / 60 ); + $mins -= $hours * 60; +} +if ( $hours > 48 ) { + $days = int( $hours / 24 ); + $hours -= $days * 24; +} +if ( $days > 14 ) { + $weeks = int( $days / 7 ); + $days -= $weeks * 7; +} + +my $pretty_uptime = ""; +$pretty_uptime .= sprintf( "%d week%s, ", $weeks, $weeks == 1 ? "" : "s" ) if $weeks; +$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days; +$pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours; +$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins; +# Replace last occurrence of comma with "and" +$pretty_uptime =~ s/, $/ and /; +# Always print the seconds (though it may be 0 seconds) +$pretty_uptime .= sprintf( "%d second%s", $secs, $secs == 1 ? "" : "s" ); + + +# Default to catch errors in program +my $state_str = "UNKNOWN"; + +# Check values +my $out_of_bounds_text = ""; +if ( $uptime_seconds > $upper_crit_threshold ) { + $state_str = "CRITICAL"; + $out_of_bounds_text = "upper crit"; +} elsif ( $uptime_seconds < $lower_crit_threshold ) { + $state_str = "CRITICAL"; + $out_of_bounds_text = "lower crit"; +} elsif ( $uptime_seconds > $upper_warn_threshold ) { + $state_str = "WARNING"; + $out_of_bounds_text = "upper warn"; +} elsif ( $uptime_seconds < $lower_warn_threshold ) { + $state_str = "WARNING"; + $out_of_bounds_text = "lower warn"; +} else { + $state_str = "OK"; +} + +# Prepare uptime value (seconds or days) +my $uptime_text = ""; +my $uptime_unit = ""; +if ( $opt_d ) { + $uptime_text = floor($uptime_seconds / 60 / 60 / 24); + $uptime_unit = "days"; +} else { + $uptime_text = $uptime_seconds; + $uptime_unit = "seconds"; +} + +$msg = "$state_str: "; + +$msg .= "Uptime is $uptime_text $uptime_unit. "; +$msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text; +$msg .= "Running for $pretty_uptime. " if $opt_f; +if ( $opt_s ) { + my $up_since = strftime( "%Y-%m-%d %H:%M:%S", localtime( time - $uptime_seconds ) ); + $msg .= "Running since $up_since. "; +} + +$state = $ERRORS{$state_str}; + +# Perfdata support +print "$msg|uptime=${uptime_seconds}s;$upper_warn_threshold;$upper_crit_threshold;0\n"; +exit $state; + + +##################################### +#### subs + + +sub process_arguments(){ + GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "v" => \$opt_v, "verbose" => \$opt_v, + "h" => \$opt_h, "help" => \$opt_h, + "w=s" => \$opt_w, "warning=s" => \$opt_w, # warning if above this number + "c=s" => \$opt_c, "critical=s" => \$opt_c, # critical if above this number + "f" => \$opt_f, "for" => \$opt_f, # show "running for ..." + "s" => \$opt_s, "since" => \$opt_s, # show "running since ..." + "d" => \$opt_d, "days" => \$opt_d, # report uptime in days + ); + + if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'UNKNOWN'}; + } + + if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; + } + + if (defined $opt_v) { + $verbose = $opt_v; + } + + unless ( defined $opt_w && defined $opt_c ) { + print_usage(); + exit $ERRORS{'UNKNOWN'}; + } + + # Check if a range was supplied ("lowvalue:highvalue") for warning and critical + # Otherwise, set 0 as the lower threshold and the parameter value as upper threshold + # (the uptime should always be positive, so there should be no issue) + if ( $opt_w =~ /^(.+):(.+)$/ ) { + $lower_warn_threshold = $1; + $upper_warn_threshold = $2; + } else { + $lower_warn_threshold = 0; + $upper_warn_threshold = $opt_w; + } + if ( $opt_c =~ /^(.+):(.+)$/ ) { + $lower_crit_threshold = $1; + $upper_crit_threshold = $2; + } else { + $lower_crit_threshold = 0; + $upper_crit_threshold = $opt_c; + } + + # Set as seconds (calculate if suffix present) + $lower_warn_threshold = calc_as_seconds( $lower_warn_threshold ); + $lower_crit_threshold = calc_as_seconds( $lower_crit_threshold ); + $upper_warn_threshold = calc_as_seconds( $upper_warn_threshold ); + $upper_crit_threshold = calc_as_seconds( $upper_crit_threshold ); + + # Check for numeric value of warning parameter + if ( $lower_warn_threshold !~ /^\d+$/ ) { + print "Lower warning (-w) is not numeric\n"; + exit $ERRORS{'UNKNOWN'}; + } + if ( $upper_warn_threshold !~ /^\d+$/ ) { + print "Upper warning (-w) is not numeric\n"; + exit $ERRORS{'UNKNOWN'}; + } + # Check for numeric value of critical parameter + if ( $lower_crit_threshold !~ /^\d+$/ ) { + print "Lower critical (-c) is not numeric\n"; + exit $ERRORS{'UNKNOWN'}; + } + if ( $upper_crit_threshold !~ /^\d+$/ ) { + print "Upper critical (-c) is not numeric\n"; + exit $ERRORS{'UNKNOWN'}; + } + + # Check boundaries + if ( $upper_warn_threshold >= $upper_crit_threshold ) { + print "Upper Warning (-w) cannot be greater than Critical (-c)!\n"; + exit $ERRORS{'UNKNOWN'}; + } + # No "<=" since both values are zero if no range (only upper threshold values) is given + if ( $lower_warn_threshold < $lower_crit_threshold ) { + print "Lower Warning (-w) cannot be less than Critical (-c)!\n"; + exit $ERRORS{'UNKNOWN'}; + } + + return $ERRORS{'OK'}; +} + +sub print_usage () { + print "Usage: $PROGNAME -w <warn> -c <crit> [-v]\n"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n"; + print "Copyright (c) 2018 Bernd Arnold\n"; + print "\n"; + print_usage(); + print "\n"; + print " Checks the uptime of the system using $uptime_file\n"; + print "\n"; + print "-w (--warning) = Min. number of uptime to generate warning\n"; + print "-c (--critical) = Min. number of uptime to generate critical alert ( w < c )\n"; + print "-f (--for) = Show uptime in a pretty format (Running for x weeks, x days, ...)\n"; + print "-s (--since) = Show last boot in yyyy-mm-dd HH:MM:SS format (output from 'uptime -s')\n"; + print "-d (--days) = Show uptime in days\n"; + print "-h (--help)\n"; + print "-V (--version)\n"; + print "-v (--verbose) = debugging output\n"; + print "\n\n"; + print "Note: -w and -c are required arguments.\n"; + print " You can suffix both values with s for seconds (default), m (minutes), h (hours), d (days) or w (weeks).\n"; + print "\n"; + print "Range support: You may specify a range for both warning and critical thresholds.\n"; + print " This works without additional Perl modules.\n"; + print "Example: ./check_uptime -w 10m:4w -c 1m:8w\n"; + print " Results in a critical state when uptime is below 60 seconds or higher than 8 weeks,\n"; + print " and in a warning state when uptime is below 10 minutes or above 4 weeks.\n"; + print "\n\n"; + support(); +} + +sub calc_as_seconds () { + + my $parameter = shift; + + # Check if suffix is present + # Calculate parameter to seconds (to get an integer value finally) + # If no suffix is present, just return the value + + # Possible suffixes: + # s = seconds + # m = minutes + # h = hours + # d = days + # w = weeks + my %factor = ( "s" => 1, + "m" => 60, + "h" => 60 * 60, + "d" => 60 * 60 * 24, + "w" => 60 * 60 * 24 * 7, + ); + + if ( $parameter =~ /^(\d+)([a-z])$/ ) { + my $value = $1; + my $suffix = $2; + print "detected: value=$value, suffix=$suffix\n" if $verbose; + if ( ! defined $factor{$suffix} ) { + print "Error: wrong suffix ($suffix) for value '$parameter'"; + exit $ERRORS{'UNKNOWN'}; + } + $parameter = $value * $factor{$suffix}; + } + + return $parameter; + +} diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl new file mode 100755 index 0000000..c24015c --- /dev/null +++ b/plugins-scripts/check_wave.pl @@ -0,0 +1,124 @@ +#!@PERL@ -w +# + + +use strict; +use FindBin; +use lib "$FindBin::Bin"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); +use vars qw($PROGNAME); +use Getopt::Long; +use vars qw($opt_V $opt_h $verbose $opt_w $opt_c $opt_H); +my (@test, $low1, $med1, $high1, $snr, $low2, $med2, $high2); +my ($low, $med, $high, $lowavg, $medavg, $highavg, $tot, $ss); + +$PROGNAME = "check_wave"; +sub print_help (); +sub print_usage (); + +$ENV{'PATH'}='@TRUSTED_PATH@'; +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$ENV{'CDPATH'}=''; + +Getopt::Long::Configure('bundling'); +GetOptions + ("V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "v" => \$verbose, "verbose" => \$verbose, + "w=s" => \$opt_w, "warning=s" => \$opt_w, + "c=s" => \$opt_c, "critical=s" => \$opt_c, + "H=s" => \$opt_H, "hostname=s" => \$opt_H); + +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); #' + exit $ERRORS{'UNKNOWN'}; +} + +if ($opt_h) { + print_help(); + exit $ERRORS{'UNKNOWN'}; +} + +$opt_H = shift unless ($opt_H); +print_usage() unless ($opt_H); +my $host = $1 if ($opt_H =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z][-a-zA-Z0]+(\.[a-zA-Z][-a-zA-Z0]+)*)$/); +print_usage() unless ($host); + +($opt_c) || ($opt_c = shift) || ($opt_c = 120); +my $critical = $1 if ($opt_c =~ /([0-9]+)/); + +($opt_w) || ($opt_w = shift) || ($opt_w = 60); +my $warning = $1 if ($opt_w =~ /([0-9]+)/); + +$low1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; +@test = split(/ /,$low1); +$low1 = $test[2]; + +$med1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; +@test = split(/ /,$med1); +$med1 = $test[2]; + +$high1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; +@test = split(/ /,$high1); +$high1 = $test[2]; + +sleep(2); + +$snr = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`; +@test = split(/ /,$snr); +$snr = $test[2]; +$snr = int($snr*25); + +$low2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; +@test = split(/ /,$low2); +$low2 = $test[2]; + +$med2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; +@test = split(/ /,$med2); +$med2 = $test[2]; + +$high2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; +@test = split(/ /,$high2); +$high2 = $test[2]; + +$low = $low2 - $low1; +$med = $med2 - $med1; +$high = $high2 - $high1; + +$tot = $low + $med + $high; + +if ($tot==0) { + $ss = 0; +} else { + $lowavg = $low / $tot; + $medavg = $med / $tot; + $highavg = $high / $tot; + $ss = ($medavg*50) + ($highavg*100); +} + +printf("Signal Strength at: %3.0f%, SNR at $snr%",$ss); + +if ($ss<$critical) { + exit(2); +} elsif ($ss<$warning) { + exit(1); +} else { + exit(0); +} + + +sub print_usage () { + print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>]\n"; +} + +sub print_help () { + print_revision($PROGNAME,'@NP_VERSION@'); + print "Copyright (c) 2000 Jeffery Blank/Karl DeBisschop\n"; + print "\n"; + print_usage(); + print "\n"; + print "<warn> = Signal strength at which a warning message will be generated.\n"; + print "<crit> = Signal strength at which a critical message will be generated.\n\n"; + support(); +} diff --git a/plugins-scripts/t/check_disk_smb.t b/plugins-scripts/t/check_disk_smb.t new file mode 100644 index 0000000..c2e8bbb --- /dev/null +++ b/plugins-scripts/t/check_disk_smb.t @@ -0,0 +1,96 @@ +#! /usr/bin/perl -w -I .. +# +# test cases for check_disk_smb +# + +use strict; +use Test::More; +use NPTest; + +my $tests = 14; +plan tests => $tests; +my $res; + +my $plugin = "check_disk_smb"; +SKIP: { + skip "$plugin is not created", $tests if ( ! -x $plugin ); + my $auth = ""; + + my $host = getTestParameter("NP_HOST_SMB", "A host providing an SMB Service", + "localhost"); + + my $smb_share = getTestParameter("NP_SMB_SHARE", + "An SMB share name the host provides", + "public"); + + my $smb_share_spc = getTestParameter("NP_SMB_SHARE_SPC", + "An SMB share name containing one or more spaces the host provides", + "pub lic"); + + my $smb_share_deny = getTestParameter("NP_SMB_SHARE_DENY", + "An access denying SMB share name the host provides", + "private"); + + my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", + "The hostname of system not responsive to network requests", "10.0.0.1" ); + + my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", + "nosuchhost" ); + my $user = getTestParameter( "NP_SMB_VALID_USER", "A valid smb user", "" ); + my $pass = getTestParameter( "NP_SMB_VALID_USER_PASS", "A valid password for valid smb user", "" ); + $auth .= "-u $user " if ($user); + $auth .= "-p $pass " if ($pass); + + + + $res = NPTest->testCmd( "./$plugin" ); + is( $res->return_code, 3, "No arguments" ); + + $res = NPTest->testCmd( "./$plugin -H fakehostname" ); + is( $res->return_code, 3, "No share specified" ); + + $res = NPTest->testCmd( "./$plugin -H fakehostname -s share -w 100G -c 101G" ); + is( $res->return_code, 3, "warn is less than critical" ); + + SKIP: { + skip "no smb host defined", 10 if ( ! $host ); + + SKIP: { + skip "no share name defined", 2 if ( ! $smb_share ); + $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 2k -c 1k" ); + cmp_ok( $res->return_code, '==', 0, "Exit OK if $smb_share has > 1k free space"); + like($res->output, '/free/i', "String contains the word 'free'"); + + $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10001G -c 10000G" ); + cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share has < 10000G free space"); + like($res->output, '/free/i', "String contains the word 'free'"); + + $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10000G -c 1k" ); + cmp_ok( $res->return_code, '==', 1, "Exit WARN if $smb_share has > 10000G and <1k free space"); + like($res->output, '/free/i', "String contains the word 'free'"); + } + + SKIP: { + skip "no share name containing spaces defined", 2 if ( ! $smb_share_spc ); + $res = NPTest->testCmd( "./$plugin -H $host $auth -s '$smb_share_spc' -w 2k -c 1k" ); + cmp_ok( $res->return_code, '==', 0, "Exit OK if '$smb_share_spc' has > 1k free space"); + like($res->output, '/free/i', "String contains the word 'free'"); + + } + SKIP: { + skip "no share name without permissions ", 2 if ( ! $smb_share_deny ); + $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share_deny -w 2k -c 1k" ); + cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share_deny has > 1k free space"); + unlike($res->output, '/free/i', "String does not contain the word 'free'"); + + } + } + + SKIP: { + skip "no non responsive host defined", 1 if ( ! $host_nonresponsive ); + $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -s np_foobar "); + cmp_ok( $res->return_code, '>=', 2, "Exit CRITICAL/UNKNOWN with non responsive host" ); + } + +} diff --git a/plugins-scripts/t/check_file_age.t b/plugins-scripts/t/check_file_age.t new file mode 100644 index 0000000..8b87670 --- /dev/null +++ b/plugins-scripts/t/check_file_age.t @@ -0,0 +1,109 @@ +#!/usr/bin/perl -w -I .. +# +# check_file_age tests +# +# + +use strict; +use Test::More tests => 27; +use NPTest; + +my $successOutput = '/^FILE_AGE OK: /'; +my $warningOutput = '/^FILE_AGE WARNING: /'; +my $criticalOutput = '/^FILE_AGE CRITICAL: /'; +my $unknownOutput = '/^FILE_AGE UNKNOWN: /'; +my $performanceOutput = '/ \| age=[0-9]+s;[0-9:]+;[0-9:]+ size=[0-9]+B;[0-9:]+;[0-9:]+;0$/'; + +my $result; +my $temp_file = "/tmp/check_file_age.tmp"; +my $temp_link = "/tmp/check_file_age.link.tmp"; + +unlink $temp_file, $temp_link; + +$result = NPTest->testCmd("./check_file_age"); +cmp_ok( $result->return_code, '==', 3, "Missing parameters" ); +like ( $result->output, $unknownOutput, "Output for unknown correct" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file"); +cmp_ok( $result->return_code, '==', 2, "File not exists" ); +like ( $result->output, $criticalOutput, "Output for file missing correct" ); + +write_chars(100); +$result = NPTest->testCmd("./check_file_age -f $temp_file"); +cmp_ok( $result->return_code, '==', 0, "File is new enough" ); +like ( $result->output, $successOutput, "Output for success correct" ); + +sleep 2; + +$result = NPTest->testCmd("./check_file_age -f $temp_file -w 1"); +cmp_ok( $result->return_code, '==', 1, "Warning for file over 1 second old" ); +like ( $result->output, $warningOutput, "Output for warning correct" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1"); +cmp_ok( $result->return_code, '==', 2, "Critical for file over 1 second old" ); +like ( $result->output, $criticalOutput, "Output for critical correct" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100"); +cmp_ok( $result->return_code, '==', 0, "Checking file size" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100"); +like( $result->output, $performanceOutput, "Checking for performance Output" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100"); +like( $result->output, $performanceOutput, "Checking for performance Output from range" ); + +$result = NPTest->testCmd("./check_file_age -f /non/existent --ignore-missing"); +cmp_ok( $result->return_code, '==', 0, "Honours --ignore-missing" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 101"); +cmp_ok( $result->return_code, '==', 1, "One byte too short" ); + +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 101"); +cmp_ok( $result->return_code, '==', 2, "One byte too short - critical" ); + +SKIP: { + eval 'use Monitoring::Plugin::Range'; + skip "Monitoring::Plugin::Range module require", 9 if $@; + + $result = NPTest->testCmd("./check_file_age -f $temp_file -w 0:1"); + cmp_ok( $result->return_code, '==', 1, "Warning for file over 1 second old by range" ); + like ( $result->output, $warningOutput, "Output for warning by range correct" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 0:1"); + cmp_ok( $result->return_code, '==', 2, "Critical for file over 1 second old by range" ); + like ( $result->output, $criticalOutput, "Output for critical by range correct" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 0:1000 -W 0:100"); + cmp_ok( $result->return_code, '==', 0, "Checking file size by range" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 101:"); + cmp_ok( $result->return_code, '==', 1, "One byte too short by range" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 0:99"); + cmp_ok( $result->return_code, '==', 1, "One byte too long by range" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 101:"); + cmp_ok( $result->return_code, '==', 2, "One byte too short by range - critical" ); + + $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 0:99"); + cmp_ok( $result->return_code, '==', 2, "One byte too long by range - critical" ); +}; + +symlink $temp_file, $temp_link or die "Cannot create symlink"; +$result = NPTest->testCmd("./check_file_age -f $temp_link -c 10"); +cmp_ok( $result->return_code, '==', 0, "Works for symlinks" ); +unlink $temp_link; + +unlink $temp_file; +mkdir $temp_file or die "Cannot create directory"; +$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1"); +cmp_ok( $result->return_code, '==', 0, "Works for directories" ); +rmdir $temp_file; + + +sub write_chars { + my $size = shift; + open F, "> $temp_file" or die "Cannot write to $temp_file"; + print F "A" x $size; + close F; +} diff --git a/plugins-scripts/t/check_ifoperstatus.t b/plugins-scripts/t/check_ifoperstatus.t new file mode 100644 index 0000000..2feb364 --- /dev/null +++ b/plugins-scripts/t/check_ifoperstatus.t @@ -0,0 +1,93 @@ +#! /usr/bin/perl -w -I .. +# +# SNMP Test via check_ifoperstatus +# +# + +use strict; +use Test::More; +use NPTest; + +my $tests = 15; +plan tests => $tests; +my $res; + +my $plugin = "check_ifoperstatus"; +SKIP: { + skip "$plugin is not created", $tests if ( ! -x $plugin ); + + my $host_snmp = getTestParameter( "NP_HOST_SNMP", "A host providing an SNMP Service", "localhost"); + + my $snmp_community = getTestParameter( "NP_SNMP_COMMUNITY", + "The SNMP Community string for SNMP Testing", + "public"); + + my ($snmp_interface, $snmp_ifxtable); + if ($host_snmp) { + $snmp_interface = getTestParameter( "NP_SNMP_INTERFACE", "Name of an active network interface on SNMP server", "lo" ); + + $snmp_ifxtable = getTestParameter( "NP_SNMP_IFXTABLE", + "Is IFXTABLE activated in SNMP server (1: yes, 0: no)? snmpwalk -v1 -c $snmp_community $host_snmp ifxtable", + "1" ); + } + + my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", + "The hostname of system not responsive to network requests", "10.0.0.1" ); + + my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", + "nosuchhost" ); + + + + $res = NPTest->testCmd( "./$plugin" ); + is( $res->return_code, 3, "No arguments" ); + like( $res->output, '/usage/', "Output contains usage" ); + + $res = NPTest->testCmd( "./$plugin -H fakehostname" ); + is( $res->return_code, 3, "No key/descr specified" ); + like( $res->output, '/Either a valid snmp key/', "Output contains 'Either a valid snmp key'" ); + + $res = NPTest->testCmd( "./$plugin -H fakehost -k 1 -v 3 --seclevel rubbish --secname foobar" ); + is( $res->return_code, 3, "invalid seclevel" ); + like( $res->output, "/Must define a valid security level/", "Output contains 'Must define a valid security level'" ); + + SKIP: { + skip "no snmp host defined", 6 if ( ! $host_snmp ); + + $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -k 1"); + cmp_ok( $res->return_code, '==', 0, "Exit OK for ifindex 1" ); + like($res->output, '/^OK.*Interface.*is up/', "String contains OK Interface is up"); + + SKIP: { + skip "no snmp interface defined", 2 if ( ! $snmp_interface ); + $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -d $snmp_interface"); + cmp_ok( $res->return_code, '==', 0, "Exit OK for ifdescr $snmp_interface" ); + like($res->output, '/^OK.*Interface.*is up/', "String contains OK Interface is up"); + } + + SKIP: { + skip "ifxtable not available", 2 if ( ! $snmp_ifxtable ); + $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -k 1 -n rubbish"); + cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN if interface name doesn't match" ); + like($res->output, '/doesn\'t match snmp value/', "String contains 'doesn't match snmp value'"); + } + + } + + # These checks need a complete command line. An invalid community is used so + # the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway + SKIP: { + skip "no non responsive host defined", 1 if ( ! $host_nonresponsive ); + $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -C np_foobar -k 1"); + cmp_ok( $res->return_code, '==', 1, "Exit WARNING with non responsive host" ); + } + + SKIP: { + skip "no invalid host defined", 2 if ( ! $hostname_invalid ); + $res = NPTest->testCmd( "./$plugin -H $hostname_invalid -C np_foobar -k 1"); + cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with invalid host" ); + like($res->output, "/Unable to resolve.*$hostname_invalid/", "String matches unable to resolve.*$hostname_invalid"); + } + +} diff --git a/plugins-scripts/t/check_ifstatus.t b/plugins-scripts/t/check_ifstatus.t new file mode 100644 index 0000000..7d0220a --- /dev/null +++ b/plugins-scripts/t/check_ifstatus.t @@ -0,0 +1,67 @@ +#! /usr/bin/perl -w -I .. +# +# SNMP Test via check_ifoperstatus +# +# + +use strict; +use Test::More; +use NPTest; + +my $tests = 9; +plan tests => $tests; +my $res; + +my $plugin = "check_ifstatus"; +SKIP: { + skip "$plugin is not created", $tests if ( ! -x $plugin ); + + my $host_snmp = getTestParameter( "NP_HOST_SNMP", "A host providing an SNMP Service", "localhost"); + + my $snmp_community = getTestParameter( "NP_SNMP_COMMUNITY", + "The SNMP Community string for SNMP Testing", + "public"); + + my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", + "The hostname of system not responsive to network requests", "10.0.0.1" ); + + my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", + "nosuchhost" ); + + + $res = NPTest->testCmd( "./$plugin" ); + is( $res->return_code, 3, "No arguments" ); + like( $res->output, '/usage/', "Output contains usage" ); + + $res = NPTest->testCmd( "./$plugin -H fakehost -v 3 --seclevel rubbish --secname foobar" ); + is( $res->return_code, 3, "invalid seclevel" ); + like( $res->output, "/Must define a valid security level/", "Output contains 'Must define a valid security level'" ); + + SKIP: { + skip "no snmp host defined", 2 if ( ! $host_snmp ); + + $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community "); + like($res->output, '/^.*host.*interfaces up/', "String contains host.*interfaces up"); + + $res = NPTest->testCmd( "./$plugin -H $host_snmp -C rubbish"); + cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL for community 'rubbish'" ); + + } + + # These checks need a complete command line. An invalid community is used so + # the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway + SKIP: { + skip "no non responsive host defined", 1 if ( ! $host_nonresponsive ); + $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -C np_foobar"); + cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL with non responsive host" ); + } + + SKIP: { + skip "no invalid host defined", 2 if ( ! $hostname_invalid ); + $res = NPTest->testCmd( "./$plugin -H $hostname_invalid -C np_foobar"); + cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with invalid host" ); + like($res->output, "/Unable to resolve.*$hostname_invalid/", "String matches unable to resolve.*$hostname_invalid"); + } + +} diff --git a/plugins-scripts/t/check_log.t b/plugins-scripts/t/check_log.t new file mode 100644 index 0000000..b66e0fd --- /dev/null +++ b/plugins-scripts/t/check_log.t @@ -0,0 +1,82 @@ +#!/usr/bin/perl -w -I .. +# +# check_log tests +# +# + +use strict; +use Test::More; +use NPTest; + +my $tests = 18; +plan tests => $tests; + +my $firstTimeOutput ='/^Log check data initialized/'; +my $okOutput = '/^Log check ok - 0 pattern matches found/'; +my $criticalOutput = '/^\(\d+\) < /'; +my $multilineOutput = '/\(3\) <.*\n.*\n.*$/'; +my $unknownOutput = '/^Usage: /'; +my $unknownArgOutput = '/^Unknown argument: /'; +my $bothRegexOutput = '/^Can not use extended and perl regex/'; + +my $result; +my $temp_file = "/tmp/check_log.tmp"; +my $oldlog = "/tmp/oldlog.tmp"; + +open(FH, '>', $temp_file) or die $!; +close(FH); + +$result = NPTest->testCmd("./check_log"); +cmp_ok( $result->return_code, '==', 3, "Missing parameters" ); +like ( $result->output, $unknownOutput, "Output for unknown correct" ); + +$result = NPTest->testCmd("./check_log -f"); +cmp_ok( $result->return_code, '==', 3, "Wrong parameters" ); +like ( $result->output, $unknownArgOutput, "Output for unknown correct" ); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Simple match' -e -p"); +cmp_ok( $result->return_code, '==', 3, "Both regex parameters" ); +like ( $result->output, $bothRegexOutput, "Output for unknown correct" ); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Simple match'"); +cmp_ok( $result->return_code, '==', 0, "First time executing" ); +like ( $result->output, $firstTimeOutput, "Output for first time executing correct" ); + +open(FH, '>>', $temp_file) or die $!; +print FH "This is some text, that should not match\n"; +close(FH); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'No match'"); +cmp_ok( $result->return_code, '==', 0, "No match" ); +like ( $result->output, $okOutput, "Output for no match correct" ); + +open(FH, '>>', $temp_file) or die $!; +print FH "This text should match\n"; +close(FH); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'should match'"); +cmp_ok( $result->return_code, '==', 2, "Pattern match" ); +like ( $result->output, $criticalOutput, "Output for match correct" ); + +open(FH, '>>', $temp_file) or die $!; +print FH "This text should not match, because it is excluded\n"; +close(FH); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'match' --exclude 'because'"); +cmp_ok( $result->return_code, '==', 0, "Exclude a pattern" ); +like ( $result->output, $okOutput, "Output for no match correct" ); + +open(FH, '>>', $temp_file) or die $!; +print FH "Trying\nwith\nmultiline\nignore me\n"; +close(FH); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Trying\\|with\\|multiline\\|ignore' --exclude 'me' --all"); +cmp_ok( $result->return_code, '==', 2, "Multiline pattern match with --all" ); +like ( $result->output, $multilineOutput, "Output for multiline match correct" ); + +$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'match' -a"); +cmp_ok( $result->return_code, '==', 0, "Non matching --all" ); +like ( $result->output, $okOutput, "Output for no match correct" ); + +unlink($oldlog); +unlink($temp_file); diff --git a/plugins-scripts/t/check_rpc.t b/plugins-scripts/t/check_rpc.t new file mode 100644 index 0000000..c58f7bf --- /dev/null +++ b/plugins-scripts/t/check_rpc.t @@ -0,0 +1,21 @@ +#! /usr/bin/perl -w -I .. +# +# Remote Procedure Call (RPC) Tests via check_rpc +# +# + +use strict; +use Test; +use NPTest; + +use vars qw($tests); +BEGIN {$tests = 2; plan tests => $tests} + +my $successOutput = '/^check_rpc/'; + +my $t; + +$t += checkCmd( "./check_rpc -V", 3, $successOutput ); + +exit(0) if defined($Test::Harness::VERSION); +exit($tests - $t); diff --git a/plugins-scripts/t/check_uptime.t b/plugins-scripts/t/check_uptime.t new file mode 100644 index 0000000..6e81db3 --- /dev/null +++ b/plugins-scripts/t/check_uptime.t @@ -0,0 +1,135 @@ +#!/usr/bin/perl -w -I .. +# +# check_uptime tests +# +# + +use strict; +use Test::More tests => 42; +use NPTest; + +my $result; + +$result = NPTest->testCmd( + "./check_uptime" + ); +cmp_ok( $result->return_code, '==', 3, "Missing parameters" ); +like ( $result->output, '/^Usage: check_uptime -w/', "Output for missing parameters correct" ); + +$result = NPTest->testCmd( + "./check_uptime --help" + ); +cmp_ok( $result->return_code, '==', 3, "Help output requested" ); +like ( $result->output, '/ABSOLUTELY NO WARRANTY/', "Output for help correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 5 -c 2" + ); +cmp_ok( $result->return_code, '==', 3, "Warning greater than critical" ); +like ( $result->output, '/^Upper Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" ); + +$result = NPTest->testCmd( + "./check_uptime -c 1000 -W 100 2>&1" + ); +like ( $result->output, '/^Unknown option: W/', "Output with wrong parameter is correct" ); + +$result = NPTest->testCmd( + "./check_uptime -f -w 1 -c 2" + ); +cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" ); +like ( $result->output, '/Running for \d+/', "Output for the f parameter correct" ); + +$result = NPTest->testCmd( + "./check_uptime -s -w 1 -c 2" + ); +cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" ); +like ( $result->output, '/Running since \d+/', "Output for the s parameter correct" ); + +$result = NPTest->testCmd( + "./check_uptime -d -w 1 -c 2" + ); +cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" ); +like ( $result->output, '/CRITICAL: Uptime is \d+ days/', "Output for the d parameter correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 1 -c 2" + ); +cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" ); +like ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime higher than 2 seconds correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 1 -c 9999w" + ); +cmp_ok( $result->return_code, '==', 1, "Uptime lower than 9999 weeks" ); +like ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 9999 weeks correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 9998w -c 9999w" + ); +cmp_ok( $result->return_code, '==', 0, "Uptime lower than 9998 weeks" ); +like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 9998 weeks correct" ); +like ( $result->output, '/\|uptime=[0-9]+s;6046790400;6047395200;/', "Checking for performance output" ); + +$result = NPTest->testCmd( + "./check_uptime -w 111222d -c 222333d" + ); +cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days" ); +like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days correct" ); +like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" ); + +# Same as before, hopefully uptime is higher than 2 seconds so no warning +$result = NPTest->testCmd( + "./check_uptime -w 2:111222d -c 1:222333d" + ); +cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days, and higher 2 seconds" ); +like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days, and higher 2 seconds correct" ); +like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" ); + +# Same as before, now the low warning should trigger +$result = NPTest->testCmd( + "./check_uptime -w 111221d:111222d -c 1:222333d" + ); +cmp_ok( $result->return_code, '==', 1, "Uptime lower than 111221 days raises warning" ); +like ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 111221 days correct" ); +like ( $result->output, '/Exceeds lower warn threshold/', "Exceeds text correct" ); +like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" ); + +# Same as before, now the low critical should trigger +$result = NPTest->testCmd( + "./check_uptime -w 111221d:111222d -c 111220d:222333d" + ); +cmp_ok( $result->return_code, '==', 2, "Uptime lower than 111220 days raises critical" ); +like ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime lower than 111220 days correct" ); +like ( $result->output, '/Exceeds lower crit threshold/', "Exceeds text correct" ); +like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" ); + + +# +# Range values using ":" without two parts ("a:b") is invalid +# Strings without two parts are always considered as upper threshold +# + +$result = NPTest->testCmd( + "./check_uptime -w 2: -c 1:4" + ); +cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" ); +like ( $result->output, '/^Upper warning .* is not numeric/', "Output for wrong parameter format correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 2:3 -c 1:" + ); +cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" ); +like ( $result->output, '/^Upper critical .* is not numeric/', "Output for wrong parameter format correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w :3 -c 1:4" + ); +cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" ); +like ( $result->output, '/^Upper warning .* is not numeric/', "Output for wrong parameter format correct" ); + +$result = NPTest->testCmd( + "./check_uptime -w 2:3 -c :4" + ); +cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" ); +like ( $result->output, '/^Upper critical .* is not numeric/', "Output for wrong parameter format correct" ); + diff --git a/plugins-scripts/t/utils.t b/plugins-scripts/t/utils.t new file mode 100644 index 0000000..5c23179 --- /dev/null +++ b/plugins-scripts/t/utils.t @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w -I .. +# +# utils.pm tests +# +# +# Run with perl t/utils.t + +use warnings; +use strict; +use Test::More; +use NPTest; + +use lib "."; +use lib ".."; +use utils; + +my $hostname_checks = { + "www.altinity.com" => 1, + "www.888.com" => 1, + "888.com" => 1, + "host-hyphened.com" => 1, + "rubbish" => 1, + "-start.com" => 0, + "nonfqdn-but-endsindot." => 1, + "fqdn.and.endsindot." => 1, + "lots.of.dots.dot.org" => 1, + "endingwithdoubledots.." => 0, + "toomany..dots" => 0, + ".start.with.dot" => 0, + "10.20.30.40" => 1, + "10.20.30.40.50" => 0, + "10.20.30" => 0, + "10.20.30.40." => 1, # This is considered a hostname because of trailing dot. It probably won't exist though... + "888." => 1, # This is because it could be a domain + "host.888." => 1, + "where.did.that.!.come.from." => 0, + "no.underscores_.com" => 0, + "a.somecompany.com" => 1, + "host.a.com" => 1, + }; + +plan tests => ((scalar keys %$hostname_checks) + 4); + +foreach my $h (sort keys %$hostname_checks) { + is (utils::is_hostname($h), $hostname_checks->{$h}, "$h should return ".$hostname_checks->{$h}); +} + +is(utils::is_hostname(), 0, "No parameter errors"); +is(utils::is_hostname(""), 0, "Empty string errors"); +is(utils::is_hostname(0), 0, "0 also errors"); +is(utils::is_hostname(1), 0, "1 also errors"); diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in new file mode 100644 index 0000000..c84769f --- /dev/null +++ b/plugins-scripts/utils.pm.in @@ -0,0 +1,69 @@ +# Utility drawer for Monitoring Plugins. +# +# This will be deprecated soon. Please use Monitoring::Plugin from CPAN +# for new plugins + +package utils; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT_OK = qw($TIMEOUT %ERRORS &print_revision &support &usage); + +#use strict; +#use vars($TIMEOUT %ERRORS); +sub print_revision ($$); +sub usage; +sub support(); +sub is_hostname; + +## updated by autoconf +$PATH_TO_SUDO = "@PATH_TO_SUDO@"; +$PATH_TO_RPCINFO = "@PATH_TO_RPCINFO@" ; +$PATH_TO_LMSTAT = "@PATH_TO_LMSTAT@" ; +$PATH_TO_SMBCLIENT = "@PATH_TO_SMBCLIENT@" ; +$PATH_TO_MAILQ = "@PATH_TO_MAILQ@"; +$PATH_TO_QMAIL_QSTAT = "@PATH_TO_QMAIL_QSTAT@"; +$PATH_TO_SNMPGET = "@PATH_TO_SNMPGET@"; + +## common variables +$TIMEOUT = 15; +%ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); + +## utility subroutines +sub print_revision ($$) { + my $commandName = shift; + my $pluginRevision = shift; + print "$commandName v$pluginRevision (@PACKAGE@ @VERSION@)\n"; + print "@WARRANTY@"; +} + +sub support () { + my $support='@SUPPORT@'; + $support =~ s/@/\@/g; + $support =~ s/\\n/\n/g; + print $support; +} + +sub usage { + my $format=shift; + printf($format,@_); + exit $ERRORS{'UNKNOWN'}; +} + +sub is_hostname { + my $host1 = shift; + return 0 unless defined $host1; + if ($host1 =~ m/^[\d\.]+$/ && $host1 !~ /\.$/) { + if ($host1 =~ m/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) { + return 1; + } else { + return 0; + } + } elsif ($host1 =~ m/^[a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)*\.?$/) { + return 1; + } else { + return 0; + } +} + +1; diff --git a/plugins-scripts/utils.sh.in b/plugins-scripts/utils.sh.in new file mode 100644 index 0000000..031c035 --- /dev/null +++ b/plugins-scripts/utils.sh.in @@ -0,0 +1,111 @@ +#! /bin/sh + +STATE_OK=0 +STATE_WARNING=1 +STATE_CRITICAL=2 +STATE_UNKNOWN=3 +STATE_DEPENDENT=4 + +print_revision() { + echo "$1 v$2 (@PACKAGE@ @VERSION@)" + printf '%b' "@WARRANTY@" +} + +support() { + printf '%b' "@SUPPORT@" +} + +# +# check_range takes a value and a range string, returning successfully if an +# alert should be raised based on the range. Range values are inclusive. +# Values may be integers or floats. +# +# Example usage: +# +# Generating an exit code of 1: +# check_range 5 2:8 +# +# Generating an exit code of 0: +# check_range 1 2:8 +# +check_range() { + local v range yes no err decimal start end cmp match + v="$1" + range="$2" + + # whether to raise an alert or not + yes=0 + no=1 + err=2 + + # regex to match a decimal number + decimal="-?([0-9]+\.?[0-9]*|[0-9]*\.[0-9]+)" + + # compare numbers (including decimals), returning true/false + cmp() { awk "BEGIN{ if ($1) exit(0); exit(1)}"; } + + # returns successfully if the string in the first argument matches the + # regex in the second + match() { echo "$1" | grep -E -q -- "$2"; } + + # make sure value is valid + if ! match "$v" "^$decimal$"; then + echo "${0##*/}: check_range: invalid value" >&2 + unset -f cmp match + return "$err" + fi + + # make sure range is valid + if ! match "$range" "^@?(~|$decimal)(:($decimal)?)?$"; then + echo "${0##*/}: check_range: invalid range" >&2 + unset -f cmp match + return "$err" + fi + + # check for leading @ char, which negates the range + if match $range '^@'; then + range=${range#@} + yes=1 + no=0 + fi + + # parse the range string + if ! match "$range" ':'; then + start=0 + end="$range" + else + start="${range%%:*}" + end="${range#*:}" + fi + + # do the comparison, taking positive ("") and negative infinity ("~") + # into account + if [ "$start" != "~" ] && [ "$end" != "" ]; then + if cmp "$start <= $v" && cmp "$v <= $end"; then + unset -f cmp match + return "$no" + else + unset -f cmp match + return "$yes" + fi + elif [ "$start" != "~" ] && [ "$end" = "" ]; then + if cmp "$start <= $v"; then + unset -f cmp match + return "$no" + else + unset -f cmp match + return "$yes" + fi + elif [ "$start" = "~" ] && [ "$end" != "" ]; then + if cmp "$v <= $end"; then + unset -f cmp match + return "$no" + else + unset -f cmp match + return "$yes" + fi + else + unset -f cmp match + return "$no" + fi +} |