diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
commit | a8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch) | |
tree | 77f0a30f016c0925cf7ee9292e644bba183c2774 /collectors/charts.d.plugin | |
parent | Adding upstream version 1.19.0. (diff) | |
download | netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip |
Adding upstream version 1.29.0.upstream/1.29.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin')
73 files changed, 585 insertions, 4920 deletions
diff --git a/collectors/charts.d.plugin/.keep b/collectors/charts.d.plugin/.keep deleted file mode 100644 index e69de29bb..000000000 --- a/collectors/charts.d.plugin/.keep +++ /dev/null diff --git a/collectors/charts.d.plugin/Makefile.am b/collectors/charts.d.plugin/Makefile.am index b3b2fb927..03c7f0a94 100644 --- a/collectors/charts.d.plugin/Makefile.am +++ b/collectors/charts.d.plugin/Makefile.am @@ -31,7 +31,6 @@ dist_charts_DATA = \ userchartsconfigdir=$(configdir)/charts.d dist_userchartsconfig_DATA = \ - .keep \ $(NULL) # Explicitly install directories to avoid permission issues due to umask @@ -43,22 +42,9 @@ dist_chartsconfig_DATA = \ $(NULL) include ap/Makefile.inc -include apache/Makefile.inc include apcupsd/Makefile.inc -include cpu_apps/Makefile.inc -include cpufreq/Makefile.inc include example/Makefile.inc -include exim/Makefile.inc -include hddtemp/Makefile.inc include libreswan/Makefile.inc -include load_average/Makefile.inc -include mem_apps/Makefile.inc -include mysql/Makefile.inc -include nginx/Makefile.inc include nut/Makefile.inc include opensips/Makefile.inc -include phpfpm/Makefile.inc -include postfix/Makefile.inc include sensors/Makefile.inc -include squid/Makefile.inc -include tomcat/Makefile.inc diff --git a/collectors/charts.d.plugin/Makefile.in b/collectors/charts.d.plugin/Makefile.in deleted file mode 100644 index dd19ca016..000000000 --- a/collectors/charts.d.plugin/Makefile.in +++ /dev/null @@ -1,1012 +0,0 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2017 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@ - -# SPDX-License-Identifier: GPL-3.0-or-later - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - - -VPATH = @srcdir@ -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 = collectors/charts.d.plugin -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/build/m4/ax_c___atomic.m4 \ - $(top_srcdir)/build/m4/ax_c__generic.m4 \ - $(top_srcdir)/build/m4/ax_c_lto.m4 \ - $(top_srcdir)/build/m4/ax_c_mallinfo.m4 \ - $(top_srcdir)/build/m4/ax_c_mallopt.m4 \ - $(top_srcdir)/build/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/build/m4/ax_gcc_func_attribute.m4 \ - $(top_srcdir)/build/m4/ax_pthread.m4 \ - $(top_srcdir)/build/m4/jemalloc.m4 \ - $(top_srcdir)/build/m4/tcmalloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(dist_charts_SCRIPTS) \ - $(dist_plugins_SCRIPTS) $(dist_charts_DATA) \ - $(dist_chartsconfig_DATA) $(dist_libconfig_DATA) \ - $(dist_noinst_DATA) $(dist_userchartsconfig_DATA) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -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)$(chartsdir)" "$(DESTDIR)$(pluginsdir)" \ - "$(DESTDIR)$(chartsdir)" "$(DESTDIR)$(chartsconfigdir)" \ - "$(DESTDIR)$(libconfigdir)" "$(DESTDIR)$(userchartsconfigdir)" -SCRIPTS = $(dist_charts_SCRIPTS) $(dist_plugins_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 -DATA = $(dist_charts_DATA) $(dist_chartsconfig_DATA) \ - $(dist_libconfig_DATA) $(dist_noinst_DATA) \ - $(dist_userchartsconfig_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ap/Makefile.inc \ - $(srcdir)/apache/Makefile.inc $(srcdir)/apcupsd/Makefile.inc \ - $(srcdir)/cpu_apps/Makefile.inc $(srcdir)/cpufreq/Makefile.inc \ - $(srcdir)/example/Makefile.inc $(srcdir)/exim/Makefile.inc \ - $(srcdir)/hddtemp/Makefile.inc \ - $(srcdir)/libreswan/Makefile.inc \ - $(srcdir)/load_average/Makefile.inc \ - $(srcdir)/mem_apps/Makefile.inc $(srcdir)/mysql/Makefile.inc \ - $(srcdir)/nginx/Makefile.inc $(srcdir)/nut/Makefile.inc \ - $(srcdir)/opensips/Makefile.inc $(srcdir)/phpfpm/Makefile.inc \ - $(srcdir)/postfix/Makefile.inc $(srcdir)/sensors/Makefile.inc \ - $(srcdir)/squid/Makefile.inc $(srcdir)/tomcat/Makefile.inc \ - $(top_srcdir)/build/subst.inc -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ -CMOCKA_LIBS = @CMOCKA_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CUPSCONFIG = @CUPSCONFIG@ -CXX = @CXX@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXX_BINARY = @CXX_BINARY@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENABLE_UNITTESTS = @ENABLE_UNITTESTS@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -IPMIMONITORING_CFLAGS = @IPMIMONITORING_CFLAGS@ -IPMIMONITORING_LIBS = @IPMIMONITORING_LIBS@ -JSON_CFLAGS = @JSON_CFLAGS@ -JSON_LIBS = @JSON_LIBS@ -LDFLAGS = @LDFLAGS@ -LIBCAP_CFLAGS = @LIBCAP_CFLAGS@ -LIBCAP_LIBS = @LIBCAP_LIBS@ -LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ -LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ -LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ -LIBCURL_LIBS = @LIBCURL_LIBS@ -LIBMNL_CFLAGS = @LIBMNL_CFLAGS@ -LIBMNL_LIBS = @LIBMNL_LIBS@ -LIBMONGOC_CFLAGS = @LIBMONGOC_CFLAGS@ -LIBMONGOC_LIBS = @LIBMONGOC_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSSL_CFLAGS = @LIBSSL_CFLAGS@ -LIBSSL_LIBS = @LIBSSL_LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MATH_CFLAGS = @MATH_CFLAGS@ -MATH_LIBS = @MATH_LIBS@ -MKDIR_P = @MKDIR_P@ -NFACCT_CFLAGS = @NFACCT_CFLAGS@ -NFACCT_LIBS = @NFACCT_LIBS@ -OBJEXT = @OBJEXT@ -OPTIONAL_CUPS_CFLAGS = @OPTIONAL_CUPS_CFLAGS@ -OPTIONAL_CUPS_LIBS = @OPTIONAL_CUPS_LIBS@ -OPTIONAL_IPMIMONITORING_CFLAGS = @OPTIONAL_IPMIMONITORING_CFLAGS@ -OPTIONAL_IPMIMONITORING_LIBS = @OPTIONAL_IPMIMONITORING_LIBS@ -OPTIONAL_JSONC_LIBS = @OPTIONAL_JSONC_LIBS@ -OPTIONAL_JUDY_LIBS = @OPTIONAL_JUDY_LIBS@ -OPTIONAL_KINESIS_CFLAGS = @OPTIONAL_KINESIS_CFLAGS@ -OPTIONAL_KINESIS_LIBS = @OPTIONAL_KINESIS_LIBS@ -OPTIONAL_LIBCAP_CFLAGS = @OPTIONAL_LIBCAP_CFLAGS@ -OPTIONAL_LIBCAP_LIBS = @OPTIONAL_LIBCAP_LIBS@ -OPTIONAL_LZ4_LIBS = @OPTIONAL_LZ4_LIBS@ -OPTIONAL_MATH_CFLAGS = @OPTIONAL_MATH_CFLAGS@ -OPTIONAL_MATH_LIBS = @OPTIONAL_MATH_LIBS@ -OPTIONAL_MONGOC_CFLAGS = @OPTIONAL_MONGOC_CFLAGS@ -OPTIONAL_MONGOC_LIBS = @OPTIONAL_MONGOC_LIBS@ -OPTIONAL_NFACCT_CFLAGS = @OPTIONAL_NFACCT_CFLAGS@ -OPTIONAL_NFACCT_LIBS = @OPTIONAL_NFACCT_LIBS@ -OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS = @OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS@ -OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS = @OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS@ -OPTIONAL_SSL_LIBS = @OPTIONAL_SSL_LIBS@ -OPTIONAL_UUID_CFLAGS = @OPTIONAL_UUID_CFLAGS@ -OPTIONAL_UUID_LIBS = @OPTIONAL_UUID_LIBS@ -OPTIONAL_UV_LIBS = @OPTIONAL_UV_LIBS@ -OPTIONAL_XENSTAT_CFLAGS = @OPTIONAL_XENSTAT_CFLAGS@ -OPTIONAL_XENSTAT_LIBS = @OPTIONAL_XENSTAT_LIBS@ -OPTIONAL_ZLIB_CFLAGS = @OPTIONAL_ZLIB_CFLAGS@ -OPTIONAL_ZLIB_LIBS = @OPTIONAL_ZLIB_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_RPM_VERSION = @PACKAGE_RPM_VERSION@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PROTOBUF_CFLAGS = @PROTOBUF_CFLAGS@ -PROTOBUF_LIBS = @PROTOBUF_LIBS@ -PROTOC = @PROTOC@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SSE_CANDIDATE = @SSE_CANDIDATE@ -STRIP = @STRIP@ -TEST_CFLAGS = @TEST_CFLAGS@ -TEST_LIBS = @TEST_LIBS@ -UUID_CFLAGS = @UUID_CFLAGS@ -UUID_LIBS = @UUID_LIBS@ -VERSION = @VERSION@ -XENLIGHT_CFLAGS = @XENLIGHT_CFLAGS@ -XENLIGHT_LIBS = @XENLIGHT_LIBS@ -YAJL_CFLAGS = @YAJL_CFLAGS@ -YAJL_LIBS = @YAJL_LIBS@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_pthread_config = @ax_pthread_config@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_target = @build_target@ -build_vendor = @build_vendor@ -builddir = @builddir@ -cachedir = @cachedir@ -chartsdir = @chartsdir@ -configdir = @configdir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -has_jemalloc = @has_jemalloc@ -has_tcmalloc = @has_tcmalloc@ -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@ -libconfigdir = @libconfigdir@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -logdir = @logdir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -nodedir = @nodedir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pluginsdir = @pluginsdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -registrydir = @registrydir@ -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@ -varlibdir = @varlibdir@ -webdir = @webdir@ -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in -CLEANFILES = \ - charts.d.plugin \ - $(NULL) - -SUFFIXES = .in -dist_libconfig_DATA = \ - charts.d.conf \ - $(NULL) - -dist_plugins_SCRIPTS = \ - charts.d.dryrun-helper.sh \ - charts.d.plugin \ - loopsleepms.sh.inc \ - $(NULL) - - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution - -# do not install these files, but include them in the distribution -dist_noinst_DATA = charts.d.plugin.in README.md $(NULL) ap/README.md \ - ap/Makefile.inc apache/README.md apache/Makefile.inc \ - apcupsd/README.md apcupsd/Makefile.inc cpu_apps/README.md \ - cpu_apps/Makefile.inc cpufreq/README.md cpufreq/Makefile.inc \ - example/README.md example/Makefile.inc exim/README.md \ - exim/Makefile.inc hddtemp/README.md hddtemp/Makefile.inc \ - libreswan/README.md libreswan/Makefile.inc \ - load_average/README.md load_average/Makefile.inc \ - mem_apps/README.md mem_apps/Makefile.inc mysql/README.md \ - mysql/Makefile.inc nginx/README.md nginx/Makefile.inc \ - nut/README.md nut/Makefile.inc opensips/README.md \ - opensips/Makefile.inc phpfpm/README.md phpfpm/Makefile.inc \ - postfix/README.md postfix/Makefile.inc sensors/README.md \ - sensors/Makefile.inc squid/README.md squid/Makefile.inc \ - tomcat/README.md tomcat/Makefile.inc -dist_charts_SCRIPTS = \ - $(NULL) - - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files - -# install these files -dist_charts_DATA = $(NULL) ap/ap.chart.sh apache/apache.chart.sh \ - apcupsd/apcupsd.chart.sh cpu_apps/cpu_apps.chart.sh \ - cpufreq/cpufreq.chart.sh example/example.chart.sh \ - exim/exim.chart.sh hddtemp/hddtemp.chart.sh \ - libreswan/libreswan.chart.sh \ - load_average/load_average.chart.sh mem_apps/mem_apps.chart.sh \ - mysql/mysql.chart.sh nginx/nginx.chart.sh nut/nut.chart.sh \ - opensips/opensips.chart.sh phpfpm/phpfpm.chart.sh \ - postfix/postfix.chart.sh sensors/sensors.chart.sh \ - squid/squid.chart.sh tomcat/tomcat.chart.sh -userchartsconfigdir = $(configdir)/charts.d -dist_userchartsconfig_DATA = \ - .keep \ - $(NULL) - -chartsconfigdir = $(libconfigdir)/charts.d -dist_chartsconfig_DATA = $(NULL) ap/ap.conf apache/apache.conf \ - apcupsd/apcupsd.conf cpu_apps/cpu_apps.conf \ - cpufreq/cpufreq.conf example/example.conf exim/exim.conf \ - hddtemp/hddtemp.conf libreswan/libreswan.conf \ - load_average/load_average.conf mem_apps/mem_apps.conf \ - mysql/mysql.conf nginx/nginx.conf nut/nut.conf \ - opensips/opensips.conf phpfpm/phpfpm.conf postfix/postfix.conf \ - sensors/sensors.conf squid/squid.conf tomcat/tomcat.conf -all: all-am - -.SUFFIXES: -.SUFFIXES: .in -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/subst.inc $(srcdir)/ap/Makefile.inc $(srcdir)/apache/Makefile.inc $(srcdir)/apcupsd/Makefile.inc $(srcdir)/cpu_apps/Makefile.inc $(srcdir)/cpufreq/Makefile.inc $(srcdir)/example/Makefile.inc $(srcdir)/exim/Makefile.inc $(srcdir)/hddtemp/Makefile.inc $(srcdir)/libreswan/Makefile.inc $(srcdir)/load_average/Makefile.inc $(srcdir)/mem_apps/Makefile.inc $(srcdir)/mysql/Makefile.inc $(srcdir)/nginx/Makefile.inc $(srcdir)/nut/Makefile.inc $(srcdir)/opensips/Makefile.inc $(srcdir)/phpfpm/Makefile.inc $(srcdir)/postfix/Makefile.inc $(srcdir)/sensors/Makefile.inc $(srcdir)/squid/Makefile.inc $(srcdir)/tomcat/Makefile.inc $(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 collectors/charts.d.plugin/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu collectors/charts.d.plugin/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__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; -$(top_srcdir)/build/subst.inc $(srcdir)/ap/Makefile.inc $(srcdir)/apache/Makefile.inc $(srcdir)/apcupsd/Makefile.inc $(srcdir)/cpu_apps/Makefile.inc $(srcdir)/cpufreq/Makefile.inc $(srcdir)/example/Makefile.inc $(srcdir)/exim/Makefile.inc $(srcdir)/hddtemp/Makefile.inc $(srcdir)/libreswan/Makefile.inc $(srcdir)/load_average/Makefile.inc $(srcdir)/mem_apps/Makefile.inc $(srcdir)/mysql/Makefile.inc $(srcdir)/nginx/Makefile.inc $(srcdir)/nut/Makefile.inc $(srcdir)/opensips/Makefile.inc $(srcdir)/phpfpm/Makefile.inc $(srcdir)/postfix/Makefile.inc $(srcdir)/sensors/Makefile.inc $(srcdir)/squid/Makefile.inc $(srcdir)/tomcat/Makefile.inc $(am__empty): - -$(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): -install-dist_chartsSCRIPTS: $(dist_charts_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_charts_SCRIPTS)'; test -n "$(chartsdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(chartsdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(chartsdir)" || 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)$(chartsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(chartsdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_chartsSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_charts_SCRIPTS)'; test -n "$(chartsdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(chartsdir)'; $(am__uninstall_files_from_dir) -install-dist_pluginsSCRIPTS: $(dist_plugins_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_plugins_SCRIPTS)'; test -n "$(pluginsdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pluginsdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pluginsdir)" || 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)$(pluginsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pluginsdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_pluginsSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_plugins_SCRIPTS)'; test -n "$(pluginsdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(pluginsdir)'; $(am__uninstall_files_from_dir) -install-dist_chartsDATA: $(dist_charts_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_charts_DATA)'; test -n "$(chartsdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(chartsdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(chartsdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(chartsdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(chartsdir)" || exit $$?; \ - done - -uninstall-dist_chartsDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_charts_DATA)'; test -n "$(chartsdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(chartsdir)'; $(am__uninstall_files_from_dir) -install-dist_chartsconfigDATA: $(dist_chartsconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_chartsconfig_DATA)'; test -n "$(chartsconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(chartsconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(chartsconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(chartsconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(chartsconfigdir)" || exit $$?; \ - done - -uninstall-dist_chartsconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_chartsconfig_DATA)'; test -n "$(chartsconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(chartsconfigdir)'; $(am__uninstall_files_from_dir) -install-dist_libconfigDATA: $(dist_libconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_libconfig_DATA)'; test -n "$(libconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(libconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(libconfigdir)" || exit $$?; \ - done - -uninstall-dist_libconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_libconfig_DATA)'; test -n "$(libconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(libconfigdir)'; $(am__uninstall_files_from_dir) -install-dist_userchartsconfigDATA: $(dist_userchartsconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_userchartsconfig_DATA)'; test -n "$(userchartsconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(userchartsconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(userchartsconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(userchartsconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(userchartsconfigdir)" || exit $$?; \ - done - -uninstall-dist_userchartsconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_userchartsconfig_DATA)'; test -n "$(userchartsconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(userchartsconfigdir)'; $(am__uninstall_files_from_dir) -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(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 -check: check-am -all-am: Makefile $(SCRIPTS) $(DATA) -installdirs: - for dir in "$(DESTDIR)$(chartsdir)" "$(DESTDIR)$(pluginsdir)" "$(DESTDIR)$(chartsdir)" "$(DESTDIR)$(chartsconfigdir)" "$(DESTDIR)$(libconfigdir)" "$(DESTDIR)$(userchartsconfigdir)"; 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: - -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." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic 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-dist_chartsDATA install-dist_chartsSCRIPTS \ - install-dist_chartsconfigDATA install-dist_libconfigDATA \ - install-dist_pluginsSCRIPTS install-dist_userchartsconfigDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-exec-local - -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 - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-dist_chartsDATA uninstall-dist_chartsSCRIPTS \ - uninstall-dist_chartsconfigDATA uninstall-dist_libconfigDATA \ - uninstall-dist_pluginsSCRIPTS \ - uninstall-dist_userchartsconfigDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ - ctags-am distclean distclean-generic distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_chartsDATA \ - install-dist_chartsSCRIPTS install-dist_chartsconfigDATA \ - install-dist_libconfigDATA install-dist_pluginsSCRIPTS \ - install-dist_userchartsconfigDATA install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-local install-html \ - install-html-am install-info install-info-am 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 pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-dist_chartsDATA \ - uninstall-dist_chartsSCRIPTS uninstall-dist_chartsconfigDATA \ - uninstall-dist_libconfigDATA uninstall-dist_pluginsSCRIPTS \ - uninstall-dist_userchartsconfigDATA - -.PRECIOUS: Makefile - -.in: - if sed \ - -e 's#[@]localstatedir_POST@#$(localstatedir)#g' \ - -e 's#[@]sbindir_POST@#$(sbindir)#g' \ - -e 's#[@]pluginsdir_POST@#$(pluginsdir)#g' \ - -e 's#[@]configdir_POST@#$(configdir)#g' \ - -e 's#[@]libconfigdir_POST@#$(libconfigdir)#g' \ - -e 's#[@]cachedir_POST@#$(cachedir)#g' \ - -e 's#[@]registrydir_POST@#$(registrydir)#g' \ - -e 's#[@]varlibdir_POST@#$(varlibdir)#g' \ - $< > $@.tmp; then \ - mv "$@.tmp" "$@"; \ - else \ - rm -f "$@.tmp"; \ - false; \ - fi - -# Explicitly install directories to avoid permission issues due to umask -install-exec-local: - $(INSTALL) -d $(DESTDIR)$(userchartsconfigdir) - -# 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/collectors/charts.d.plugin/README.md b/collectors/charts.d.plugin/README.md index 6bd115f30..4a7911a60 100644 --- a/collectors/charts.d.plugin/README.md +++ b/collectors/charts.d.plugin/README.md @@ -1,3 +1,8 @@ +<!-- +title: "charts.d.plugin" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/README.md +--> + # charts.d.plugin `charts.d.plugin` is a Netdata external plugin. It is an **orchestrator** for data collection modules written in `BASH` v4+. @@ -55,11 +60,11 @@ For a module called `X`, the following criteria must be met: the collector cannot be used). - `X_create()` - creates the Netdata charts, following the standard Netdata plugin guides as described in - **[External Plugins](../plugins.d/)** (commands `CHART` and `DIMENSION`). + **[External Plugins](/collectors/plugins.d/README.md)** (commands `CHART` and `DIMENSION`). The return value does matter: 0 = OK, 1 = FAILED. - `X_update()` - collects the values for the defined charts, following the standard Netdata plugin guides - as described in **[External Plugins](../plugins.d/)** (commands `BEGIN`, `SET`, `END`). + as described in **[External Plugins](/collectors/plugins.d/README.md)** (commands `BEGIN`, `SET`, `END`). The return value also matters: 0 = OK, 1 = FAILED. 5. The following global variables are available to be set: @@ -67,7 +72,7 @@ For a module called `X`, the following criteria must be met: The module script may use more functions or variables. But all of them must begin with `X_`. -The standard Netdata plugin variables are also available (check **[External Plugins](../plugins.d/)**). +The standard Netdata plugin variables are also available (check **[External Plugins](/collectors/plugins.d/README.md)**). ### X_check() @@ -81,7 +86,7 @@ connect to a local mysql database to find out if it can read the values it needs ### X_create() The purpose of the BASH function `X_create()` is to create the charts and dimensions using the standard Netdata -plugin guides (**[External Plugins](../plugins.d/)**). +plugin guides (**[External Plugins](/collectors/plugins.d/README.md)**). `X_create()` will be called just once and only after `X_check()` was successful. You can however call it yourself when there is need for it (for example to add a new dimension to an existing chart). @@ -91,7 +96,7 @@ A non-zero return value will disable the collector. ### X_update() `X_update()` will be called repeatedly every `X_update_every` seconds, to collect new values and send them to Netdata, -following the Netdata plugin guides (**[External Plugins](../plugins.d/)**). +following the Netdata plugin guides (**[External Plugins](/collectors/plugins.d/README.md)**). The function will be called with one parameter: microseconds since the last time it was run. This value should be appended to the `BEGIN` statement of every chart updated by the collector script. diff --git a/collectors/charts.d.plugin/ap/README.md b/collectors/charts.d.plugin/ap/README.md index befe21eec..35a00d65d 100644 --- a/collectors/charts.d.plugin/ap/README.md +++ b/collectors/charts.d.plugin/ap/README.md @@ -1,4 +1,10 @@ -# Access Point Plugin (ap) +<!-- +title: "Access point monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/ap/README.md +sidebar_label: "Access points" +--> + +# Access point monitoring with Netdata The `ap` collector visualizes data related to access points. @@ -76,8 +82,15 @@ Station 40:b8:37:5a:ed:5e (on wlan0) ## Configuration -You can only set `ap_update_every=NUMBER` to `/etc/netdata/charts.d/ap.conf`, to give the data collection frequency. -To edit this file on your system run `/etc/netdata/edit-config charts.d/ap.conf`. +Edit the `charts.d/ap.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/ap.conf +``` + +You can only set `ap_update_every=NUMBER` to change the data collection frequency. ## Auto-detection diff --git a/collectors/charts.d.plugin/ap/ap.chart.sh b/collectors/charts.d.plugin/ap/ap.chart.sh index a2d04c0a7..5dd787835 100644 --- a/collectors/charts.d.plugin/ap/ap.chart.sh +++ b/collectors/charts.d.plugin/ap/ap.chart.sh @@ -16,9 +16,9 @@ declare -A ap_devs=() # _check is called once, to find out if this chart should be enabled or not ap_check() { - require_cmd iw || return 1 - local ev - ev=$(run iw dev | awk ' + require_cmd iw || return 1 + local ev + ev=$(run iw dev | awk ' BEGIN { i = ""; ssid = ""; @@ -41,26 +41,26 @@ ap_check() { } } ') - eval "${ev}" + eval "${ev}" - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart - [ ${#ap_devs[@]} -gt 0 ] && return 0 - error "no devices found in AP mode, with 'iw dev'" - return 1 + [ ${#ap_devs[@]} -gt 0 ] && return 0 + error "no devices found in AP mode, with 'iw dev'" + return 1 } # _create is called once, to create the charts ap_create() { - local ssid dev + local ssid dev - for dev in "${!ap_devs[@]}"; do - ssid="${ap_devs[${dev}]}" + for dev in "${!ap_devs[@]}"; do + ssid="${ap_devs[${dev}]}" - # create the chart with 3 dimensions - cat <<EOF + # create the chart with 3 dimensions + cat << EOF CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ap.clients line $((ap_priority + 1)) $ap_update_every DIMENSION clients '' absolute 1 1 @@ -84,25 +84,25 @@ DIMENSION receive '' absolute 1 1000 DIMENSION transmit '' absolute -1 1000 DIMENSION expected 'expected throughput' absolute 1 1000 EOF - done + done - return 0 + return 0 } # _update is called continuously, to collect the values ap_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - for dev in "${!ap_devs[@]}"; do - echo - echo "DEVICE ${dev}" - iw "${dev}" station dump - done | awk ' + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). + + # do all the work to collect / calculate the values + # for each dimension + # remember: KEEP IT SIMPLE AND SHORT + + for dev in "${!ap_devs[@]}"; do + echo + echo "DEVICE ${dev}" + iw "${dev}" station dump + done | awk ' function zero_data() { dev = ""; c = 0; @@ -175,5 +175,5 @@ ap_update() { } ' - return 0 + return 0 } diff --git a/collectors/charts.d.plugin/apache/Makefile.inc b/collectors/charts.d.plugin/apache/Makefile.inc deleted file mode 100644 index 4b360eae0..000000000 --- a/collectors/charts.d.plugin/apache/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += apache/apache.chart.sh -dist_chartsconfig_DATA += apache/apache.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += apache/README.md apache/Makefile.inc - diff --git a/collectors/charts.d.plugin/apache/README.md b/collectors/charts.d.plugin/apache/README.md deleted file mode 100644 index 53f02a5b8..000000000 --- a/collectors/charts.d.plugin/apache/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# Apache - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/apache) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - ---- - -The `apache` collector visualizes key performance data for an apache web server. - -## Example Netdata charts - -For apache 2.2: - -![image](https://cloud.githubusercontent.com/assets/2662304/12530273/421c4d14-c1e2-11e5-9fb6-ca6d6dd3b1dd.png) - -For apache 2.4: - -![image](https://cloud.githubusercontent.com/assets/2662304/12530376/29ec26de-c1e6-11e5-9af1-e48aaf781795.png) - -## How it works - -It runs `curl "http://apache.host/server-status?auto` to fetch the current status of apache. - -It has been tested with apache 2.2 and apache 2.4. The latter also provides connections information (total and break down by status). - -Apache 2.2 response: - -```sh -curl "http://127.0.0.1/server-status?auto" -Total Accesses: 80057 -Total kBytes: 223017 -CPULoad: .018287 -Uptime: 64472 -ReqPerSec: 1.24173 -BytesPerSec: 3542.15 -BytesPerReq: 2852.59 -BusyWorkers: 1 -IdleWorkers: 49 -Scoreboard: _________________________......................................._W_______________________....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... -``` - -Apache 2.4 response: - -```sh -curl "http://127.0.0.1/server-status?auto" -127.0.0.1 -ServerVersion: Apache/2.4.18 (Unix) -ServerMPM: event -Server Built: Dec 14 2015 08:05:54 -CurrentTime: Saturday, 23-Jan-2016 14:42:06 EET -RestartTime: Saturday, 23-Jan-2016 04:57:13 EET -ParentServerConfigGeneration: 2 -ParentServerMPMGeneration: 1 -ServerUptimeSeconds: 35092 -ServerUptime: 9 hours 44 minutes 52 seconds -Load1: 0.32 -Load5: 0.32 -Load15: 0.27 -Total Accesses: 32403 -Total kBytes: 34464 -CPUUser: 30.37 -CPUSystem: 29.55 -CPUChildrenUser: 0 -CPUChildrenSystem: 0 -CPULoad: .170751 -Uptime: 35092 -ReqPerSec: .923373 -BytesPerSec: 1005.67 -BytesPerReq: 1089.13 -BusyWorkers: 1 -IdleWorkers: 99 -ConnsTotal: 0 -ConnsAsyncWriting: 0 -ConnsAsyncKeepAlive: 0 -ConnsAsyncClosing: 0 -Scoreboard: __________________________________________________________________________________________W_________............................................................................................................................................................................................................................................................................................................ -``` - -From the apache status output it collects: - -- total accesses (incremental value, rendered as requests/s) -- total bandwidth (incremental value, rendered as bandwidth/s) -- requests per second (this appears to be calculated by apache as an average for its lifetime, while the one calculated by Netdata using the total accesses counter is real-time) -- bytes per second (average for the lifetime of the apache server) -- bytes per request (average for the lifetime of the apache server) -- workers by status (`busy` and `idle`) -- total connections (currently active connections - offered by apache 2.4+) -- async connections per status (`keepalive`, `writing`, `closing` - offered by apache 2.4+) - -## Configuration - -The configuration is stored in `/etc/netdata/charts.d/apache.conf`. -To edit this file on your system run `/etc/netdata/edit-config charts.d/apache.conf`. - -The internal default is: - -```sh -# the URL your apache server is responding with mod_status information. -apache_url="http://127.0.0.1:80/server-status?auto" - -# use this to set custom curl options you may need -apache_curl_opts= - -# set this to a NUMBER to overwrite the update frequency -# it is in seconds -apache_update_every= -``` - -The default `apache_update_every` is configured in Netdata. - -## Auto-detection - -If you have configured your apache server to offer server-status information on localhost clients, the defaults should work fine. - -## Apache Configuration - -Apache configuration differs between distributions. Please check your distribution's documentation for information on enabling apache's `mod_status` module. - -If you are able to run successfully, by hand this command: - -```sh -curl "http://127.0.0.1:80/server-status?auto" -``` - -Netdata will be able to do it too. - -Notice: You may need to have the default `000-default.conf` website enabled in order for the status mod to work. - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fapache%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/apache/apache.chart.sh b/collectors/charts.d.plugin/apache/apache.chart.sh deleted file mode 100644 index 7d09ee676..000000000 --- a/collectors/charts.d.plugin/apache/apache.chart.sh +++ /dev/null @@ -1,251 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -# the URL to download apache status info -apache_url="http://127.0.0.1:80/server-status?auto" -apache_curl_opts= - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -apache_update_every= - -apache_priority=60000 - -# convert apache floating point values -# to integer using this multiplier -# this only affects precision - the values -# will be in the proper units -apache_decimal_detail=1000000 - -declare -a apache_response=() -apache_accesses=0 -apache_kbytes=0 -apache_reqpersec=0 -apache_bytespersec=0 -apache_bytesperreq=0 -apache_busyworkers=0 -apache_idleworkers=0 -apache_connstotal=0 -apache_connsasyncwriting=0 -apache_connsasynckeepalive=0 -apache_connsasyncclosing=0 - -apache_keys_detected=0 -apache_has_conns=0 -apache_key_accesses= -apache_key_kbytes= -apache_key_reqpersec= -apache_key_bytespersec= -apache_key_bytesperreq= -apache_key_busyworkers= -apache_key_idleworkers= -apache_key_scoreboard= -apache_key_connstotal= -apache_key_connsasyncwriting= -apache_key_connsasynckeepalive= -apache_key_connsasyncclosing= -apache_detect() { - local i=0 - for x in "${@}"; do - case "${x}" in - 'Total Accesses') apache_key_accesses=$((i + 1)) ;; - 'Total kBytes') apache_key_kbytes=$((i + 1)) ;; - 'ReqPerSec') apache_key_reqpersec=$((i + 1)) ;; - 'BytesPerSec') apache_key_bytespersec=$((i + 1)) ;; - 'BytesPerReq') apache_key_bytesperreq=$((i + 1)) ;; - 'BusyWorkers') apache_key_busyworkers=$((i + 1)) ;; - 'IdleWorkers') apache_key_idleworkers=$((i + 1)) ;; - 'ConnsTotal') apache_key_connstotal=$((i + 1)) ;; - 'ConnsAsyncWriting') apache_key_connsasyncwriting=$((i + 1)) ;; - 'ConnsAsyncKeepAlive') apache_key_connsasynckeepalive=$((i + 1)) ;; - 'ConnsAsyncClosing') apache_key_connsasyncclosing=$((i + 1)) ;; - 'Scoreboard') apache_key_scoreboard=$((i)) ;; - esac - - i=$((i + 1)) - done - - # we will not check of the Conns* - # keys, since these are apache 2.4 specific - [ -z "${apache_key_accesses}" ] && error "missing 'Total Accesses' from apache server: ${*}" && return 1 - [ -z "${apache_key_kbytes}" ] && error "missing 'Total kBytes' from apache server: ${*}" && return 1 - [ -z "${apache_key_reqpersec}" ] && error "missing 'ReqPerSec' from apache server: ${*}" && return 1 - [ -z "${apache_key_bytespersec}" ] && error "missing 'BytesPerSec' from apache server: ${*}" && return 1 - [ -z "${apache_key_bytesperreq}" ] && error "missing 'BytesPerReq' from apache server: ${*}" && return 1 - [ -z "${apache_key_busyworkers}" ] && error "missing 'BusyWorkers' from apache server: ${*}" && return 1 - [ -z "${apache_key_idleworkers}" ] && error "missing 'IdleWorkers' from apache server: ${*}" && return 1 - [ -z "${apache_key_scoreboard}" ] && error "missing 'Scoreboard' from apache server: ${*}" && return 1 - - if [ ! -z "${apache_key_connstotal}" ] && - [ ! -z "${apache_key_connsasyncwriting}" ] && - [ ! -z "${apache_key_connsasynckeepalive}" ] && - [ ! -z "${apache_key_connsasyncclosing}" ]; then - apache_has_conns=1 - else - apache_has_conns=0 - fi - - return 0 -} - -apache_get() { - local oIFS="${IFS}" ret - # shellcheck disable=2207 - IFS=$':\n' apache_response=($(run curl -Ss ${apache_curl_opts} "${apache_url}")) - ret=$? - IFS="${oIFS}" - - if [ $ret -ne 0 ] || [ "${#apache_response[@]}" -eq 0 ]; then - return 1 - fi - - # the last line on the apache output is "Scoreboard" - # we use this label to detect that the output has a new word count - if [ ${apache_keys_detected} -eq 0 ] || [ "${apache_response[${apache_key_scoreboard}]}" != "Scoreboard" ]; then - apache_detect "${apache_response[@]}" || return 1 - apache_keys_detected=1 - fi - - apache_accesses="${apache_response[${apache_key_accesses}]}" - apache_kbytes="${apache_response[${apache_key_kbytes}]}" - - float2int "${apache_response[${apache_key_reqpersec}]}" ${apache_decimal_detail} - apache_reqpersec=${FLOAT2INT_RESULT} - - float2int "${apache_response[${apache_key_bytespersec}]}" ${apache_decimal_detail} - apache_bytespersec=${FLOAT2INT_RESULT} - - float2int "${apache_response[${apache_key_bytesperreq}]}" ${apache_decimal_detail} - apache_bytesperreq=${FLOAT2INT_RESULT} - - apache_busyworkers="${apache_response[${apache_key_busyworkers}]}" - apache_idleworkers="${apache_response[${apache_key_idleworkers}]}" - - if - [ -z "${apache_accesses}" ] || - [ -z "${apache_kbytes}" ] || - [ -z "${apache_reqpersec}" ] || - [ -z "${apache_bytespersec}" ] || - [ -z "${apache_bytesperreq}" ] || - [ -z "${apache_busyworkers}" ] - [ -z "${apache_idleworkers}" ] - then - error "empty values got from apache server: ${apache_response[*]}" - return 1 - fi - - if [ ${apache_has_conns} -eq 1 ]; then - apache_connstotal="${apache_response[${apache_key_connstotal}]}" - apache_connsasyncwriting="${apache_response[${apache_key_connsasyncwriting}]}" - apache_connsasynckeepalive="${apache_response[${apache_key_connsasynckeepalive}]}" - apache_connsasyncclosing="${apache_response[${apache_key_connsasyncclosing}]}" - fi - - return 0 -} - -# _check is called once, to find out if this chart should be enabled or not -apache_check() { - - apache_get - # shellcheck disable=2181 - if [ $? -ne 0 ]; then - # shellcheck disable=2154 - error "cannot find stub_status on URL '${apache_url}'. Please set apache_url='http://apache.server:80/server-status?auto' in $confd/apache.conf" - return 1 - fi - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - return 0 -} - -# _create is called once, to create the charts -apache_create() { - cat <<EOF -CHART apache_local.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" statistics apache.bytesperreq area $((apache_priority + 8)) $apache_update_every -DIMENSION size '' absolute 1 ${apache_decimal_detail} -CHART apache_local.workers '' "apache Workers" "workers" workers apache.workers stacked $((apache_priority + 5)) $apache_update_every -DIMENSION idle '' absolute 1 1 -DIMENSION busy '' absolute 1 1 -CHART apache_local.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" statistics apache.reqpersec line $((apache_priority + 6)) $apache_update_every -DIMENSION requests '' absolute 1 ${apache_decimal_detail} -CHART apache_local.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" statistics apache.bytespersec area $((apache_priority + 7)) $apache_update_every -DIMENSION sent '' absolute 8 $((apache_decimal_detail * 1000)) -CHART apache_local.requests '' "apache Requests" "requests/s" requests apache.requests line $((apache_priority + 1)) $apache_update_every -DIMENSION requests '' incremental 1 1 -CHART apache_local.net '' "apache Bandwidth" "kilobits/s" bandwidth apache.net area $((apache_priority + 3)) $apache_update_every -DIMENSION sent '' incremental 8 1 -EOF - - if [ ${apache_has_conns} -eq 1 ]; then - cat <<EOF2 -CHART apache_local.connections '' "apache Connections" "connections" connections apache.connections line $((apache_priority + 2)) $apache_update_every -DIMENSION connections '' absolute 1 1 -CHART apache_local.conns_async '' "apache Async Connections" "connections" connections apache.conns_async stacked $((apache_priority + 4)) $apache_update_every -DIMENSION keepalive '' absolute 1 1 -DIMENSION closing '' absolute 1 1 -DIMENSION writing '' absolute 1 1 -EOF2 - fi - - return 0 -} - -# _update is called continuously, to collect the values -apache_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - apache_get || return 1 - - # write the result of the work. - cat <<VALUESEOF -BEGIN apache_local.requests $1 -SET requests = $((apache_accesses)) -END -BEGIN apache_local.net $1 -SET sent = $((apache_kbytes)) -END -BEGIN apache_local.reqpersec $1 -SET requests = $((apache_reqpersec)) -END -BEGIN apache_local.bytespersec $1 -SET sent = $((apache_bytespersec)) -END -BEGIN apache_local.bytesperreq $1 -SET size = $((apache_bytesperreq)) -END -BEGIN apache_local.workers $1 -SET idle = $((apache_idleworkers)) -SET busy = $((apache_busyworkers)) -END -VALUESEOF - - if [ ${apache_has_conns} -eq 1 ]; then - cat <<VALUESEOF2 -BEGIN apache_local.connections $1 -SET connections = $((apache_connstotal)) -END -BEGIN apache_local.conns_async $1 -SET keepalive = $((apache_connsasynckeepalive)) -SET closing = $((apache_connsasyncclosing)) -SET writing = $((apache_connsasyncwriting)) -END -VALUESEOF2 - fi - - return 0 -} diff --git a/collectors/charts.d.plugin/apache/apache.conf b/collectors/charts.d.plugin/apache/apache.conf deleted file mode 100644 index 50914cf32..000000000 --- a/collectors/charts.d.plugin/apache/apache.conf +++ /dev/null @@ -1,30 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -# the URL to download apache status info -#apache_url="http://127.0.0.1:80/server-status?auto" -#apache_curl_opts= - -# convert apache floating point values -# to integer using this multiplier -# this only affects precision - the values -# will be in the proper units -#apache_decimal_detail=1000000 - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#apache_update_every= - -# the charts priority on the dashboard -#apache_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#apache_retries=10 diff --git a/collectors/charts.d.plugin/apcupsd/README.md b/collectors/charts.d.plugin/apcupsd/README.md index 51bb6eccd..b5b41e84d 100644 --- a/collectors/charts.d.plugin/apcupsd/README.md +++ b/collectors/charts.d.plugin/apcupsd/README.md @@ -1,7 +1,21 @@ -# apcupsd +<!-- +title: "APC UPS monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/apcupsd/README.md +sidebar_label: "APC UPS" +--> -_Under construction_ +# APC UPS monitoring with Netdata -Collects UPS metrics +Monitors different APC UPS models and retrieves status information using `apcaccess` tool. + +## Configuration + +Edit the `charts.d/apcupsd.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/apcupsd.conf +``` [![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fapcupsd%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh index 31ff93160..014a9c1de 100644 --- a/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh +++ b/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh @@ -11,7 +11,7 @@ apcupsd_ip= apcupsd_port= declare -A apcupsd_sources=( - ["local"]="127.0.0.1:3551" + ["local"]="127.0.0.1:3551" ) # how frequently to collect UPS data @@ -23,55 +23,63 @@ apcupsd_timeout=3 apcupsd_priority=90000 apcupsd_get() { - run -t $apcupsd_timeout apcaccess status "$1" + run -t $apcupsd_timeout apcaccess status "$1" +} + +is_ups_alive() { + local status + status="$(apcupsd_get "$1" | sed -e 's/STATUS.*: //' -e 't' -e 'd')" + case "$status" in + "" | "COMMLOST" | "SHUTTING DOWN") return 1 ;; + *) return 0 ;; + esac } apcupsd_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - require_cmd apcaccess || return 1 - - # backwards compatibility - if [ "${apcupsd_ip}:${apcupsd_port}" != ":" ]; then - apcupsd_sources["local"]="${apcupsd_ip}:${apcupsd_port}" - fi - - local host working=0 failed=0 - for host in "${!apcupsd_sources[@]}"; do - run apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null - # shellcheck disable=2181 - if [ $? -ne 0 ]; then - error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}." - failed=$((failed + 1)) - else - apcupsd_status="$(apcupsd_get ${apcupsd_sources[${host}]} | awk '/^STATUS.*/{ print $3 }')" - if [ "${apcupsd_status}" != "ONLINE" ] && [ "${apcupsd_status}" != "ONBATT" ]; then - error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online." - failed=$((failed + 1)) - else - working=$((working + 1)) - fi - fi - done - - if [ ${working} -eq 0 ]; then - error "No APC UPSes found available." - return 1 - fi - - return 0 + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart + + require_cmd apcaccess || return 1 + + # backwards compatibility + if [ "${apcupsd_ip}:${apcupsd_port}" != ":" ]; then + apcupsd_sources["local"]="${apcupsd_ip}:${apcupsd_port}" + fi + + local host working=0 failed=0 + for host in "${!apcupsd_sources[@]}"; do + run apcupsd_get "${apcupsd_sources[${host}]}" > /dev/null + # shellcheck disable=2181 + if [ $? -ne 0 ]; then + error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}." + failed=$((failed + 1)) + else + if ! is_ups_alive ${apcupsd_sources[${host}]}; then + error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online." + failed=$((failed + 1)) + else + working=$((working + 1)) + fi + fi + done + + if [ ${working} -eq 0 ]; then + error "No APC UPSes found available." + return 1 + fi + + return 0 } apcupsd_create() { - local host src - for host in "${!apcupsd_sources[@]}"; do - src=${apcupsd_sources[${host}]} + local host src + for host in "${!apcupsd_sources[@]}"; do + src=${apcupsd_sources[${host}]} - # create the charts - cat <<EOF + # create the charts + cat << EOF CHART apcupsd_${host}.charge '' "UPS Charge for ${host} on ${src}" "percentage" ups apcupsd.charge area $((apcupsd_priority + 1)) $apcupsd_update_every DIMENSION battery_charge charge absolute 1 100 @@ -104,21 +112,21 @@ CHART apcupsd_${host}.online '' "UPS ONLINE flag for ${host} on ${src}" "boolean DIMENSION online online absolute 0 1 EOF - done - return 0 + done + return 0 } apcupsd_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT + # do all the work to collect / calculate the values + # for each dimension + # remember: KEEP IT SIMPLE AND SHORT - local host working=0 failed=0 - for host in "${!apcupsd_sources[@]}"; do - apcupsd_get "${apcupsd_sources[${host}]}" | awk " + local host working=0 failed=0 + for host in "${!apcupsd_sources[@]}"; do + apcupsd_get "${apcupsd_sources[${host}]}" | awk " BEGIN { battery_charge = 0; @@ -190,16 +198,16 @@ END { print \"END\" } }" - # shellcheck disable=SC2181 - if [ $? -ne 0 ]; then - failed=$((failed + 1)) - error "failed to get values for APC UPS ${host} on ${apcupsd_sources[${host}]}" && return 1 - else - working=$((working + 1)) - fi - done - - [ $working -eq 0 ] && error "failed to get values from all APC UPSes" && return 1 - - return 0 + # shellcheck disable=SC2181 + if [ $? -ne 0 ]; then + failed=$((failed + 1)) + error "failed to get values for APC UPS ${host} on ${apcupsd_sources[${host}]}" && return 1 + else + working=$((working + 1)) + fi + done + + [ $working -eq 0 ] && error "failed to get values from all APC UPSes" && return 1 + + return 0 } diff --git a/collectors/charts.d.plugin/charts.d.conf b/collectors/charts.d.plugin/charts.d.conf index 94c40cf6f..d6add5e5b 100644 --- a/collectors/charts.d.plugin/charts.d.conf +++ b/collectors/charts.d.plugin/charts.d.conf @@ -45,21 +45,3 @@ # Nothing useful. # Just an example charts.d plugin you can use as a template. # example=force - -# OLD MODULES THAT ARE NOW SERVED BY python.d.plugin -# apache=force -# cpufreq=force -# exim=force -# hddtemp=force -# mysql=force -# nginx=force -# phpfpm=force -# postfix=force -# sensors=force -# squid=force -# tomcat=force - -# OLD MODULES THAT ARE NOW SERVED BY NETDATA DAEMON -# cpu_apps=force -# mem_apps=force -# load_average=force diff --git a/collectors/charts.d.plugin/charts.d.plugin b/collectors/charts.d.plugin/charts.d.plugin deleted file mode 100644 index 40dc48c15..000000000 --- a/collectors/charts.d.plugin/charts.d.plugin +++ /dev/null @@ -1,698 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2017 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ -# -# charts.d.plugin allows easy development of BASH plugins -# -# if you need to run parallel charts.d processes, link this file to a different name -# in the same directory, with a .plugin suffix and netdata will start both of them, -# each will have a different config file and modules configuration directory. -# - -export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -PROGRAM_FILE="$0" -PROGRAM_NAME="$(basename $0)" -PROGRAM_NAME="${PROGRAM_NAME/.plugin/}" -MODULE_NAME="main" - -# ----------------------------------------------------------------------------- -# create temp dir - -debug=0 -TMP_DIR= -chartsd_cleanup() { - trap '' EXIT QUIT HUP INT TERM - - if [ ! -z "$TMP_DIR" -a -d "$TMP_DIR" ]; then - [ $debug -eq 1 ] && echo >&2 "$PROGRAM_NAME: cleaning up temporary directory $TMP_DIR ..." - rm -rf "$TMP_DIR" - fi - exit 0 -} -trap chartsd_cleanup EXIT QUIT HUP INT TERM - -if [ $UID = "0" ]; then - TMP_DIR="$(mktemp -d /var/run/netdata-${PROGRAM_NAME}-XXXXXXXXXX)" -else - TMP_DIR="$(mktemp -d /tmp/.netdata-${PROGRAM_NAME}-XXXXXXXXXX)" -fi - -logdate() { - date "+%Y-%m-%d %H:%M:%S" -} - -log() { - local status="${1}" - shift - - echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${MODULE_NAME}: ${*}" - -} - -warning() { - log WARNING "${@}" -} - -error() { - log ERROR "${@}" -} - -info() { - log INFO "${@}" -} - -fatal() { - log FATAL "${@}" - echo "DISABLE" - exit 1 -} - -debug() { - [ $debug -eq 1 ] && log DEBUG "${@}" -} - -# ----------------------------------------------------------------------------- -# check a few commands - -require_cmd() { - local x=$(which "${1}" 2>/dev/null || command -v "${1}" 2>/dev/null) - if [ -z "${x}" -o ! -x "${x}" ]; then - warning "command '${1}' is not found in ${PATH}." - eval "${1^^}_CMD=\"\"" - return 1 - fi - - eval "${1^^}_CMD=\"${x}\"" - return 0 -} - -require_cmd date || exit 1 -require_cmd sed || exit 1 -require_cmd basename || exit 1 -require_cmd dirname || exit 1 -require_cmd cat || exit 1 -require_cmd grep || exit 1 -require_cmd egrep || exit 1 -require_cmd mktemp || exit 1 -require_cmd awk || exit 1 -require_cmd timeout || exit 1 -require_cmd curl || exit 1 - -# ----------------------------------------------------------------------------- - -[ $((BASH_VERSINFO[0])) -lt 4 ] && fatal "BASH version 4 or later is required, but found version: ${BASH_VERSION}. Please upgrade." - -info "started from '$PROGRAM_FILE' with options: $*" - -# ----------------------------------------------------------------------------- -# internal defaults -# netdata exposes a few environment variables for us - -[ -z "${NETDATA_PLUGINS_DIR}" ] && NETDATA_PLUGINS_DIR="$(dirname "${0}")" -[ -z "${NETDATA_USER_CONFIG_DIR}" ] && NETDATA_USER_CONFIG_DIR="/etc/netdata" -[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="/usr/lib/netdata/conf.d" - -pluginsd="${NETDATA_PLUGINS_DIR}" -stockconfd="${NETDATA_STOCK_CONFIG_DIR}/${PROGRAM_NAME}" -userconfd="${NETDATA_USER_CONFIG_DIR}/${PROGRAM_NAME}" -olduserconfd="${NETDATA_USER_CONFIG_DIR}" -chartsd="$pluginsd/../charts.d" - -minimum_update_frequency="${NETDATA_UPDATE_EVERY-1}" -update_every=${minimum_update_frequency} # this will be overwritten by the command line - -# work around for non BASH shells -charts_create="_create" -charts_update="_update" -charts_check="_check" -charts_undescore="_" - -# when making iterations, charts.d can loop more frequently -# to prevent plugins missing iterations. -# this is a percentage relative to update_every to align its -# iterations. -# The minimum is 10%, the maximum 100%. -# So, if update_every is 1 second and time_divisor is 50, -# charts.d will iterate every 500ms. -# Charts will be called to collect data only if the time -# passed since the last time the collected data is equal or -# above their update_every. -time_divisor=50 - -# number of seconds to run without restart -# after this time, charts.d.plugin will exit -# netdata will restart it -restart_timeout=$((3600 * 4)) - -# check if the charts.d plugins are using global variables -# they should not. -# It does not currently support BASH v4 arrays, so it is -# disabled -dryrunner=0 - -# check for timeout command -check_for_timeout=1 - -# the default enable/disable value for all charts -enable_all_charts="yes" - -# ----------------------------------------------------------------------------- -# parse parameters - -check=0 -chart_only= -while [ ! -z "$1" ]; do - if [ "$1" = "check" ]; then - check=1 - shift - continue - fi - - if [ "$1" = "debug" -o "$1" = "all" ]; then - debug=1 - shift - continue - fi - - if [ -f "$chartsd/$1.chart.sh" ]; then - debug=1 - chart_only="$(echo $1.chart.sh | sed "s/\.chart\.sh$//g")" - shift - continue - fi - - if [ -f "$chartsd/$1" ]; then - debug=1 - chart_only="$(echo $1 | sed "s/\.chart\.sh$//g")" - shift - continue - fi - - # number check - n="$1" - x=$((n)) - if [ "$x" = "$n" ]; then - shift - update_every=$x - [ $update_every -lt $minimum_update_frequency ] && update_every=$minimum_update_frequency - continue - fi - - fatal "Cannot understand parameter $1. Aborting." -done - -# ----------------------------------------------------------------------------- -# loop control - -# default sleep function -LOOPSLEEPMS_HIGHRES=0 -now_ms= -current_time_ms_default() { - now_ms="$(date +'%s')000" -} -current_time_ms="current_time_ms_default" -current_time_ms_accuracy=1 -mysleep="sleep" - -# if found and included, this file overwrites loopsleepms() -# and current_time_ms() with a high resolution timer function -# for precise looping. -source "$pluginsd/loopsleepms.sh.inc" -[ $? -ne 0 ] && error "Failed to load '$pluginsd/loopsleepms.sh.inc'." - -# ----------------------------------------------------------------------------- -# load my configuration - -for myconfig in "${NETDATA_STOCK_CONFIG_DIR}/${PROGRAM_NAME}.conf" "${NETDATA_USER_CONFIG_DIR}/${PROGRAM_NAME}.conf"; do - if [ -f "$myconfig" ]; then - source "$myconfig" - if [ $? -ne 0 ]; then - error "Config file '$myconfig' loaded with errors." - else - info "Configuration file '$myconfig' loaded." - fi - else - warning "Configuration file '$myconfig' not found." - fi -done - -# make sure time_divisor is right -time_divisor=$((time_divisor)) -[ $time_divisor -lt 10 ] && time_divisor=10 -[ $time_divisor -gt 100 ] && time_divisor=100 - -# we check for the timeout command, after we load our -# configuration, so that the user may overwrite the -# timeout command we use, providing a function that -# can emulate the timeout command we need: -# > timeout SECONDS command ... -if [ $check_for_timeout -eq 1 ]; then - require_cmd timeout || exit 1 -fi - -# ----------------------------------------------------------------------------- -# internal checks - -# netdata passes the requested update frequency as the first argument -update_every=$((update_every + 1 - 1)) # makes sure it is a number -test $update_every -eq 0 && update_every=1 # if it is zero, make it 1 - -# check the charts.d directory -[ ! -d "$chartsd" ] && fatal "cannot find charts directory '$chartsd'" - -# ----------------------------------------------------------------------------- -# library functions - -fixid() { - echo "$*" | - tr -c "[A-Z][a-z][0-9]" "_" | - sed -e "s|^_\+||g" -e "s|_\+$||g" -e "s|_\+|_|g" | - tr "[A-Z]" "[a-z]" -} - -run() { - local ret pid="${BASHPID}" t - - if [ "z${1}" = "z-t" -a "${2}" != "0" ]; then - t="${2}" - shift 2 - case "${NETDATA_SYSTEM_OS_ID}" in - "alpine") - timeout -t ${t} "${@}" 2>"${TMP_DIR}/run.${pid}" - ;; - *) - timeout ${t} "${@}" 2>"${TMP_DIR}/run.${pid}" - ;; - esac - ret=$? - else - "${@}" 2>"${TMP_DIR}/run.${pid}" - ret=$? - fi - - if [ ${ret} -ne 0 ]; then - { - printf "$(logdate): ${PROGRAM_NAME}: ${status}: ${MODULE_NAME}: command '" - printf "%q " "${@}" - printf "' failed with code ${ret}:\n --- BEGIN TRACE ---\n" - cat "${TMP_DIR}/run.${pid}" - printf " --- END TRACE ---\n" - } >&2 - fi - rm -f "${TMP_DIR}/run.${pid}" - - return ${ret} -} - -# convert any floating point number -# to integer, give a multiplier -# the result is stored in ${FLOAT2INT_RESULT} -# so that no fork is necessary -# the multiplier must be a power of 10 -float2int() { - local f m="$2" a b l v=($1) - f=${v[0]} - - # the length of the multiplier - 1 - l=$((${#m} - 1)) - - # check if the number is in scientific notation - if [[ ${f} =~ ^[[:space:]]*(-)?[0-9.]+(e|E)(\+|-)[0-9]+ ]]; then - # convert it to decimal - # unfortunately, this fork cannot be avoided - # if you know of a way to avoid it, please let me know - f=$(printf "%0.${l}f" ${f}) - fi - - # split the floating point number - # in integer (a) and decimal (b) - a=${f/.*/} - b=${f/*./} - - # if the integer part is missing - # set it to zero - [ -z "${a}" ] && a="0" - - # strip leading zeros from the integer part - # base 10 convertion - a=$((10#$a)) - - # check the length of the decimal part - # against the length of the multiplier - if [ ${#b} -gt ${l} ]; then - # too many digits - take the most significant - b=${b:0:l} - - elif [ ${#b} -lt ${l} ]; then - # too few digits - pad with zero on the right - local z="00000000000000000000000" r=$((l - ${#b})) - b="${b}${z:0:r}" - fi - - # strip leading zeros from the decimal part - # base 10 convertion - b=$((10#$b)) - - # store the result - FLOAT2INT_RESULT=$(((a * m) + b)) -} - -# ----------------------------------------------------------------------------- -# charts check functions - -all_charts() { - cd "$chartsd" - [ $? -ne 0 ] && error "cannot cd to $chartsd" && return 1 - - ls *.chart.sh | sed "s/\.chart\.sh$//g" -} - -declare -A charts_enable_keyword=( - ['apache']="force" - ['cpu_apps']="force" - ['cpufreq']="force" - ['example']="force" - ['exim']="force" - ['hddtemp']="force" - ['load_average']="force" - ['mem_apps']="force" - ['mysql']="force" - ['nginx']="force" - ['phpfpm']="force" - ['postfix']="force" - ['sensors']="force" - ['squid']="force" - ['tomcat']="force" -) - -all_enabled_charts() { - local charts= enabled= required= - - # find all enabled charts - - for chart in $(all_charts); do - MODULE_NAME="${chart}" - - eval "enabled=\$$chart" - if [ -z "${enabled}" ]; then - enabled="${enable_all_charts}" - fi - - required="${charts_enable_keyword[${chart}]}" - [ -z "${required}" ] && required="yes" - - if [ ! "${enabled}" = "${required}" ]; then - info "is disabled. Add a line with $chart=$required in '${NETDATA_USER_CONFIG_DIR}/${PROGRAM_NAME}.conf' to enable it (or remove the line that disables it)." - else - debug "is enabled for auto-detection." - local charts="$charts $chart" - fi - done - MODULE_NAME="main" - - local charts2= - for chart in $charts; do - MODULE_NAME="${chart}" - - # check the enabled charts - local check="$(cat "$chartsd/$chart.chart.sh" | sed "s/^ \+//g" | grep "^$chart$charts_check()")" - if [ -z "$check" ]; then - error "module '$chart' does not seem to have a $chart$charts_check() function. Disabling it." - continue - fi - - local create="$(cat "$chartsd/$chart.chart.sh" | sed "s/^ \+//g" | grep "^$chart$charts_create()")" - if [ -z "$create" ]; then - error "module '$chart' does not seem to have a $chart$charts_create() function. Disabling it." - continue - fi - - local update="$(cat "$chartsd/$chart.chart.sh" | sed "s/^ \+//g" | grep "^$chart$charts_update()")" - if [ -z "$update" ]; then - error "module '$chart' does not seem to have a $chart$charts_update() function. Disabling it." - continue - fi - - # check its config - #if [ -f "$userconfd/$chart.conf" ] - #then - # if [ ! -z "$( cat "$userconfd/$chart.conf" | sed "s/^ \+//g" | grep -v "^$" | grep -v "^#" | grep -v "^$chart$charts_undescore" )" ] - # then - # error "module's $chart config $userconfd/$chart.conf should only have lines starting with $chart$charts_undescore . Disabling it." - # continue - # fi - #fi - - #if [ $dryrunner -eq 1 ] - # then - # "$pluginsd/charts.d.dryrun-helper.sh" "$chart" "$chartsd/$chart.chart.sh" "$userconfd/$chart.conf" >/dev/null - # if [ $? -ne 0 ] - # then - # error "module's $chart did not pass the dry run check. This means it uses global variables not starting with $chart. Disabling it." - # continue - # fi - #fi - - local charts2="$charts2 $chart" - done - MODULE_NAME="main" - - echo $charts2 - debug "enabled charts: $charts2" -} - -# ----------------------------------------------------------------------------- -# load the charts - -suffix_retries="_retries" -suffix_update_every="_update_every" -active_charts= -for chart in $(all_enabled_charts); do - MODULE_NAME="${chart}" - - debug "loading module: '$chartsd/$chart.chart.sh'" - - source "$chartsd/$chart.chart.sh" - [ $? -ne 0 ] && warning "Module '$chartsd/$chart.chart.sh' loaded with errors." - - # first load the stock config - if [ -f "$stockconfd/$chart.conf" ]; then - debug "loading module configuration: '$stockconfd/$chart.conf'" - source "$stockconfd/$chart.conf" - [ $? -ne 0 ] && warning "Config file '$stockconfd/$chart.conf' loaded with errors." - else - debug "not found module configuration: '$stockconfd/$chart.conf'" - fi - - # then load the user config (it overwrites the stock) - if [ -f "$userconfd/$chart.conf" ]; then - debug "loading module configuration: '$userconfd/$chart.conf'" - source "$userconfd/$chart.conf" - [ $? -ne 0 ] && warning "Config file '$userconfd/$chart.conf' loaded with errors." - else - debug "not found module configuration: '$userconfd/$chart.conf'" - - if [ -f "$olduserconfd/$chart.conf" ]; then - # support for very old netdata that had the charts.d module configs in /etc/netdata - info "loading module configuration from obsolete location: '$olduserconfd/$chart.conf'" - source "$olduserconfd/$chart.conf" - [ $? -ne 0 ] && warning "Config file '$olduserconfd/$chart.conf' loaded with errors." - fi - fi - - eval "dt=\$$chart$suffix_update_every" - dt=$((dt + 1 - 1)) # make sure it is a number - if [ $dt -lt $update_every ]; then - eval "$chart$suffix_update_every=$update_every" - fi - - $chart$charts_check - if [ $? -eq 0 ]; then - debug "module '$chart' activated" - active_charts="$active_charts $chart" - else - error "module's '$chart' check() function reports failure." - fi -done -MODULE_NAME="main" -debug "activated modules: $active_charts" - -# ----------------------------------------------------------------------------- -# check overwrites - -# enable work time reporting -debug_time= -test $debug -eq 1 && debug_time=tellwork - -# if we only need a specific chart, remove all the others -if [ ! -z "${chart_only}" ]; then - debug "requested to run only for: '${chart_only}'" - check_charts= - for chart in $active_charts; do - if [ "$chart" = "$chart_only" ]; then - check_charts="$chart" - break - fi - done - active_charts="$check_charts" -fi -debug "activated charts: $active_charts" - -# stop if we just need a pre-check -if [ $check -eq 1 ]; then - info "CHECK RESULT" - info "Will run the charts: $active_charts" - exit 0 -fi - -# ----------------------------------------------------------------------------- - -cd "${TMP_DIR}" || exit 1 - -# ----------------------------------------------------------------------------- -# create charts - -run_charts= -for chart in $active_charts; do - MODULE_NAME="${chart}" - - debug "calling '$chart$charts_create()'..." - $chart$charts_create - if [ $? -eq 0 ]; then - run_charts="$run_charts $chart" - debug "'$chart' initialized." - else - error "module's '$chart' function '$chart$charts_create()' reports failure." - fi -done -MODULE_NAME="main" -debug "run_charts='$run_charts'" - -# ----------------------------------------------------------------------------- -# update dimensions - -[ -z "$run_charts" ] && fatal "No charts to collect data from." - -declare -A charts_last_update=() charts_update_every=() charts_retries=() charts_next_update=() charts_run_counter=() charts_serial_failures=() -global_update() { - local exit_at \ - c=0 dt ret last_ms exec_start_ms exec_end_ms \ - chart now_charts=() next_charts=($run_charts) \ - next_ms x seconds millis - - # return the current time in ms in $now_ms - ${current_time_ms} - - exit_at=$((now_ms + (restart_timeout * 1000))) - - for chart in $run_charts; do - eval "charts_update_every[$chart]=\$$chart$suffix_update_every" - test -z "${charts_update_every[$chart]}" && charts_update_every[$chart]=$update_every - - eval "charts_retries[$chart]=\$$chart$suffix_retries" - test -z "${charts_retries[$chart]}" && charts_retries[$chart]=10 - - charts_last_update[$chart]=$((now_ms - (now_ms % (charts_update_every[$chart] * 1000)))) - charts_next_update[$chart]=$((charts_last_update[$chart] + (charts_update_every[$chart] * 1000))) - charts_run_counter[$chart]=0 - charts_serial_failures[$chart]=0 - - echo "CHART netdata.plugin_chartsd_$chart '' 'Execution time for $chart plugin' 'milliseconds / run' charts.d netdata.plugin_charts area 145000 ${charts_update_every[$chart]}" - echo "DIMENSION run_time 'run time' absolute 1 1" - done - - # the main loop - while [ "${#next_charts[@]}" -gt 0 ]; do - c=$((c + 1)) - now_charts=("${next_charts[@]}") - next_charts=() - - # return the current time in ms in $now_ms - ${current_time_ms} - - for chart in "${now_charts[@]}"; do - MODULE_NAME="${chart}" - - if [ ${now_ms} -ge ${charts_next_update[$chart]} ]; then - last_ms=${charts_last_update[$chart]} - dt=$((now_ms - last_ms)) - - charts_last_update[$chart]=${now_ms} - - while [ ${charts_next_update[$chart]} -lt ${now_ms} ]; do - charts_next_update[$chart]=$((charts_next_update[$chart] + (charts_update_every[$chart] * 1000))) - done - - # the first call should not give a duration - # so that netdata calibrates to current time - dt=$((dt * 1000)) - charts_run_counter[$chart]=$((charts_run_counter[$chart] + 1)) - if [ ${charts_run_counter[$chart]} -eq 1 ]; then - dt= - fi - - exec_start_ms=$now_ms - $chart$charts_update $dt - ret=$? - - # return the current time in ms in $now_ms - ${current_time_ms} - exec_end_ms=$now_ms - - echo "BEGIN netdata.plugin_chartsd_$chart $dt" - echo "SET run_time = $((exec_end_ms - exec_start_ms))" - echo "END" - - if [ $ret -eq 0 ]; then - charts_serial_failures[$chart]=0 - next_charts+=($chart) - else - charts_serial_failures[$chart]=$((charts_serial_failures[$chart] + 1)) - - if [ ${charts_serial_failures[$chart]} -gt ${charts_retries[$chart]} ]; then - error "module's '$chart' update() function reported failure ${charts_serial_failures[$chart]} times. Disabling it." - else - error "module's '$chart' update() function reports failure. Will keep trying for a while." - next_charts+=($chart) - fi - fi - else - next_charts+=($chart) - fi - done - MODULE_NAME="${chart}" - - # wait the time you are required to - next_ms=$((now_ms + (update_every * 1000 * 100))) - for x in "${charts_next_update[@]}"; do [ ${x} -lt ${next_ms} ] && next_ms=${x}; done - next_ms=$((next_ms - now_ms)) - - if [ ${LOOPSLEEPMS_HIGHRES} -eq 1 -a ${next_ms} -gt 0 ]; then - next_ms=$((next_ms + current_time_ms_accuracy)) - seconds=$((next_ms / 1000)) - millis=$((next_ms % 1000)) - if [ ${millis} -lt 10 ]; then - millis="00${millis}" - elif [ ${millis} -lt 100 ]; then - millis="0${millis}" - fi - - debug "sleeping for ${seconds}.${millis} seconds." - ${mysleep} ${seconds}.${millis} - else - debug "sleeping for ${update_every} seconds." - ${mysleep} $update_every - fi - - test ${now_ms} -ge ${exit_at} && exit 0 - done - - fatal "nothing left to do, exiting..." -} - -global_update diff --git a/collectors/charts.d.plugin/charts.d.plugin.in b/collectors/charts.d.plugin/charts.d.plugin.in index 0df6c30c3..62363f3db 100755 --- a/collectors/charts.d.plugin/charts.d.plugin.in +++ b/collectors/charts.d.plugin/charts.d.plugin.in @@ -275,20 +275,26 @@ fixid() { tr "[A-Z]" "[a-z]" } +isvarset() { + [ -n "$1" ] && [ "$1" != "unknown" ] && [ "$1" != "none" ] + return $? +} + +getosid() { + if isvarset "${NETDATA_CONTAINER_OS_ID}"; then + echo "${NETDATA_CONTAINER_OS_ID}" + else + echo "${NETDATA_SYSTEM_OS_ID}" + fi +} + run() { local ret pid="${BASHPID}" t if [ "z${1}" = "z-t" -a "${2}" != "0" ]; then t="${2}" shift 2 - case "${NETDATA_SYSTEM_OS_ID}" in - "alpine") - timeout -t ${t} "${@}" 2>"${TMP_DIR}/run.${pid}" - ;; - *) - timeout ${t} "${@}" 2>"${TMP_DIR}/run.${pid}" - ;; - esac + timeout "${t}" "${@}" 2>"${TMP_DIR}/run.${pid}" ret=$? else "${@}" 2>"${TMP_DIR}/run.${pid}" @@ -390,14 +396,34 @@ declare -A charts_enable_keyword=( ['tomcat']="force" ) +declare -A obsolete_charts=( + ['apache']="python.d.plugin module" + ['cpu_apps']="apps.plugin" + ['cpufreq']="proc plugin" + ['exim']="python.d.plugin module" + ['hddtemp']="python.d.plugin module" + ['load_average']="proc plugin" + ['mem_apps']="proc plugin" + ['mysql']="python.d.plugin module" + ['nginx']="python.d.plugin module" + ['phpfpm']="python.d.plugin module" + ['postfix']="python.d.plugin module" + ['squid']="python.d.plugin module" + ['tomcat']="python.d.plugin module" +) + all_enabled_charts() { - local charts= enabled= required= + local charts enabled required # find all enabled charts - for chart in $(all_charts); do MODULE_NAME="${chart}" + if [ -n "${obsolete_charts["$MODULE_NAME"]}" ]; then + debug "is replaced by ${obsolete_charts["$MODULE_NAME"]}, skipping it." + continue + fi + eval "enabled=\$$chart" if [ -z "${enabled}" ]; then enabled="${enable_all_charts}" @@ -578,6 +604,12 @@ debug "run_charts='$run_charts'" [ -z "$run_charts" ] && fatal "No charts to collect data from." +keepalive() { + if [ ! -t 1 ] && ! printf "\n"; then + chartsd_cleanup + fi +} + declare -A charts_last_update=() charts_update_every=() charts_retries=() charts_next_update=() charts_run_counter=() charts_serial_failures=() global_update() { local exit_at \ @@ -608,6 +640,8 @@ global_update() { # the main loop while [ "${#next_charts[@]}" -gt 0 ]; do + keepalive + c=$((c + 1)) now_charts=("${next_charts[@]}") next_charts=() diff --git a/collectors/charts.d.plugin/cpu_apps/Makefile.inc b/collectors/charts.d.plugin/cpu_apps/Makefile.inc deleted file mode 100644 index a35f82837..000000000 --- a/collectors/charts.d.plugin/cpu_apps/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += cpu_apps/cpu_apps.chart.sh -dist_chartsconfig_DATA += cpu_apps/cpu_apps.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += cpu_apps/README.md cpu_apps/Makefile.inc - diff --git a/collectors/charts.d.plugin/cpu_apps/README.md b/collectors/charts.d.plugin/cpu_apps/README.md deleted file mode 100644 index c8230aa4f..000000000 --- a/collectors/charts.d.plugin/cpu_apps/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# cpu_apps - -> THIS MODULE IS OBSOLETE. -> USE [APPS.PLUGIN](../../apps.plugin). - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fcpu_apps%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/cpu_apps/cpu_apps.chart.sh b/collectors/charts.d.plugin/cpu_apps/cpu_apps.chart.sh deleted file mode 100644 index e91c46d54..000000000 --- a/collectors/charts.d.plugin/cpu_apps/cpu_apps.chart.sh +++ /dev/null @@ -1,70 +0,0 @@ -# shellcheck shell=bash disable=SC2154,SC1072,SC1073,SC2009,SC2162,SC2006,SC2002,SC2086,SC1117 -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# -# THIS PLUGIN IS OBSOLETE -# USE apps.plugin INSTEAD - -# a space separated list of command to monitor -cpu_apps_apps= - -# these are required for computing memory in bytes and cpu in seconds -#cpu_apps_pagesize="`getconf PAGESIZE`" -cpu_apps_clockticks="$(getconf CLK_TCK)" - -cpu_apps_update_every=60 - -cpu_apps_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - if [ -z "$cpu_apps_apps" ]; then - error "manual configuration required: please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf" - return 1 - fi - return 0 -} - -cpu_apps_bc_finalze= - -cpu_apps_create() { - - echo "CHART chartsd_apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every" - - local x= - for x in $cpu_apps_apps; do - echo "DIMENSION $x $x incremental 1000 $cpu_apps_clockticks" - - # this string is needed later in the update() function - # to finalize the instructions for the bc command - cpu_apps_bc_finalze="$cpu_apps_bc_finalze \"SET $x = \"; $x;" - done - return 0 -} - -cpu_apps_update() { - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - echo "BEGIN chartsd_apps.cpu" - ps -o pid,comm -C "$cpu_apps_apps" | - grep -v "COMMAND" | - ( - while read pid name; do - echo "$name+=$(cat /proc/$pid/stat | cut -d ' ' -f 14-15)" - done - ) | - ( - sed -e "s/ \+/ /g" -e "s/ /+/g" - echo "$cpu_apps_bc_finalze" - ) | bc - echo "END" - - return 0 -} diff --git a/collectors/charts.d.plugin/cpu_apps/cpu_apps.conf b/collectors/charts.d.plugin/cpu_apps/cpu_apps.conf deleted file mode 100644 index 850cd0c6f..000000000 --- a/collectors/charts.d.plugin/cpu_apps/cpu_apps.conf +++ /dev/null @@ -1,19 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# app.plugin can do better - -#cpu_apps_apps= - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#cpu_apps_update_every=2 - -# the number of retries to do in case of failure -# before disabling the module -#cpu_apps_retries=10 diff --git a/collectors/charts.d.plugin/cpufreq/Makefile.inc b/collectors/charts.d.plugin/cpufreq/Makefile.inc deleted file mode 100644 index 682379133..000000000 --- a/collectors/charts.d.plugin/cpufreq/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += cpufreq/cpufreq.chart.sh -dist_chartsconfig_DATA += cpufreq/cpufreq.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += cpufreq/README.md cpufreq/Makefile.inc - diff --git a/collectors/charts.d.plugin/cpufreq/README.md b/collectors/charts.d.plugin/cpufreq/README.md deleted file mode 100644 index fc2bfca19..000000000 --- a/collectors/charts.d.plugin/cpufreq/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# cpufreq - -> THIS MODULE IS OBSOLETE. -> USE THE [PROC PLUGIN](../../proc.plugin) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fcpufreq%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/cpufreq/cpufreq.chart.sh b/collectors/charts.d.plugin/cpufreq/cpufreq.chart.sh deleted file mode 100644 index 68708d911..000000000 --- a/collectors/charts.d.plugin/cpufreq/cpufreq.chart.sh +++ /dev/null @@ -1,88 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -# if this chart is called X.chart.sh, then all functions and global variables -# must start with X_ - -cpufreq_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices" -cpufreq_sys_depth=10 -cpufreq_source_update=1 - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -cpufreq_update_every= -cpufreq_priority=10000 - -cpufreq_find_all_files() { - find "$1" -maxdepth $cpufreq_sys_depth -name scaling_cur_freq 2>/dev/null -} - -# _check is called once, to find out if this chart should be enabled or not -cpufreq_check() { - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - [ -z "$(cpufreq_find_all_files "$cpufreq_sys_dir")" ] && return 1 - return 0 -} - -# _create is called once, to create the charts -cpufreq_create() { - local dir file id i - - # we create a script with the source of the - # cpufreq_update() function - # - the highest speed we can achieve - - [ $cpufreq_source_update -eq 1 ] && echo >"$TMP_DIR/cpufreq.sh" "cpufreq_update() {" - - echo "CHART cpu.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line $((cpufreq_priority + 1)) $cpufreq_update_every" - echo >>"$TMP_DIR/cpufreq.sh" "echo \"BEGIN cpu.cpufreq \$1\"" - - i=0 - for file in $(cpufreq_find_all_files "$cpufreq_sys_dir" | sort -u); do - i=$((i + 1)) - dir=$(dirname "$file") - cpu= - - [ -f "$dir/affected_cpus" ] && cpu=$(cat "$dir/affected_cpus") - [ -z "$cpu" ] && cpu="$i.a" - - id="$(fixid "cpu$cpu")" - - debug "file='$file', dir='$dir', cpu='$cpu', id='$id'" - - echo "DIMENSION $id '$id' absolute 1 1000" - echo >>"$TMP_DIR/cpufreq.sh" "echo \"SET $id = \"\$(< $file )" - done - echo >>"$TMP_DIR/cpufreq.sh" "echo END" - - [ $cpufreq_source_update -eq 1 ] && echo >>"$TMP_DIR/cpufreq.sh" "}" - - # ok, load the function cpufreq_update() we created - # shellcheck disable=SC1090 - [ $cpufreq_source_update -eq 1 ] && . "$TMP_DIR/cpufreq.sh" - - return 0 -} - -# _update is called continuously, to collect the values -cpufreq_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - # shellcheck disable=SC1090 - [ $cpufreq_source_update -eq 0 ] && . "$TMP_DIR/cpufreq.sh" "$1" - - return 0 -} diff --git a/collectors/charts.d.plugin/cpufreq/cpufreq.conf b/collectors/charts.d.plugin/cpufreq/cpufreq.conf deleted file mode 100644 index 7130555af..000000000 --- a/collectors/charts.d.plugin/cpufreq/cpufreq.conf +++ /dev/null @@ -1,24 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -#cpufreq_sys_dir="/sys/devices" -#cpufreq_sys_depth=10 -#cpufreq_source_update=1 - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#cpufreq_update_every= - -# the charts priority on the dashboard -#cpufreq_priority=10000 - -# the number of retries to do in case of failure -# before disabling the module -#cpufreq_retries=10 diff --git a/collectors/charts.d.plugin/example/README.md b/collectors/charts.d.plugin/example/README.md index 98562d624..de21f6ad6 100644 --- a/collectors/charts.d.plugin/example/README.md +++ b/collectors/charts.d.plugin/example/README.md @@ -1,3 +1,8 @@ +<!-- +title: "Example" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/example/README.md +--> + # Example This is just an example charts.d data collector. diff --git a/collectors/charts.d.plugin/example/example.chart.sh b/collectors/charts.d.plugin/example/example.chart.sh index 8bae570a3..5ff51a579 100644 --- a/collectors/charts.d.plugin/example/example.chart.sh +++ b/collectors/charts.d.plugin/example/example.chart.sh @@ -32,63 +32,63 @@ example_last=0 example_count=0 example_get() { - # do all the work to collect / calculate the values - # for each dimension - # - # Remember: - # 1. KEEP IT SIMPLE AND SHORT - # 2. AVOID FORKS (avoid piping commands) - # 3. AVOID CALLING TOO MANY EXTERNAL PROGRAMS - # 4. USE LOCAL VARIABLES (global variables may overlap with other modules) - - example_value1=$RANDOM - example_value2=$RANDOM - example_value3=$RANDOM - example_value4=$((8192 + (RANDOM * 16383 / 32767))) - - if [ $example_count -gt 0 ]; then - example_count=$((example_count - 1)) - - [ $example_last -gt 16383 ] && example_value4=$((example_last + (RANDOM * ((32767 - example_last) / 2) / 32767))) - [ $example_last -le 16383 ] && example_value4=$((example_last - (RANDOM * (example_last / 2) / 32767))) - else - example_count=$((1 + (RANDOM * 5 / 32767))) - - if [ $example_last -gt 16383 ] && [ $example_value4 -gt 16383 ]; then - example_value4=$((example_value4 - 16383)) - fi - if [ $example_last -le 16383 ] && [ $example_value4 -lt 16383 ]; then - example_value4=$((example_value4 + 16383)) - fi - fi - example_last=$example_value4 - - # this should return: - # - 0 to send the data to netdata - # - 1 to report a failure to collect the data - - return 0 + # do all the work to collect / calculate the values + # for each dimension + # + # Remember: + # 1. KEEP IT SIMPLE AND SHORT + # 2. AVOID FORKS (avoid piping commands) + # 3. AVOID CALLING TOO MANY EXTERNAL PROGRAMS + # 4. USE LOCAL VARIABLES (global variables may overlap with other modules) + + example_value1=$RANDOM + example_value2=$RANDOM + example_value3=$RANDOM + example_value4=$((8192 + (RANDOM * 16383 / 32767))) + + if [ $example_count -gt 0 ]; then + example_count=$((example_count - 1)) + + [ $example_last -gt 16383 ] && example_value4=$((example_last + (RANDOM * ((32767 - example_last) / 2) / 32767))) + [ $example_last -le 16383 ] && example_value4=$((example_last - (RANDOM * (example_last / 2) / 32767))) + else + example_count=$((1 + (RANDOM * 5 / 32767))) + + if [ $example_last -gt 16383 ] && [ $example_value4 -gt 16383 ]; then + example_value4=$((example_value4 - 16383)) + fi + if [ $example_last -le 16383 ] && [ $example_value4 -lt 16383 ]; then + example_value4=$((example_value4 + 16383)) + fi + fi + example_last=$example_value4 + + # this should return: + # - 0 to send the data to netdata + # - 1 to report a failure to collect the data + + return 0 } # _check is called once, to find out if this chart should be enabled or not example_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart - # check something - [ "${example_magic_number}" != "12345" ] && error "manual configuration required: you have to set example_magic_number=$example_magic_number in example.conf to start example chart." && return 1 + # check something + [ "${example_magic_number}" != "12345" ] && error "manual configuration required: you have to set example_magic_number=$example_magic_number in example.conf to start example chart." && return 1 - # check that we can collect data - example_get || return 1 + # check that we can collect data + example_get || return 1 - return 0 + return 0 } # _create is called once, to create the charts example_create() { - # create the chart with 3 dimensions - cat <<EOF + # create the chart with 3 dimensions + cat << EOF CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked $((example_priority)) $example_update_every DIMENSION random1 '' percentage-of-absolute-row 1 1 DIMENSION random2 '' percentage-of-absolute-row 1 1 @@ -97,18 +97,18 @@ CHART example.random2 '' "A random number" "random number" random random area $( DIMENSION random '' absolute 1 1 EOF - return 0 + return 0 } # _update is called continuously, to collect the values example_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). - example_get || return 1 + example_get || return 1 - # write the result of the work. - cat <<VALUESEOF + # write the result of the work. + cat << VALUESEOF BEGIN example.random $1 SET random1 = $example_value1 SET random2 = $example_value2 @@ -119,5 +119,5 @@ SET random = $example_value4 END VALUESEOF - return 0 + return 0 } diff --git a/collectors/charts.d.plugin/exim/Makefile.inc b/collectors/charts.d.plugin/exim/Makefile.inc deleted file mode 100644 index ca2112a80..000000000 --- a/collectors/charts.d.plugin/exim/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += exim/exim.chart.sh -dist_chartsconfig_DATA += exim/exim.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += exim/README.md exim/Makefile.inc - diff --git a/collectors/charts.d.plugin/exim/README.md b/collectors/charts.d.plugin/exim/README.md deleted file mode 100644 index 5c73c002e..000000000 --- a/collectors/charts.d.plugin/exim/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# exim - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/exim) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fexim%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/exim/exim.chart.sh b/collectors/charts.d.plugin/exim/exim.chart.sh deleted file mode 100644 index 7b0ef70d2..000000000 --- a/collectors/charts.d.plugin/exim/exim.chart.sh +++ /dev/null @@ -1,46 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# -# Contributed by @jsveiga with PR #480 - -# the exim command to run -exim_command= - -# how frequently to collect queue size -exim_update_every=5 - -exim_priority=60000 - -exim_check() { - if [ -z "${exim_command}" ]; then - require_cmd exim || return 1 - exim_command="${EXIM_CMD}" - fi - - if [ "$(${exim_command} -bpc 2>&1 | grep -c denied)" -ne 0 ]; then - error "permission denied - please set 'queue_list_requires_admin = false' in your exim options file" - return 1 - fi - - return 0 -} - -exim_create() { - cat <<EOF -CHART exim_local.qemails '' "Exim Queue Emails" "emails" queue exim.queued.emails line $((exim_priority + 1)) $exim_update_every -DIMENSION emails '' absolute 1 1 -EOF - return 0 -} - -exim_update() { - echo "BEGIN exim_local.qemails $1" - echo "SET emails = $(run "${exim_command}" -bpc)" - echo "END" - return 0 -} diff --git a/collectors/charts.d.plugin/exim/exim.conf b/collectors/charts.d.plugin/exim/exim.conf deleted file mode 100644 index f96ac4dbb..000000000 --- a/collectors/charts.d.plugin/exim/exim.conf +++ /dev/null @@ -1,24 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -# the exim command to run -# if empty, it will use the one found in the system path -#exim_command= - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#exim_update_every=5 - -# the charts priority on the dashboard -#exim_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#exim_retries=10 diff --git a/collectors/charts.d.plugin/hddtemp/Makefile.inc b/collectors/charts.d.plugin/hddtemp/Makefile.inc deleted file mode 100644 index 2bd29e5b1..000000000 --- a/collectors/charts.d.plugin/hddtemp/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += hddtemp/hddtemp.chart.sh -dist_chartsconfig_DATA += hddtemp/hddtemp.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += hddtemp/README.md hddtemp/Makefile.inc - diff --git a/collectors/charts.d.plugin/hddtemp/README.md b/collectors/charts.d.plugin/hddtemp/README.md deleted file mode 100644 index 77f48956a..000000000 --- a/collectors/charts.d.plugin/hddtemp/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# hddtemp - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/hddtemp) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -The plugin will collect temperatures from disks - -It will create one chart with all active disks - -1. **temperature in Celsius** - -## configuration - -hddtemp needs to be running in daemonized mode - -```sh -# host with daemonized hddtemp -hddtemp_host="localhost" - -# port on which hddtemp is showing data -hddtemp_port="7634" - -# array of included disks -# the default is to include all -hddtemp_disks=() -``` - ---- - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fhddtemp%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh b/collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh deleted file mode 100644 index a4cef3c3b..000000000 --- a/collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh +++ /dev/null @@ -1,77 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# -# contributed by @paulfantom with PR #511 - -# if this chart is called X.chart.sh, then all functions and global variables -# must start with X_ -hddtemp_host="localhost" -hddtemp_port="7634" -declare -A hddtemp_disks=() - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -hddtemp_update_every=3 -hddtemp_priority=90000 - -# _check is called once, to find out if this chart should be enabled or not -hddtemp_check() { - require_cmd nc || return 1 - run nc $hddtemp_host $hddtemp_port && return 0 || return 1 -} - -# _create is called once, to create the charts -hddtemp_create() { - if [ ${#hddtemp_disks[@]} -eq 0 ]; then - local all - all=$(nc $hddtemp_host $hddtemp_port) - unset hddtemp_disks - # shellcheck disable=SC2190,SC2207 - hddtemp_disks=($(grep -Po '/dev/[^|]+' <<<"$all" | cut -c 6-)) - fi - # local disk_names - # disk_names=(`sed -e 's/||/\n/g;s/^|//' <<< "$all" | cut -d '|' -f2 | tr ' ' '_'`) - - echo "CHART hddtemp.temperature 'disks_temp' 'temperature' 'Celsius' 'Disks temperature' 'hddtemp.temp' line $((hddtemp_priority)) $hddtemp_update_every" - for i in $(seq 0 $((${#hddtemp_disks[@]} - 1))); do - # echo "DIMENSION ${hddtemp_disks[i]} ${disk_names[i]} absolute 1 1" - echo "DIMENSION ${hddtemp_disks[$i]} '' absolute 1 1" - done - return 0 -} - -# _update is called continuously, to collect the values -#hddtemp_last=0 -#hddtemp_count=0 -hddtemp_update() { - # local all=( `nc $hddtemp_host $hddtemp_port | sed -e 's/||/\n/g;s/^|//' | cut -d '|' -f3` ) - # local all=( `nc $hddtemp_host $hddtemp_port | awk 'BEGIN { FS="|" };{i=4; while (i <= NF) {print $i+0;i+=5;};}'` ) - OLD_IFS=$IFS - set -f - # shellcheck disable=SC2207 - IFS="|" all=($(nc $hddtemp_host $hddtemp_port 2>/dev/null)) - set +f - IFS=$OLD_IFS - - # check if there is some data - if [ -z "${all[3]}" ]; then - return 1 - fi - - # write the result of the work. - echo "BEGIN hddtemp.temperature $1" - end=${#hddtemp_disks[@]} - for ((i = 0; i < end; i++)); do - # temperature - this will turn SLP to zero - t=$((all[$((i * 5 + 3))])) - echo "SET ${hddtemp_disks[$i]} = $t" - done - echo "END" - - return 0 -} diff --git a/collectors/charts.d.plugin/hddtemp/hddtemp.conf b/collectors/charts.d.plugin/hddtemp/hddtemp.conf deleted file mode 100644 index b6037b40e..000000000 --- a/collectors/charts.d.plugin/hddtemp/hddtemp.conf +++ /dev/null @@ -1,23 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -#hddtemp_host="localhost" -#hddtemp_port="7634" - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#hddtemp_update_every=3 - -# the charts priority on the dashboard -#hddtemp_priority=90000 - -# the number of retries to do in case of failure -# before disabling the module -#hddtemp_retries=10 diff --git a/collectors/charts.d.plugin/libreswan/README.md b/collectors/charts.d.plugin/libreswan/README.md index d75c1ea96..b1c1f05e4 100644 --- a/collectors/charts.d.plugin/libreswan/README.md +++ b/collectors/charts.d.plugin/libreswan/README.md @@ -1,6 +1,12 @@ -# libreswan +<!-- +title: "Libreswan IPSec tunnel monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/libreswan/README.md +sidebar_label: "Libreswan IPSec tunnels" +--> -The plugin will collects bytes-in, bytes-out and uptime for all established libreswan IPSEC tunnels. +# Libreswan IPSec tunnel monitoring with Netdata + +Collects bytes-in, bytes-out and uptime for all established libreswan IPSEC tunnels. The following charts are created, **per tunnel**: @@ -13,9 +19,15 @@ The following charts are created, **per tunnel**: - bytes in - bytes out -## configuration +## Configuration + +Edit the `charts.d/libreswan.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. -Its config file is `/etc/netdata/charts.d/libreswan.conf`. +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/libreswan.conf +``` The plugin executes 2 commands to collect all the information it needs: diff --git a/collectors/charts.d.plugin/libreswan/libreswan.chart.sh b/collectors/charts.d.plugin/libreswan/libreswan.chart.sh index 1a8f90b11..bfa2b9ea1 100644 --- a/collectors/charts.d.plugin/libreswan/libreswan.chart.sh +++ b/collectors/charts.d.plugin/libreswan/libreswan.chart.sh @@ -37,78 +37,93 @@ declare -A libreswan_established_add_time=() # we need this to avoid converting tunnel names to chart IDs on every iteration declare -A libreswan_tunnel_charts=() +is_able_sudo_ipsec() { + if ! sudo -n -l "${IPSEC_CMD}" whack --status > /dev/null 2>&1; then + return 1 + fi + if ! sudo -n -l "${IPSEC_CMD}" whack --trafficstatus > /dev/null 2>&1; then + return 1 + fi + return 0 +} + # run the ipsec command libreswan_ipsec() { - if [ ${libreswan_sudo} -ne 0 ]; then - sudo -n "${IPSEC_CMD}" "${@}" - return $? - else - "${IPSEC_CMD}" "${@}" - return $? - fi + if [ ${libreswan_sudo} -ne 0 ]; then + sudo -n "${IPSEC_CMD}" "${@}" + return $? + else + "${IPSEC_CMD}" "${@}" + return $? + fi } # fetch latest values - fill the arrays libreswan_get() { - # do all the work to collect / calculate the values - # for each dimension - - # empty the variables - libreswan_traffic_in=() - libreswan_traffic_out=() - libreswan_established_add_time=() - libreswan_connected_tunnels=() - - # convert the ipsec command output to a shell script - # and source it to get the values - # shellcheck disable=SC1090 - source <( - { - libreswan_ipsec whack --status - libreswan_ipsec whack --trafficstatus - } | sed -n \ - -e "s|[0-9]\+ #\([0-9]\+\): \"\(.*\)\".*IPsec SA established.*newest IPSEC.*|libreswan_connected_tunnels[\"\1\"]=\"\2\"|p" \ - -e "s|[0-9]\+ #\([0-9]\+\): \"\(.*\)\",.* add_time=\([0-9]\+\),.* inBytes=\([0-9]\+\),.* outBytes=\([0-9]\+\).*|libreswan_traffic_in[\"\1\"]=\"\4\"; libreswan_traffic_out[\"\1\"]=\"\5\"; libreswan_established_add_time[\"\1\"]=\"\3\";|p" - ) || return 1 - - # check we got some data - [ ${#libreswan_connected_tunnels[@]} -eq 0 ] && return 1 - - return 0 + # do all the work to collect / calculate the values + # for each dimension + + # empty the variables + libreswan_traffic_in=() + libreswan_traffic_out=() + libreswan_established_add_time=() + libreswan_connected_tunnels=() + + # convert the ipsec command output to a shell script + # and source it to get the values + # shellcheck disable=SC1090 + source <( + { + libreswan_ipsec whack --status + libreswan_ipsec whack --trafficstatus + } | sed -n \ + -e "s|[0-9]\+ #\([0-9]\+\): \"\(.*\)\".*IPsec SA established.*newest IPSEC.*|libreswan_connected_tunnels[\"\1\"]=\"\2\"|p" \ + -e "s|[0-9]\+ #\([0-9]\+\): \"\(.*\)\",\{0,1\}.* add_time=\([0-9]\+\),.* inBytes=\([0-9]\+\),.* outBytes=\([0-9]\+\).*|libreswan_traffic_in[\"\1\"]=\"\4\"; libreswan_traffic_out[\"\1\"]=\"\5\"; libreswan_established_add_time[\"\1\"]=\"\3\";|p" + ) || return 1 + + # check we got some data + [ ${#libreswan_connected_tunnels[@]} -eq 0 ] && return 1 + + return 0 } # _check is called once, to find out if this chart should be enabled or not libreswan_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart + + require_cmd ipsec || return 1 - require_cmd ipsec || return 1 + # make sure it is libreswan + # shellcheck disable=SC2143 + if [ -z "$(ipsec --version | grep -i libreswan)" ]; then + error "ipsec command is not Libreswan. Disabling Libreswan plugin." + return 1 + fi - # make sure it is libreswan - # shellcheck disable=SC2143 - if [ -z "$(ipsec --version | grep -i libreswan)" ]; then - error "ipsec command is not Libreswan. Disabling Libreswan plugin." - return 1 - fi + if [ ${libreswan_sudo} -ne 0 ] && ! is_able_sudo_ipsec; then + error "not enough permissions to execute ipsec with sudo. Disabling Libreswan plugin." + return 1 + fi - # check that we can collect data - libreswan_get || return 1 + # check that we can collect data + libreswan_get || return 1 - return 0 + return 0 } # create the charts for an ipsec tunnel libreswan_create_one() { - local n="${1}" name + local n="${1}" name - name="${libreswan_connected_tunnels[${n}]}" + name="${libreswan_connected_tunnels[${n}]}" - [ ! -z "${libreswan_tunnel_charts[${name}]}" ] && return 0 + [ -n "${libreswan_tunnel_charts[${name}]}" ] && return 0 - libreswan_tunnel_charts[${name}]="$(fixid "${name}")" + libreswan_tunnel_charts[${name}]="$(fixid "${name}")" - cat <<EOF + cat << EOF CHART libreswan.${libreswan_tunnel_charts[${name}]}_net '${name}_net' "LibreSWAN Tunnel ${name} Traffic" "kilobits/s" "${name}" libreswan.net area $((libreswan_priority)) $libreswan_update_every DIMENSION in '' incremental 8 1000 DIMENSION out '' incremental -8 1000 @@ -116,35 +131,35 @@ CHART libreswan.${libreswan_tunnel_charts[${name}]}_uptime '${name}_uptime' "Lib DIMENSION uptime '' absolute 1 1 EOF - return 0 + return 0 } # _create is called once, to create the charts libreswan_create() { - local n - for n in "${!libreswan_connected_tunnels[@]}"; do - libreswan_create_one "${n}" - done - return 0 + local n + for n in "${!libreswan_connected_tunnels[@]}"; do + libreswan_create_one "${n}" + done + return 0 } libreswan_now=$(date +%s) # send the values to netdata for an ipsec tunnel libreswan_update_one() { - local n="${1}" microseconds="${2}" name id uptime + local n="${1}" microseconds="${2}" name id uptime - name="${libreswan_connected_tunnels[${n}]}" - id="${libreswan_tunnel_charts[${name}]}" + name="${libreswan_connected_tunnels[${n}]}" + id="${libreswan_tunnel_charts[${name}]}" - [ -z "${id}" ] && libreswan_create_one "${name}" + [ -z "${id}" ] && libreswan_create_one "${name}" - uptime=$((libreswan_now - libreswan_established_add_time[${n}])) - [ ${uptime} -lt 0 ] && uptime=0 + uptime=$((libreswan_now - libreswan_established_add_time[${n}])) + [ ${uptime} -lt 0 ] && uptime=0 - # write the result of the work. - cat <<VALUESEOF + # write the result of the work. + cat << VALUESEOF BEGIN libreswan.${id}_net ${microseconds} SET in = ${libreswan_traffic_in[${n}]} SET out = ${libreswan_traffic_out[${n}]} @@ -157,16 +172,16 @@ VALUESEOF # _update is called continiously, to collect the values libreswan_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). - libreswan_get || return 1 - libreswan_now=$(date +%s) + libreswan_get || return 1 + libreswan_now=$(date +%s) - local n - for n in "${!libreswan_connected_tunnels[@]}"; do - libreswan_update_one "${n}" "${@}" - done + local n + for n in "${!libreswan_connected_tunnels[@]}"; do + libreswan_update_one "${n}" "${@}" + done - return 0 + return 0 } diff --git a/collectors/charts.d.plugin/load_average/Makefile.inc b/collectors/charts.d.plugin/load_average/Makefile.inc deleted file mode 100644 index e5a481bf4..000000000 --- a/collectors/charts.d.plugin/load_average/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += load_average/load_average.chart.sh -dist_chartsconfig_DATA += load_average/load_average.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += load_average/README.md load_average/Makefile.inc - diff --git a/collectors/charts.d.plugin/load_average/README.md b/collectors/charts.d.plugin/load_average/README.md deleted file mode 100644 index 40b860cc5..000000000 --- a/collectors/charts.d.plugin/load_average/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# load_average - -> THIS MODULE IS OBSOLETE. -> THE NETDATA DAEMON COLLECTS LOAD AVERAGE BY ITSELF - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fload_average%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/load_average/load_average.chart.sh b/collectors/charts.d.plugin/load_average/load_average.chart.sh deleted file mode 100644 index 841e3d9f6..000000000 --- a/collectors/charts.d.plugin/load_average/load_average.chart.sh +++ /dev/null @@ -1,69 +0,0 @@ -# shellcheck shell=bash disable=SC2154,SC1072,SC1073,SC2009,SC2162,SC2006,SC2002,SC2086,SC1117 -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -load_average_update_every=5 -load_priority=100 - -# this is an example charts.d collector -# it is disabled by default. -# there is no point to enable it, since netdata already -# collects this information using its internal plugins. -load_average_enabled=0 - -load_average_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - if [ ${load_average_update_every} -lt 5 ]; then - # there is no meaning for shorter than 5 seconds - # the kernel changes this value every 5 seconds - load_average_update_every=5 - fi - - [ ${load_average_enabled} -eq 0 ] && return 1 - return 0 -} - -load_average_create() { - # create a chart with 3 dimensions - cat <<EOF -CHART system.load '' "System Load Average" "load" load system.load line $((load_priority + 1)) $load_average_update_every -DIMENSION load1 '1 min' absolute 1 100 -DIMENSION load5 '5 mins' absolute 1 100 -DIMENSION load15 '15 mins' absolute 1 100 -EOF - - return 0 -} - -load_average_update() { - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - # here we parse the system average load - # it is decimal (with 2 decimal digits), so we remove the dot and - # at the definition we have divisor = 100, to have the graph show the right value - loadavg="$(cat /proc/loadavg | sed -e "s/\.//g")" - load1=$(echo $loadavg | cut -d ' ' -f 1) - load5=$(echo $loadavg | cut -d ' ' -f 2) - load15=$(echo $loadavg | cut -d ' ' -f 3) - - # write the result of the work. - cat <<VALUESEOF -BEGIN system.load -SET load1 = $load1 -SET load5 = $load5 -SET load15 = $load15 -END -VALUESEOF - - return 0 -} diff --git a/collectors/charts.d.plugin/load_average/load_average.conf b/collectors/charts.d.plugin/load_average/load_average.conf deleted file mode 100644 index 68979275f..000000000 --- a/collectors/charts.d.plugin/load_average/load_average.conf +++ /dev/null @@ -1,22 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# netdata can collect this metric already - -#load_average_enabled=0 - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#load_average_update_every=5 - -# the charts priority on the dashboard -#load_average_priority=100 - -# the number of retries to do in case of failure -# before disabling the module -#load_average_retries=10 diff --git a/collectors/charts.d.plugin/loopsleepms.sh.inc b/collectors/charts.d.plugin/loopsleepms.sh.inc index e44eff689..c386083fb 100644 --- a/collectors/charts.d.plugin/loopsleepms.sh.inc +++ b/collectors/charts.d.plugin/loopsleepms.sh.inc @@ -10,16 +10,24 @@ fi # ----------------------------------------------------------------------------- # use the date command as a high resolution timer +# macOS 'date' doesnt support '%N' precision +# echo $(/bin/date +"%N") is "N" +if [ "$($LOOPSLEEP_DATE +"%N")" = "N" ]; then + LOOPSLEEP_DATE_FORMAT="%s * 1000" +else + LOOPSLEEP_DATE_FORMAT="%s * 1000 + 10#%-N / 1000000" +fi + now_ms= LOOPSLEEPMS_HIGHRES=1 test "$($LOOPSLEEP_DATE +%N)" = "%N" && LOOPSLEEPMS_HIGHRES=0 test -z "$($LOOPSLEEP_DATE +%N)" && LOOPSLEEPMS_HIGHRES=0 current_time_ms_from_date() { - if [ $LOOPSLEEPMS_HIGHRES -eq 0 ]; then - now_ms="$($LOOPSLEEP_DATE +'%s')000" - else - now_ms="$(($($LOOPSLEEP_DATE +'%s * 1000 + %-N / 1000000')))" - fi + if [ $LOOPSLEEPMS_HIGHRES -eq 0 ]; then + now_ms="$($LOOPSLEEP_DATE +'%s')000" + else + now_ms="$(($($LOOPSLEEP_DATE +"$LOOPSLEEP_DATE_FORMAT")))" + fi } # ----------------------------------------------------------------------------- diff --git a/collectors/charts.d.plugin/mem_apps/Makefile.inc b/collectors/charts.d.plugin/mem_apps/Makefile.inc deleted file mode 100644 index ea546fb69..000000000 --- a/collectors/charts.d.plugin/mem_apps/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += mem_apps/mem_apps.chart.sh -dist_chartsconfig_DATA += mem_apps/mem_apps.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += mem_apps/README.md mem_apps/Makefile.inc - diff --git a/collectors/charts.d.plugin/mem_apps/README.md b/collectors/charts.d.plugin/mem_apps/README.md deleted file mode 100644 index 93d33832a..000000000 --- a/collectors/charts.d.plugin/mem_apps/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# mem_apps - -> THIS MODULE IS OBSOLETE. -> USE [APPS.PLUGIN](../../apps.plugin). - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fmem_apps%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/mem_apps/mem_apps.chart.sh b/collectors/charts.d.plugin/mem_apps/mem_apps.chart.sh deleted file mode 100644 index b9b84a467..000000000 --- a/collectors/charts.d.plugin/mem_apps/mem_apps.chart.sh +++ /dev/null @@ -1,62 +0,0 @@ -# shellcheck shell=bash disable=SC2154,SC1072,SC1073,SC2009,SC2162,SC2006,SC2002,SC2086,SC1117 -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -mem_apps_apps= - -# these are required for computing memory in bytes and cpu in seconds -#mem_apps_pagesize="`getconf PAGESIZE`" -#mem_apps_clockticks="`getconf CLK_TCK`" - -mem_apps_update_every= - -mem_apps_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - if [ -z "$mem_apps_apps" ]; then - error "manual configuration required: please set mem_apps_apps='command1 command2 ...' in $confd/mem_apps_apps.conf" - return 1 - fi - return 0 -} - -mem_apps_bc_finalze= - -mem_apps_create() { - - echo "CHART chartsd_apps.mem '' 'Apps Memory' MB apps apps.mem stacked 20000 $mem_apps_update_every" - - local x= - for x in $mem_apps_apps; do - echo "DIMENSION $x $x absolute 1 1024" - - # this string is needed later in the update() function - # to finalize the instructions for the bc command - mem_apps_bc_finalze="$mem_apps_bc_finalze \"SET $x = \"; $x;" - done - return 0 -} - -mem_apps_update() { - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - echo "BEGIN chartsd_apps.mem" - ps -o comm,rss -C "$mem_apps_apps" | - grep -v "^COMMAND" | - ( - sed -e "s/ \+/ /g" -e "s/ /+=/g" - echo "$mem_apps_bc_finalze" - ) | bc - echo "END" - - return 0 -} diff --git a/collectors/charts.d.plugin/mem_apps/mem_apps.conf b/collectors/charts.d.plugin/mem_apps/mem_apps.conf deleted file mode 100644 index 75d24dc3e..000000000 --- a/collectors/charts.d.plugin/mem_apps/mem_apps.conf +++ /dev/null @@ -1,19 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# app.plugin can do better - -#mem_apps_apps= - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#mem_apps_update_every=2 - -# the number of retries to do in case of failure -# before disabling the module -#mem_apps_retries=10 diff --git a/collectors/charts.d.plugin/mysql/Makefile.inc b/collectors/charts.d.plugin/mysql/Makefile.inc deleted file mode 100644 index ca02fd078..000000000 --- a/collectors/charts.d.plugin/mysql/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += mysql/mysql.chart.sh -dist_chartsconfig_DATA += mysql/mysql.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += mysql/README.md mysql/Makefile.inc - diff --git a/collectors/charts.d.plugin/mysql/README.md b/collectors/charts.d.plugin/mysql/README.md deleted file mode 100644 index 2e8d72a43..000000000 --- a/collectors/charts.d.plugin/mysql/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# mysql - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/mysql) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -The plugin will monitor one or more mysql servers - -It will produce the following charts: - -1. **Bandwidth** in kbps - -- in -- out - -2. **Queries** in queries/sec - -- queries -- questions -- slow queries - -3. **Operations** in operations/sec - -- opened tables -- flush -- commit -- delete -- prepare -- read first -- read key -- read next -- read prev -- read random -- read random next -- rollback -- save point -- update -- write - -4. **Table Locks** in locks/sec - -- immediate -- waited - -5. **Select Issues** in issues/sec - -- full join -- full range join -- range -- range check -- scan - -6. **Sort Issues** in issues/sec - -- merge passes -- range -- scan - -## configuration - -You can configure many database servers, like this: - -You can provide, per server, the following: - -1. a name, anything you like, but keep it short -2. the mysql command to connect to the server -3. the mysql command line options to be used for connecting to the server - -Here is an example for 2 servers: - -```sh -mysql_opts[server1]="-h server1.example.com" -mysql_opts[server2]="-h server2.example.com --connect_timeout 2" -``` - -The above will use the `mysql` command found in the system path. -You can also provide a custom mysql command per server, like this: - -```sh -mysql_cmds[server2]="/opt/mysql/bin/mysql" -``` - -The above sets the mysql command only for server2. server1 will use the system default. - -If no configuration is given, the plugin will attempt to connect to mysql server at localhost. - ---- - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fmysql%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/mysql/mysql.chart.sh b/collectors/charts.d.plugin/mysql/mysql.chart.sh deleted file mode 100644 index e1207dc9a..000000000 --- a/collectors/charts.d.plugin/mysql/mysql.chart.sh +++ /dev/null @@ -1,511 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -# http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html -# -# https://dev.mysql.com/doc/refman/5.1/en/show-status.html -# SHOW STATUS provides server status information (see Section 5.1.6, “Server Status Variables”). -# This statement does not require any privilege. -# It requires only the ability to connect to the server. - -mysql_update_every=2 -mysql_priority=60000 - -declare -A mysql_cmds=() mysql_opts=() mysql_ids=() mysql_data=() - -mysql_get() { - local arr - local oIFS="${IFS}" - mysql_data=() - IFS=$'\t'$'\n' - #arr=($(run "${@}" -e "SHOW GLOBAL STATUS WHERE value REGEXP '^[0-9]';" | egrep "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)" )) - #arr=($(run "${@}" -N -e "SHOW GLOBAL STATUS;" | egrep "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)[^ ]+\s[0-9]" )) - # shellcheck disable=SC2207 - arr=($(run "${@}" -N -e "SHOW GLOBAL STATUS;" | grep -E "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)[^[:space:]]+[[:space:]]+[0-9]+")) - IFS="${oIFS}" - - [ "${#arr[@]}" -lt 3 ] && return 1 - local end=${#arr[@]} - for ((i = 2; i < end; i += 2)); do - mysql_data["${arr[$i]}"]=${arr[i + 1]} - done - - [ -z "${mysql_data[Connections]}" ] && return 1 - - mysql_data[Thread_cache_misses]=0 - [ $((mysql_data[Connections] + 1 - 1)) -gt 0 ] && mysql_data[Thread_cache_misses]=$((mysql_data[Threads_created] * 10000 / mysql_data[Connections])) - - return 0 -} - -mysql_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - local x m mysql_cmd tryroot=0 unconfigured=0 - - if [ "${1}" = "tryroot" ]; then - tryroot=1 - shift - fi - - # shellcheck disable=SC2230 - [ -z "${mysql_cmd}" ] && mysql_cmd="$(which mysql 2>/dev/null || command -v mysql 2>/dev/null)" - - if [ ${#mysql_opts[@]} -eq 0 ]; then - unconfigured=1 - - mysql_cmds[local]="$mysql_cmd" - - if [ $tryroot -eq 1 ]; then - # the user has not configured us for mysql access - # if the root user is passwordless in mysql, we can - # attempt to connect to mysql as root - mysql_opts[local]="-u root" - else - mysql_opts[local]= - fi - fi - - # check once if the url works - for m in "${!mysql_opts[@]}"; do - [ -z "${mysql_cmds[$m]}" ] && mysql_cmds[$m]="$mysql_cmd" - if [ -z "${mysql_cmds[$m]}" ]; then - # shellcheck disable=SC2154 - error "cannot get mysql command for '${m}'. Please set mysql_cmds[$m]='/path/to/mysql', in $confd/mysql.conf" - fi - - mysql_get "${mysql_cmds[$m]}" ${mysql_opts[$m]} - # shellcheck disable=SC2181 - if [ ! $? -eq 0 ]; then - error "cannot get global status for '$m'. Please set mysql_opts[$m]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf" - unset "mysql_cmds[$m]" - unset "mysql_opts[$m]" - unset "mysql_ids[$m]" - continue - fi - - mysql_ids[$m]="$(fixid "$m")" - done - - if [ ${#mysql_opts[@]} -eq 0 ]; then - if [ ${unconfigured} -eq 1 ] && [ ${tryroot} -eq 0 ]; then - mysql_check tryroot "${@}" - return $? - else - error "no mysql servers found. Please set mysql_opts[name]='options' to whatever needed to get connected to the mysql server, in $confd/mysql.conf" - return 1 - fi - fi - - return 0 -} - -mysql_create() { - local x - - # create the charts - for x in "${mysql_ids[@]}"; do - cat <<EOF -CHART mysql_$x.net '' "mysql Bandwidth" "kilobits/s" bandwidth mysql.net area $((mysql_priority + 1)) $mysql_update_every -DIMENSION Bytes_received in incremental 8 1024 -DIMENSION Bytes_sent out incremental -8 1024 - -CHART mysql_$x.queries '' "mysql Queries" "queries/s" queries mysql.queries line $((mysql_priority + 2)) $mysql_update_every -DIMENSION Queries queries incremental 1 1 -DIMENSION Questions questions incremental 1 1 -DIMENSION Slow_queries slow_queries incremental -1 1 - -CHART mysql_$x.handlers '' "mysql Handlers" "handlers/s" handlers mysql.handlers line $((mysql_priority + 3)) $mysql_update_every -DIMENSION Handler_commit commit incremental 1 1 -DIMENSION Handler_delete delete incremental 1 1 -DIMENSION Handler_prepare prepare incremental 1 1 -DIMENSION Handler_read_first read_first incremental 1 1 -DIMENSION Handler_read_key read_key incremental 1 1 -DIMENSION Handler_read_next read_next incremental 1 1 -DIMENSION Handler_read_prev read_prev incremental 1 1 -DIMENSION Handler_read_rnd read_rnd incremental 1 1 -DIMENSION Handler_read_rnd_next read_rnd_next incremental 1 1 -DIMENSION Handler_rollback rollback incremental 1 1 -DIMENSION Handler_savepoint savepoint incremental 1 1 -DIMENSION Handler_savepoint_rollback savepoint_rollback incremental 1 1 -DIMENSION Handler_update update incremental 1 1 -DIMENSION Handler_write write incremental 1 1 - -CHART mysql_$x.table_locks '' "mysql Tables Locks" "locks/s" locks mysql.table_locks line $((mysql_priority + 4)) $mysql_update_every -DIMENSION Table_locks_immediate immediate incremental 1 1 -DIMENSION Table_locks_waited waited incremental -1 1 - -CHART mysql_$x.join_issues '' "mysql Select Join Issues" "joins/s" issues mysql.join_issues line $((mysql_priority + 5)) $mysql_update_every -DIMENSION Select_full_join full_join incremental 1 1 -DIMENSION Select_full_range_join full_range_join incremental 1 1 -DIMENSION Select_range range incremental 1 1 -DIMENSION Select_range_check range_check incremental 1 1 -DIMENSION Select_scan scan incremental 1 1 - -CHART mysql_$x.sort_issues '' "mysql Sort Issues" "issues/s" issues mysql.sort.issues line $((mysql_priority + 6)) $mysql_update_every -DIMENSION Sort_merge_passes merge_passes incremental 1 1 -DIMENSION Sort_range range incremental 1 1 -DIMENSION Sort_scan scan incremental 1 1 - -CHART mysql_$x.tmp '' "mysql Tmp Operations" "counter" temporaries mysql.tmp line $((mysql_priority + 7)) $mysql_update_every -DIMENSION Created_tmp_disk_tables disk_tables incremental 1 1 -DIMENSION Created_tmp_files files incremental 1 1 -DIMENSION Created_tmp_tables tables incremental 1 1 - -CHART mysql_$x.connections '' "mysql Connections" "connections/s" connections mysql.connections line $((mysql_priority + 8)) $mysql_update_every -DIMENSION Connections all incremental 1 1 -DIMENSION Aborted_connects aborded incremental 1 1 - -CHART mysql_$x.binlog_cache '' "mysql Binlog Cache" "transactions/s" binlog mysql.binlog_cache line $((mysql_priority + 9)) $mysql_update_every -DIMENSION Binlog_cache_disk_use disk incremental 1 1 -DIMENSION Binlog_cache_use all incremental 1 1 - -CHART mysql_$x.threads '' "mysql Threads" "threads" threads mysql.threads line $((mysql_priority + 10)) $mysql_update_every -DIMENSION Threads_connected connected absolute 1 1 -DIMENSION Threads_created created incremental 1 1 -DIMENSION Threads_cached cached absolute -1 1 -DIMENSION Threads_running running absolute 1 1 - -CHART mysql_$x.thread_cache_misses '' "mysql Threads Cache Misses" "misses" threads mysql.thread_cache_misses area $((mysql_priority + 11)) $mysql_update_every -DIMENSION misses misses absolute 1 100 - -CHART mysql_$x.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" innodb mysql.innodb_io area $((mysql_priority + 12)) $mysql_update_every -DIMENSION Innodb_data_read read incremental 1 1024 -DIMENSION Innodb_data_written write incremental -1 1024 - -CHART mysql_$x.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" innodb mysql.innodb_io_ops line $((mysql_priority + 13)) $mysql_update_every -DIMENSION Innodb_data_reads reads incremental 1 1 -DIMENSION Innodb_data_writes writes incremental -1 1 -DIMENSION Innodb_data_fsyncs fsyncs incremental 1 1 - -CHART mysql_$x.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" innodb mysql.innodb_io_pending_ops line $((mysql_priority + 14)) $mysql_update_every -DIMENSION Innodb_data_pending_reads reads absolute 1 1 -DIMENSION Innodb_data_pending_writes writes absolute -1 1 -DIMENSION Innodb_data_pending_fsyncs fsyncs absolute 1 1 - -CHART mysql_$x.innodb_log '' "mysql InnoDB Log Operations" "operations/s" innodb mysql.innodb_log line $((mysql_priority + 15)) $mysql_update_every -DIMENSION Innodb_log_waits waits incremental 1 1 -DIMENSION Innodb_log_write_requests write_requests incremental -1 1 -DIMENSION Innodb_log_writes writes incremental -1 1 - -CHART mysql_$x.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" innodb mysql.innodb_os_log line $((mysql_priority + 16)) $mysql_update_every -DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 1 -DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs absolute 1 1 -DIMENSION Innodb_os_log_pending_writes pending_writes absolute -1 1 - -CHART mysql_$x.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" innodb mysql.innodb_os_log_io area $((mysql_priority + 17)) $mysql_update_every -DIMENSION Innodb_os_log_written write incremental -1 1024 - -CHART mysql_$x.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" innodb mysql.innodb_cur_row_lock area $((mysql_priority + 18)) $mysql_update_every -DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 1 - -CHART mysql_$x.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" innodb mysql.innodb_rows area $((mysql_priority + 19)) $mysql_update_every -DIMENSION Innodb_rows_read read incremental 1 1 -DIMENSION Innodb_rows_deleted deleted incremental -1 1 -DIMENSION Innodb_rows_inserted inserted incremental 1 1 -DIMENSION Innodb_rows_updated updated incremental -1 1 - -CHART mysql_$x.innodb_buffer_pool_pages '' "mysql InnoDB Buffer Pool Pages" "pages" innodb mysql.innodb_buffer_pool_pages line $((mysql_priority + 20)) $mysql_update_every -DIMENSION Innodb_buffer_pool_pages_data data absolute 1 1 -DIMENSION Innodb_buffer_pool_pages_dirty dirty absolute -1 1 -DIMENSION Innodb_buffer_pool_pages_free free absolute 1 1 -DIMENSION Innodb_buffer_pool_pages_flushed flushed incremental -1 1 -DIMENSION Innodb_buffer_pool_pages_misc misc absolute -1 1 -DIMENSION Innodb_buffer_pool_pages_total total absolute 1 1 - -CHART mysql_$x.innodb_buffer_pool_bytes '' "mysql InnoDB Buffer Pool Bytes" "MiB" innodb mysql.innodb_buffer_pool_bytes area $((mysql_priority + 21)) $mysql_update_every -DIMENSION Innodb_buffer_pool_bytes_data data absolute 1 $((1024 * 1024)) -DIMENSION Innodb_buffer_pool_bytes_dirty dirty absolute -1 $((1024 * 1024)) - -CHART mysql_$x.innodb_buffer_pool_read_ahead '' "mysql InnoDB Buffer Pool Read Ahead" "operations/s" innodb mysql.innodb_buffer_pool_read_ahead area $((mysql_priority + 22)) $mysql_update_every -DIMENSION Innodb_buffer_pool_read_ahead all incremental 1 1 -DIMENSION Innodb_buffer_pool_read_ahead_evicted evicted incremental -1 1 -DIMENSION Innodb_buffer_pool_read_ahead_rnd random incremental 1 1 - -CHART mysql_$x.innodb_buffer_pool_reqs '' "mysql InnoDB Buffer Pool Requests" "requests/s" innodb mysql.innodb_buffer_pool_reqs area $((mysql_priority + 23)) $mysql_update_every -DIMENSION Innodb_buffer_pool_read_requests reads incremental 1 1 -DIMENSION Innodb_buffer_pool_write_requests writes incremental -1 1 - -CHART mysql_$x.innodb_buffer_pool_ops '' "mysql InnoDB Buffer Pool Operations" "operations/s" innodb mysql.innodb_buffer_pool_ops area $((mysql_priority + 24)) $mysql_update_every -DIMENSION Innodb_buffer_pool_reads 'disk reads' incremental 1 1 -DIMENSION Innodb_buffer_pool_wait_free 'wait free' incremental -1 1 - -CHART mysql_$x.qcache_ops '' "mysql QCache Operations" "queries/s" qcache mysql.qcache_ops line $((mysql_priority + 25)) $mysql_update_every -DIMENSION Qcache_hits hits incremental 1 1 -DIMENSION Qcache_lowmem_prunes 'lowmem prunes' incremental -1 1 -DIMENSION Qcache_inserts inserts incremental 1 1 -DIMENSION Qcache_not_cached 'not cached' incremental -1 1 - -CHART mysql_$x.qcache '' "mysql QCache Queries in Cache" "queries" qcache mysql.qcache line $((mysql_priority + 26)) $mysql_update_every -DIMENSION Qcache_queries_in_cache queries absolute 1 1 - -CHART mysql_$x.qcache_freemem '' "mysql QCache Free Memory" "MiB" qcache mysql.qcache_freemem area $((mysql_priority + 27)) $mysql_update_every -DIMENSION Qcache_free_memory free absolute 1 $((1024 * 1024)) - -CHART mysql_$x.qcache_memblocks '' "mysql QCache Memory Blocks" "blocks" qcache mysql.qcache_memblocks line $((mysql_priority + 28)) $mysql_update_every -DIMENSION Qcache_free_blocks free absolute 1 1 -DIMENSION Qcache_total_blocks total absolute 1 1 - -CHART mysql_$x.key_blocks '' "mysql MyISAM Key Cache Blocks" "blocks" myisam mysql.key_blocks line $((mysql_priority + 29)) $mysql_update_every -DIMENSION Key_blocks_unused unused absolute 1 1 -DIMENSION Key_blocks_used used absolute -1 1 -DIMENSION Key_blocks_not_flushed 'not flushed' absolute 1 1 - -CHART mysql_$x.key_requests '' "mysql MyISAM Key Cache Requests" "requests/s" myisam mysql.key_requests area $((mysql_priority + 30)) $mysql_update_every -DIMENSION Key_read_requests reads incremental 1 1 -DIMENSION Key_write_requests writes incremental -1 1 - -CHART mysql_$x.key_disk_ops '' "mysql MyISAM Key Cache Disk Operations" "operations/s" myisam mysql.key_disk_ops area $((mysql_priority + 31)) $mysql_update_every -DIMENSION Key_reads reads incremental 1 1 -DIMENSION Key_writes writes incremental -1 1 - -CHART mysql_$x.files '' "mysql Open Files" "files" files mysql.files line $((mysql_priority + 32)) $mysql_update_every -DIMENSION Open_files files absolute 1 1 - -CHART mysql_$x.files_rate '' "mysql Opened Files Rate" "files/s" files mysql.files_rate line $((mysql_priority + 33)) $mysql_update_every -DIMENSION Opened_files files incremental 1 1 -EOF - - if [ ! -z "${mysql_data[Binlog_stmt_cache_disk_use]}" ]; then - cat <<EOF -CHART mysql_$x.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" binlog mysql.binlog_stmt_cache line $((mysql_priority + 50)) $mysql_update_every -DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 1 -DIMENSION Binlog_stmt_cache_use all incremental 1 1 -EOF - fi - - if [ ! -z "${mysql_data[Connection_errors_accept]}" ]; then - cat <<EOF -CHART mysql_$x.connection_errors '' "mysql Connection Errors" "connections/s" connections mysql.connection_errors line $((mysql_priority + 51)) $mysql_update_every -DIMENSION Connection_errors_accept accept incremental 1 1 -DIMENSION Connection_errors_internal internal incremental 1 1 -DIMENSION Connection_errors_max_connections max incremental 1 1 -DIMENSION Connection_errors_peer_addr peer_addr incremental 1 1 -DIMENSION Connection_errors_select select incremental 1 1 -DIMENSION Connection_errors_tcpwrap tcpwrap incremental 1 1 -EOF - fi - - done - return 0 -} - -mysql_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - local m x - for m in "${!mysql_ids[@]}"; do - x="${mysql_ids[$m]}" - mysql_get "${mysql_cmds[$m]}" ${mysql_opts[$m]} - - # shellcheck disable=SC2181 - if [ $? -ne 0 ]; then - unset "mysql_ids[$m]" - unset "mysql_opts[$m]" - unset "mysql_cmds[$m]" - error "failed to get values for '${m}', disabling it." - continue - fi - - # write the result of the work. - cat <<VALUESEOF -BEGIN mysql_$x.net $1 -SET Bytes_received = ${mysql_data[Bytes_received]} -SET Bytes_sent = ${mysql_data[Bytes_sent]} -END -BEGIN mysql_$x.queries $1 -SET Queries = ${mysql_data[Queries]} -SET Questions = ${mysql_data[Questions]} -SET Slow_queries = ${mysql_data[Slow_queries]} -END -BEGIN mysql_$x.handlers $1 -SET Handler_commit = ${mysql_data[Handler_commit]} -SET Handler_delete = ${mysql_data[Handler_delete]} -SET Handler_prepare = ${mysql_data[Handler_prepare]} -SET Handler_read_first = ${mysql_data[Handler_read_first]} -SET Handler_read_key = ${mysql_data[Handler_read_key]} -SET Handler_read_next = ${mysql_data[Handler_read_next]} -SET Handler_read_prev = ${mysql_data[Handler_read_prev]} -SET Handler_read_rnd = ${mysql_data[Handler_read_rnd]} -SET Handler_read_rnd_next = ${mysql_data[Handler_read_rnd_next]} -SET Handler_rollback = ${mysql_data[Handler_rollback]} -SET Handler_savepoint = ${mysql_data[Handler_savepoint]} -SET Handler_savepoint_rollback = ${mysql_data[Handler_savepoint_rollback]} -SET Handler_update = ${mysql_data[Handler_update]} -SET Handler_write = ${mysql_data[Handler_write]} -END -BEGIN mysql_$x.table_locks $1 -SET Table_locks_immediate = ${mysql_data[Table_locks_immediate]} -SET Table_locks_waited = ${mysql_data[Table_locks_waited]} -END -BEGIN mysql_$x.join_issues $1 -SET Select_full_join = ${mysql_data[Select_full_join]} -SET Select_full_range_join = ${mysql_data[Select_full_range_join]} -SET Select_range = ${mysql_data[Select_range]} -SET Select_range_check = ${mysql_data[Select_range_check]} -SET Select_scan = ${mysql_data[Select_scan]} -END -BEGIN mysql_$x.sort_issues $1 -SET Sort_merge_passes = ${mysql_data[Sort_merge_passes]} -SET Sort_range = ${mysql_data[Sort_range]} -SET Sort_scan = ${mysql_data[Sort_scan]} -END -BEGIN mysql_$x.tmp $1 -SET Created_tmp_disk_tables = ${mysql_data[Created_tmp_disk_tables]} -SET Created_tmp_files = ${mysql_data[Created_tmp_files]} -SET Created_tmp_tables = ${mysql_data[Created_tmp_tables]} -END -BEGIN mysql_$x.connections $1 -SET Connections = ${mysql_data[Connections]} -SET Aborted_connects = ${mysql_data[Aborted_connects]} -END -BEGIN mysql_$x.binlog_cache $1 -SET Binlog_cache_disk_use = ${mysql_data[Binlog_cache_disk_use]} -SET Binlog_cache_use = ${mysql_data[Binlog_cache_use]} -END -BEGIN mysql_$x.threads $1 -SET Threads_connected = ${mysql_data[Threads_connected]} -SET Threads_created = ${mysql_data[Threads_created]} -SET Threads_cached = ${mysql_data[Threads_cached]} -SET Threads_running = ${mysql_data[Threads_running]} -END -BEGIN mysql_$x.thread_cache_misses $1 -SET misses = ${mysql_data[Thread_cache_misses]} -END -BEGIN mysql_$x.innodb_io $1 -SET Innodb_data_read = ${mysql_data[Innodb_data_read]} -SET Innodb_data_written = ${mysql_data[Innodb_data_written]} -END -BEGIN mysql_$x.innodb_io_ops $1 -SET Innodb_data_reads = ${mysql_data[Innodb_data_reads]} -SET Innodb_data_writes = ${mysql_data[Innodb_data_writes]} -SET Innodb_data_fsyncs = ${mysql_data[Innodb_data_fsyncs]} -END -BEGIN mysql_$x.innodb_io_pending_ops $1 -SET Innodb_data_pending_reads = ${mysql_data[Innodb_data_pending_reads]} -SET Innodb_data_pending_writes = ${mysql_data[Innodb_data_pending_writes]} -SET Innodb_data_pending_fsyncs = ${mysql_data[Innodb_data_pending_fsyncs]} -END -BEGIN mysql_$x.innodb_log $1 -SET Innodb_log_waits = ${mysql_data[Innodb_log_waits]} -SET Innodb_log_write_requests = ${mysql_data[Innodb_log_write_requests]} -SET Innodb_log_writes = ${mysql_data[Innodb_log_writes]} -END -BEGIN mysql_$x.innodb_os_log $1 -SET Innodb_os_log_fsyncs = ${mysql_data[Innodb_os_log_fsyncs]} -SET Innodb_os_log_pending_fsyncs = ${mysql_data[Innodb_os_log_pending_fsyncs]} -SET Innodb_os_log_pending_writes = ${mysql_data[Innodb_os_log_pending_writes]} -END -BEGIN mysql_$x.innodb_os_log_io $1 -SET Innodb_os_log_written = ${mysql_data[Innodb_os_log_written]} -END -BEGIN mysql_$x.innodb_cur_row_lock $1 -SET Innodb_row_lock_current_waits = ${mysql_data[Innodb_row_lock_current_waits]} -END -BEGIN mysql_$x.innodb_rows $1 -SET Innodb_rows_inserted = ${mysql_data[Innodb_rows_inserted]} -SET Innodb_rows_read = ${mysql_data[Innodb_rows_read]} -SET Innodb_rows_updated = ${mysql_data[Innodb_rows_updated]} -SET Innodb_rows_deleted = ${mysql_data[Innodb_rows_deleted]} -END -BEGIN mysql_$x.innodb_buffer_pool_pages $1 -SET Innodb_buffer_pool_pages_data = ${mysql_data[Innodb_buffer_pool_pages_data]} -SET Innodb_buffer_pool_pages_dirty = ${mysql_data[Innodb_buffer_pool_pages_dirty]} -SET Innodb_buffer_pool_pages_free = ${mysql_data[Innodb_buffer_pool_pages_free]} -SET Innodb_buffer_pool_pages_flushed = ${mysql_data[Innodb_buffer_pool_pages_flushed]} -SET Innodb_buffer_pool_pages_misc = ${mysql_data[Innodb_buffer_pool_pages_misc]} -SET Innodb_buffer_pool_pages_total = ${mysql_data[Innodb_buffer_pool_pages_total]} -END -BEGIN mysql_$x.innodb_buffer_pool_bytes $1 -SET Innodb_buffer_pool_bytes_data = ${mysql_data[Innodb_buffer_pool_bytes_data]} -SET Innodb_buffer_pool_bytes_dirty = ${mysql_data[Innodb_buffer_pool_bytes_dirty]} -END -BEGIN mysql_$x.innodb_buffer_pool_read_ahead $1 -SET Innodb_buffer_pool_read_ahead = ${mysql_data[Innodb_buffer_pool_read_ahead]} -SET Innodb_buffer_pool_read_ahead_evicted = ${mysql_data[Innodb_buffer_pool_read_ahead_evicted]} -SET Innodb_buffer_pool_read_ahead_rnd = ${mysql_data[Innodb_buffer_pool_read_ahead_rnd]} -END -BEGIN mysql_$x.innodb_buffer_pool_reqs $1 -SET Innodb_buffer_pool_read_requests = ${mysql_data[Innodb_buffer_pool_read_requests]} -SET Innodb_buffer_pool_write_requests = ${mysql_data[Innodb_buffer_pool_write_requests]} -END -BEGIN mysql_$x.innodb_buffer_pool_ops $1 -SET Innodb_buffer_pool_reads = ${mysql_data[Innodb_buffer_pool_reads]} -SET Innodb_buffer_pool_wait_free = ${mysql_data[Innodb_buffer_pool_wait_free]} -END -BEGIN mysql_$x.qcache_ops $1 -SET Qcache_hits hits = ${mysql_data[Qcache_hits]} -SET Qcache_lowmem_prunes = ${mysql_data[Qcache_lowmem_prunes]} -SET Qcache_inserts = ${mysql_data[Qcache_inserts]} -SET Qcache_not_cached = ${mysql_data[Qcache_not_cached]} -END -BEGIN mysql_$x.qcache $1 -SET Qcache_queries_in_cache = ${mysql_data[Qcache_queries_in_cache]} -END -BEGIN mysql_$x.qcache_freemem $1 -SET Qcache_free_memory = ${mysql_data[Qcache_free_memory]} -END -BEGIN mysql_$x.qcache_memblocks $1 -SET Qcache_free_blocks = ${mysql_data[Qcache_free_blocks]} -SET Qcache_total_blocks = ${mysql_data[Qcache_total_blocks]} -END -BEGIN mysql_$x.key_blocks $1 -SET Key_blocks_unused = ${mysql_data[Key_blocks_unused]} -SET Key_blocks_used = ${mysql_data[Key_blocks_used]} -SET Key_blocks_not_flushed = ${mysql_data[Key_blocks_not_flushed]} -END -BEGIN mysql_$x.key_requests $1 -SET Key_read_requests = ${mysql_data[Key_read_requests]} -SET Key_write_requests = ${mysql_data[Key_write_requests]} -END -BEGIN mysql_$x.key_disk_ops $1 -SET Key_reads = ${mysql_data[Key_reads]} -SET Key_writes = ${mysql_data[Key_writes]} -END -BEGIN mysql_$x.files $1 -SET Open_files = ${mysql_data[Open_files]} -END -BEGIN mysql_$x.files_rate $1 -SET Opened_files = ${mysql_data[Opened_files]} -END -VALUESEOF - - if [ ! -z "${mysql_data[Binlog_stmt_cache_disk_use]}" ]; then - cat <<VALUESEOF -BEGIN mysql_$x.binlog_stmt_cache $1 -SET Binlog_stmt_cache_disk_use = ${mysql_data[Binlog_stmt_cache_disk_use]} -SET Binlog_stmt_cache_use = ${mysql_data[Binlog_stmt_cache_use]} -END -VALUESEOF - fi - - if [ ! -z "${mysql_data[Connection_errors_accept]}" ]; then - cat <<VALUESEOF -BEGIN mysql_$x.connection_errors $1 -SET Connection_errors_accept = ${mysql_data[Connection_errors_accept]} -SET Connection_errors_internal = ${mysql_data[Connection_errors_internal]} -SET Connection_errors_max_connections = ${mysql_data[Connection_errors_max_connections]} -SET Connection_errors_peer_addr = ${mysql_data[Connection_errors_peer_addr]} -SET Connection_errors_select = ${mysql_data[Connection_errors_select]} -SET Connection_errors_tcpwrap = ${mysql_data[Connection_errors_tcpwrap]} -END -VALUESEOF - fi - done - - [ ${#mysql_ids[@]} -eq 0 ] && error "no mysql servers left active." && return 1 - return 0 -} diff --git a/collectors/charts.d.plugin/mysql/mysql.conf b/collectors/charts.d.plugin/mysql/mysql.conf deleted file mode 100644 index 683e4af35..000000000 --- a/collectors/charts.d.plugin/mysql/mysql.conf +++ /dev/null @@ -1,23 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -#mysql_cmds[name]="" -#mysql_opts[name]="" - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#mysql_update_every=2 - -# the charts priority on the dashboard -#mysql_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#mysql_retries=10 diff --git a/collectors/charts.d.plugin/nginx/Makefile.inc b/collectors/charts.d.plugin/nginx/Makefile.inc deleted file mode 100644 index c9d31aada..000000000 --- a/collectors/charts.d.plugin/nginx/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += nginx/nginx.chart.sh -dist_chartsconfig_DATA += nginx/nginx.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += nginx/README.md nginx/Makefile.inc - diff --git a/collectors/charts.d.plugin/nginx/README.md b/collectors/charts.d.plugin/nginx/README.md deleted file mode 100644 index 57b4a4b12..000000000 --- a/collectors/charts.d.plugin/nginx/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# nginx - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/nginx) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fnginx%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/nginx/nginx.chart.sh b/collectors/charts.d.plugin/nginx/nginx.chart.sh deleted file mode 100644 index 812de2cbb..000000000 --- a/collectors/charts.d.plugin/nginx/nginx.chart.sh +++ /dev/null @@ -1,141 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -# if this chart is called X.chart.sh, then all functions and global variables -# must start with X_ - -nginx_url="http://127.0.0.1:80/stub_status" -nginx_curl_opts="" - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -nginx_update_every= -nginx_priority=60000 - -declare -a nginx_response=() -nginx_active_connections=0 -nginx_accepts=0 -nginx_handled=0 -nginx_requests=0 -nginx_reading=0 -nginx_writing=0 -nginx_waiting=0 -nginx_get() { - # shellcheck disable=SC2207 - nginx_response=($(run curl -Ss ${nginx_curl_opts} "${nginx_url}")) - # shellcheck disable=SC2181 - if [ $? -ne 0 ] || [ "${#nginx_response[@]}" -eq 0 ]; then return 1; fi - - if [ "${nginx_response[0]}" != "Active" ] || - [ "${nginx_response[1]}" != "connections:" ] || - [ "${nginx_response[3]}" != "server" ] || - [ "${nginx_response[4]}" != "accepts" ] || - [ "${nginx_response[5]}" != "handled" ] || - [ "${nginx_response[6]}" != "requests" ] || - [ "${nginx_response[10]}" != "Reading:" ] || - [ "${nginx_response[12]}" != "Writing:" ] || - [ "${nginx_response[14]}" != "Waiting:" ]; then - error "Invalid response from nginx server: ${nginx_response[*]}" - return 1 - fi - - nginx_active_connections="${nginx_response[2]}" - nginx_accepts="${nginx_response[7]}" - nginx_handled="${nginx_response[8]}" - nginx_requests="${nginx_response[9]}" - nginx_reading="${nginx_response[11]}" - nginx_writing="${nginx_response[13]}" - nginx_waiting="${nginx_response[15]}" - - if [ -z "${nginx_active_connections}" ] || - [ -z "${nginx_accepts}" ] || - [ -z "${nginx_handled}" ] || - [ -z "${nginx_requests}" ] || - [ -z "${nginx_reading}" ] || - [ -z "${nginx_writing}" ] || - [ -z "${nginx_waiting}" ]; then - error "empty values got from nginx server: ${nginx_response[*]}" - return 1 - fi - - return 0 -} - -# _check is called once, to find out if this chart should be enabled or not -nginx_check() { - - nginx_get - # shellcheck disable=2181 - if [ $? -ne 0 ]; then - # shellcheck disable=SC2154 - error "cannot find stub_status on URL '${nginx_url}'. Please set nginx_url='http://nginx.server/stub_status' in $confd/nginx.conf" - return 1 - fi - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - return 0 -} - -# _create is called once, to create the charts -nginx_create() { - cat <<EOF -CHART nginx_local.connections '' "nginx Active Connections" "connections" nginx nginx.connections line $((nginx_priority + 1)) $nginx_update_every -DIMENSION active '' absolute 1 1 - -CHART nginx_local.requests '' "nginx Requests" "requests/s" nginx nginx.requests line $((nginx_priority + 2)) $nginx_update_every -DIMENSION requests '' incremental 1 1 - -CHART nginx_local.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx.connections.status line $((nginx_priority + 3)) $nginx_update_every -DIMENSION reading '' absolute 1 1 -DIMENSION writing '' absolute 1 1 -DIMENSION waiting idle absolute 1 1 - -CHART nginx_local.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx.connections.rate line $((nginx_priority + 4)) $nginx_update_every -DIMENSION accepts accepted incremental 1 1 -DIMENSION handled '' incremental 1 1 -EOF - - return 0 -} - -# _update is called continuously, to collect the values -nginx_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - nginx_get || return 1 - - # write the result of the work. - cat <<VALUESEOF -BEGIN nginx_local.connections $1 -SET active = $((nginx_active_connections)) -END -BEGIN nginx_local.requests $1 -SET requests = $((nginx_requests)) -END -BEGIN nginx_local.connections_status $1 -SET reading = $((nginx_reading)) -SET writing = $((nginx_writing)) -SET waiting = $((nginx_waiting)) -END -BEGIN nginx_local.connect_rate $1 -SET accepts = $((nginx_accepts)) -SET handled = $((nginx_handled)) -END -VALUESEOF - - return 0 -} diff --git a/collectors/charts.d.plugin/nginx/nginx.conf b/collectors/charts.d.plugin/nginx/nginx.conf deleted file mode 100644 index c46100a58..000000000 --- a/collectors/charts.d.plugin/nginx/nginx.conf +++ /dev/null @@ -1,23 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -#nginx_url="http://127.0.0.1:80/stub_status" -#nginx_curl_opts="" - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#nginx_update_every= - -# the charts priority on the dashboard -#nginx_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#nginx_retries=10 diff --git a/collectors/charts.d.plugin/nut/README.md b/collectors/charts.d.plugin/nut/README.md index ea93318f8..3f9c5f0a2 100644 --- a/collectors/charts.d.plugin/nut/README.md +++ b/collectors/charts.d.plugin/nut/README.md @@ -1,6 +1,12 @@ -# nut +<!-- +title: "UPS/PDU monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/nut/README.md +sidebar_label: "UPS/PDU" +--> -The plugin will collect UPS data for all UPSes configured in the system. +# UPS/PDU monitoring with Netdata + +Collects UPS data for all power devices configured in the system. The following charts will be created: @@ -42,9 +48,17 @@ The following charts will be created: - current temperature -## configuration +## Configuration + +Edit the `charts.d/nut.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/nut.conf +``` -This is the internal default for `/etc/netdata/nut.conf` +This is the internal default for `charts.d/nut.conf` ```sh # a space separated list of UPS names diff --git a/collectors/charts.d.plugin/nut/nut.chart.sh b/collectors/charts.d.plugin/nut/nut.chart.sh index 933d3561d..60233361e 100644 --- a/collectors/charts.d.plugin/nut/nut.chart.sh +++ b/collectors/charts.d.plugin/nut/nut.chart.sh @@ -28,59 +28,59 @@ declare -A nut_ids=() declare -A nut_names=() nut_get_all() { - run -t $nut_timeout upsc -l + run -t $nut_timeout upsc -l } nut_get() { - run -t $nut_timeout upsc "$1" + run -t $nut_timeout upsc "$1" - if [ "${nut_clients_chart}" -eq "1" ]; then - printf "ups.connected_clients: " - run -t $nut_timeout upsc -c "$1" | wc -l - fi + if [ "${nut_clients_chart}" -eq "1" ]; then + printf "ups.connected_clients: " + run -t $nut_timeout upsc -c "$1" | wc -l + fi } nut_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - local x - - require_cmd upsc || return 1 - - [ -z "$nut_ups" ] && nut_ups="$(nut_get_all)" - - for x in $nut_ups; do - nut_get "$x" >/dev/null - # shellcheck disable=SC2181 - if [ $? -eq 0 ]; then - if [ ! -z "${nut_names[${x}]}" ]; then - nut_ids[$x]="$(fixid "${nut_names[${x}]}")" - else - nut_ids[$x]="$(fixid "$x")" - fi - continue - fi - error "cannot get information for NUT UPS '$x'." - done - - if [ ${#nut_ids[@]} -eq 0 ]; then - # shellcheck disable=SC2154 - error "Cannot find UPSes - please set nut_ups='ups_name' in $confd/nut.conf" - return 1 - fi - - return 0 + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart + + local x + + require_cmd upsc || return 1 + + [ -z "$nut_ups" ] && nut_ups="$(nut_get_all)" + + for x in $nut_ups; do + nut_get "$x" > /dev/null + # shellcheck disable=SC2181 + if [ $? -eq 0 ]; then + if [ -n "${nut_names[${x}]}" ]; then + nut_ids[$x]="$(fixid "${nut_names[${x}]}")" + else + nut_ids[$x]="$(fixid "$x")" + fi + continue + fi + error "cannot get information for NUT UPS '$x'." + done + + if [ ${#nut_ids[@]} -eq 0 ]; then + # shellcheck disable=SC2154 + error "Cannot find UPSes - please set nut_ups='ups_name' in $confd/nut.conf" + return 1 + fi + + return 0 } nut_create() { - # create the charts - local x + # create the charts + local x - for x in "${nut_ids[@]}"; do - cat <<EOF + for x in "${nut_ids[@]}"; do + cat << EOF CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $((nut_priority + 1)) $nut_update_every DIMENSION battery_charge charge absolute 1 100 @@ -115,30 +115,30 @@ CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $( DIMENSION temp temp absolute 1 100 EOF - if [ "${nut_clients_chart}" = "1" ]; then - cat <<EOF2 + if [ "${nut_clients_chart}" = "1" ]; then + cat << EOF2 CHART nut_$x.clients '' "UPS Connected Clients" "clients" ups nut.clients area $((nut_priority + 9)) $nut_update_every DIMENSION clients '' absolute 1 1 EOF2 - fi + fi - done + done - return 0 + return 0 } nut_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT + # do all the work to collect / calculate the values + # for each dimension + # remember: KEEP IT SIMPLE AND SHORT - local i x - for i in "${!nut_ids[@]}"; do - x="${nut_ids[$i]}" - nut_get "$i" | awk " + local i x + for i in "${!nut_ids[@]}"; do + x="${nut_ids[$i]}" + nut_get "$i" | awk " BEGIN { battery_charge = 0; battery_runtime = 0; @@ -223,10 +223,10 @@ END { print \"END\" } }" - # shellcheck disable=2181 - [ $? -ne 0 ] && unset "nut_ids[$i]" && error "failed to get values for '$i', disabling it." - done + # shellcheck disable=2181 + [ $? -ne 0 ] && unset "nut_ids[$i]" && error "failed to get values for '$i', disabling it." + done - [ ${#nut_ids[@]} -eq 0 ] && error "no UPSes left active." && return 1 - return 0 + [ ${#nut_ids[@]} -eq 0 ] && error "no UPSes left active." && return 1 + return 0 } diff --git a/collectors/charts.d.plugin/opensips/README.md b/collectors/charts.d.plugin/opensips/README.md index d41b41120..7575a1dad 100644 --- a/collectors/charts.d.plugin/opensips/README.md +++ b/collectors/charts.d.plugin/opensips/README.md @@ -1,7 +1,19 @@ -# OpenSIPS +<!-- +title: "OpenSIPS monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/opensips/README.md +sidebar_label: "OpenSIPS" +--> -_Under construction_ +# OpenSIPS monitoring with Netdata -Collects OpenSIPS metrics +## Configuration + +Edit the `charts.d/opensips.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/opensips.conf +``` [![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fopensips%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/opensips/opensips.chart.sh b/collectors/charts.d.plugin/opensips/opensips.chart.sh index b42462d6d..8ff3e32ef 100644 --- a/collectors/charts.d.plugin/opensips/opensips.chart.sh +++ b/collectors/charts.d.plugin/opensips/opensips.chart.sh @@ -14,40 +14,40 @@ opensips_timeout=2 opensips_priority=80000 opensips_get_stats() { - run -t $opensips_timeout "$opensips_cmd" $opensips_opts | - grep "^\(core\|dialog\|net\|registrar\|shmem\|siptrace\|sl\|tm\|uri\|usrloc\):[a-zA-Z0-9_-]\+[[:space:]]*[=:]\+[[:space:]]*[0-9]\+[[:space:]]*$" | - sed \ - -e "s|[[:space:]]*[=:]\+[[:space:]]*\([0-9]\+\)[[:space:]]*$|=\1|g" \ - -e "s|[[:space:]:-]\+|_|g" \ - -e "s|^|opensips_|g" - - local ret=$? - [ $ret -ne 0 ] && echo "opensips_command_failed=1" - return $ret + run -t $opensips_timeout "$opensips_cmd" $opensips_opts | + grep "^\(core\|dialog\|net\|registrar\|shmem\|siptrace\|sl\|tm\|uri\|usrloc\):[a-zA-Z0-9_-]\+[[:space:]]*[=:]\+[[:space:]]*[0-9]\+[[:space:]]*$" | + sed \ + -e "s|[[:space:]]*[=:]\+[[:space:]]*\([0-9]\+\)[[:space:]]*$|=\1|g" \ + -e "s|[[:space:]:-]\+|_|g" \ + -e "s|^|opensips_|g" + + local ret=$? + [ $ret -ne 0 ] && echo "opensips_command_failed=1" + return $ret } opensips_check() { - # if the user did not provide an opensips_cmd - # try to find it in the system - if [ -z "$opensips_cmd" ]; then - require_cmd opensipsctl || return 1 - fi - - # check once if the command works - local x - x="$(opensips_get_stats | grep "^opensips_core_")" - # shellcheck disable=SC2181 - if [ ! $? -eq 0 ] || [ -z "$x" ]; then - error "cannot get global status. Please set opensips_opts='options' whatever needed to get connected to opensips server, in $confd/opensips.conf" - return 1 - fi - - return 0 + # if the user did not provide an opensips_cmd + # try to find it in the system + if [ -z "$opensips_cmd" ]; then + require_cmd opensipsctl || return 1 + fi + + # check once if the command works + local x + x="$(opensips_get_stats | grep "^opensips_core_")" + # shellcheck disable=SC2181 + if [ ! $? -eq 0 ] || [ -z "$x" ]; then + error "cannot get global status. Please set opensips_opts='options' whatever needed to get connected to opensips server, in $confd/opensips.conf" + return 1 + fi + + return 0 } opensips_create() { - # create the charts - cat <<EOF + # create the charts + cat << EOF CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" dialogs '' area $((opensips_priority + 1)) $opensips_update_every DIMENSION dialog_active_dialogs active absolute 1 1 DIMENSION dialog_early_dialogs early absolute -1 1 @@ -141,91 +141,91 @@ CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragme DIMENSION shmem_fragments fragments absolute 1 1 EOF - return 0 + return 0 } opensips_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - - # 1. get the counters page from opensips - # 2. sed to remove spaces; replace . with _; remove spaces around =; prepend each line with: local opensips_ - # 3. egrep lines starting with: - # local opensips_client_http_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 - # local opensips_server_all_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 - # 4. then execute this as a script with the eval - # be very carefull with eval: - # prepare the script and always grep at the end the lines that are usefull, so that - # even if something goes wrong, no other code can be executed - - unset \ - opensips_dialog_active_dialogs \ - opensips_dialog_early_dialogs \ - opensips_usrloc_registered_users \ - opensips_usrloc_location_users \ - opensips_usrloc_location_contacts \ - opensips_usrloc_location_expires \ - opensips_registrar_accepted_regs \ - opensips_registrar_rejected_regs \ - opensips_tm_UAS_transactions \ - opensips_tm_UAC_transactions \ - opensips_core_rcv_requests \ - opensips_core_rcv_replies \ - opensips_core_fwd_requests \ - opensips_core_fwd_replies \ - opensips_core_drop_requests \ - opensips_core_drop_replies \ - opensips_core_err_requests \ - opensips_core_err_replies \ - opensips_core_bad_URIs_rcvd \ - opensips_core_unsupported_methods \ - opensips_core_bad_msg_hdr \ - opensips_tm_received_replies \ - opensips_tm_relayed_replies \ - opensips_tm_local_replies \ - opensips_tm_2xx_transactions \ - opensips_tm_3xx_transactions \ - opensips_tm_4xx_transactions \ - opensips_tm_5xx_transactions \ - opensips_tm_6xx_transactions \ - opensips_tm_inuse_transactions \ - opensips_sl_1xx_replies \ - opensips_sl_2xx_replies \ - opensips_sl_3xx_replies \ - opensips_sl_4xx_replies \ - opensips_sl_5xx_replies \ - opensips_sl_6xx_replies \ - opensips_sl_sent_replies \ - opensips_sl_sent_err_replies \ - opensips_sl_received_ACKs \ - opensips_dialog_processed_dialogs \ - opensips_dialog_expired_dialogs \ - opensips_dialog_failed_dialogs \ - opensips_net_waiting_udp \ - opensips_net_waiting_tcp \ - opensips_uri_positive_checks \ - opensips_uri_negative_checks \ - opensips_siptrace_traced_requests \ - opensips_siptrace_traced_replies \ - opensips_shmem_total_size \ - opensips_shmem_used_size \ - opensips_shmem_real_used_size \ - opensips_shmem_max_used_size \ - opensips_shmem_free_size \ - opensips_shmem_fragments - - opensips_command_failed=0 - eval "local $(opensips_get_stats)" - # shellcheck disable=SC2181 - [ $? -ne 0 ] && return 1 - - [ $opensips_command_failed -eq 1 ] && error "failed to get values, disabling." && return 1 - - # write the result of the work. - cat <<VALUESEOF + # the first argument to this function is the microseconds since last update + # pass this parameter to the BEGIN statement (see bellow). + + # do all the work to collect / calculate the values + # for each dimension + + # 1. get the counters page from opensips + # 2. sed to remove spaces; replace . with _; remove spaces around =; prepend each line with: local opensips_ + # 3. egrep lines starting with: + # local opensips_client_http_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 + # local opensips_server_all_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 + # 4. then execute this as a script with the eval + # be very carefull with eval: + # prepare the script and always grep at the end the lines that are usefull, so that + # even if something goes wrong, no other code can be executed + + unset \ + opensips_dialog_active_dialogs \ + opensips_dialog_early_dialogs \ + opensips_usrloc_registered_users \ + opensips_usrloc_location_users \ + opensips_usrloc_location_contacts \ + opensips_usrloc_location_expires \ + opensips_registrar_accepted_regs \ + opensips_registrar_rejected_regs \ + opensips_tm_UAS_transactions \ + opensips_tm_UAC_transactions \ + opensips_core_rcv_requests \ + opensips_core_rcv_replies \ + opensips_core_fwd_requests \ + opensips_core_fwd_replies \ + opensips_core_drop_requests \ + opensips_core_drop_replies \ + opensips_core_err_requests \ + opensips_core_err_replies \ + opensips_core_bad_URIs_rcvd \ + opensips_core_unsupported_methods \ + opensips_core_bad_msg_hdr \ + opensips_tm_received_replies \ + opensips_tm_relayed_replies \ + opensips_tm_local_replies \ + opensips_tm_2xx_transactions \ + opensips_tm_3xx_transactions \ + opensips_tm_4xx_transactions \ + opensips_tm_5xx_transactions \ + opensips_tm_6xx_transactions \ + opensips_tm_inuse_transactions \ + opensips_sl_1xx_replies \ + opensips_sl_2xx_replies \ + opensips_sl_3xx_replies \ + opensips_sl_4xx_replies \ + opensips_sl_5xx_replies \ + opensips_sl_6xx_replies \ + opensips_sl_sent_replies \ + opensips_sl_sent_err_replies \ + opensips_sl_received_ACKs \ + opensips_dialog_processed_dialogs \ + opensips_dialog_expired_dialogs \ + opensips_dialog_failed_dialogs \ + opensips_net_waiting_udp \ + opensips_net_waiting_tcp \ + opensips_uri_positive_checks \ + opensips_uri_negative_checks \ + opensips_siptrace_traced_requests \ + opensips_siptrace_traced_replies \ + opensips_shmem_total_size \ + opensips_shmem_used_size \ + opensips_shmem_real_used_size \ + opensips_shmem_max_used_size \ + opensips_shmem_free_size \ + opensips_shmem_fragments + + opensips_command_failed=0 + eval "local $(opensips_get_stats)" + # shellcheck disable=SC2181 + [ $? -ne 0 ] && return 1 + + [ $opensips_command_failed -eq 1 ] && error "failed to get values, disabling." && return 1 + + # write the result of the work. + cat << VALUESEOF BEGIN opensips.dialogs_active $1 SET dialog_active_dialogs = $opensips_dialog_active_dialogs SET dialog_early_dialogs = $opensips_dialog_early_dialogs @@ -320,5 +320,5 @@ SET shmem_fragments = $opensips_shmem_fragments END VALUESEOF - return 0 + return 0 } diff --git a/collectors/charts.d.plugin/phpfpm/Makefile.inc b/collectors/charts.d.plugin/phpfpm/Makefile.inc deleted file mode 100644 index 56bff6102..000000000 --- a/collectors/charts.d.plugin/phpfpm/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += phpfpm/phpfpm.chart.sh -dist_chartsconfig_DATA += phpfpm/phpfpm.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += phpfpm/README.md phpfpm/Makefile.inc - diff --git a/collectors/charts.d.plugin/phpfpm/README.md b/collectors/charts.d.plugin/phpfpm/README.md deleted file mode 100644 index f8976301b..000000000 --- a/collectors/charts.d.plugin/phpfpm/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# phpfm - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/phpfpm) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fphpfpm%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/phpfpm/phpfpm.chart.sh b/collectors/charts.d.plugin/phpfpm/phpfpm.chart.sh deleted file mode 100644 index b1edb2373..000000000 --- a/collectors/charts.d.plugin/phpfpm/phpfpm.chart.sh +++ /dev/null @@ -1,169 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# -# Contributed by @safeie with PR #276 - -# first, you need open php-fpm status in php-fpm.conf -# second, you need add status location in nginx.conf -# you can see, https://easyengine.io/tutorials/php/fpm-status-page/ - -declare -A phpfpm_urls=() -declare -A phpfpm_curl_opts=() - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -phpfpm_update_every= -phpfpm_priority=60000 - -declare -a phpfpm_response=() -phpfpm_pool="" -phpfpm_start_time="" -phpfpm_start_since=0 -phpfpm_accepted_conn=0 -phpfpm_listen_queue=0 -phpfpm_max_listen_queue=0 -phpfpm_listen_queue_len=0 -phpfpm_idle_processes=0 -phpfpm_active_processes=0 -phpfpm_total_processes=0 -phpfpm_max_active_processes=0 -phpfpm_max_children_reached=0 -phpfpm_slow_requests=0 -phpfpm_get() { - local opts="${1}" url="${2}" - - # shellcheck disable=SC2207,2086 - phpfpm_response=($(run curl -Ss ${opts} "${url}")) - # shellcheck disable=SC2181 - if [ $? -ne 0 ] || [ "${#phpfpm_response[@]}" -eq 0 ]; then - return 1 - fi - - if [[ ${phpfpm_response[0]} != "pool:" || ${phpfpm_response[2]} != "process" || ${phpfpm_response[5]} != "start" || ${phpfpm_response[12]} != "accepted" || ${phpfpm_response[15]} != "listen" || ${phpfpm_response[16]} != "queue:" || ${phpfpm_response[26]} != "idle" || ${phpfpm_response[29]} != "active" || ${phpfpm_response[32]} != "total" ]]; then - error "invalid response from phpfpm status server: ${phpfpm_response[*]}" - return 1 - fi - - phpfpm_pool="${phpfpm_response[1]}" - phpfpm_start_time="${phpfpm_response[7]} ${phpfpm_response[8]}" - phpfpm_start_since="${phpfpm_response[11]}" - phpfpm_accepted_conn="${phpfpm_response[14]}" - phpfpm_listen_queue="${phpfpm_response[17]}" - phpfpm_max_listen_queue="${phpfpm_response[21]}" - phpfpm_listen_queue_len="${phpfpm_response[25]}" - phpfpm_idle_processes="${phpfpm_response[28]}" - phpfpm_active_processes="${phpfpm_response[31]}" - phpfpm_total_processes="${phpfpm_response[34]}" - phpfpm_max_active_processes="${phpfpm_response[38]}" - phpfpm_max_children_reached="${phpfpm_response[42]}" - if [ "${phpfpm_response[43]}" == "slow" ]; then - phpfpm_slow_requests="${phpfpm_response[45]}" - else - phpfpm_slow_requests="-1" - fi - - if [[ -z ${phpfpm_pool} || -z ${phpfpm_start_time} || -z ${phpfpm_start_since} || -z ${phpfpm_accepted_conn} || -z ${phpfpm_listen_queue} || -z ${phpfpm_max_listen_queue} || -z ${phpfpm_listen_queue_len} || -z ${phpfpm_idle_processes} || -z ${phpfpm_active_processes} || -z ${phpfpm_total_processes} || -z ${phpfpm_max_active_processes} || -z ${phpfpm_max_children_reached} ]]; then - error "empty values got from phpfpm status server: ${phpfpm_response[*]}" - return 1 - fi - - return 0 -} - -# _check is called once, to find out if this chart should be enabled or not -phpfpm_check() { - if [ ${#phpfpm_urls[@]} -eq 0 ]; then - phpfpm_urls[local]="http://localhost/status" - fi - - local m - for m in "${!phpfpm_urls[@]}"; do - phpfpm_get "${phpfpm_curl_opts[$m]}" "${phpfpm_urls[$m]}" - # shellcheck disable=SC2181 - if [ $? -ne 0 ]; then - # shellcheck disable=SC2154 - error "cannot find status on URL '${phpfpm_urls[$m]}'. Please set phpfpm_urls[$m]='http://localhost/status' in $confd/phpfpm.conf" - unset "phpfpm_urls[$m]" - continue - fi - done - - if [ ${#phpfpm_urls[@]} -eq 0 ]; then - error "no phpfpm servers found. Please set phpfpm_urls[name]='url' to whatever needed to get status to the phpfpm server, in $confd/phpfpm.conf" - return 1 - fi - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - return 0 -} - -# _create is called once, to create the charts -phpfpm_create() { - local m - for m in "${!phpfpm_urls[@]}"; do - cat <<EOF -CHART phpfpm_$m.connections '' "PHP-FPM Active Connections" "connections" phpfpm phpfpm.connections line $((phpfpm_priority + 1)) $phpfpm_update_every -DIMENSION active '' absolute 1 1 -DIMENSION maxActive 'max active' absolute 1 1 -DIMENSION idle '' absolute 1 1 - -CHART phpfpm_$m.requests '' "PHP-FPM Requests" "requests/s" phpfpm phpfpm.requests line $((phpfpm_priority + 2)) $phpfpm_update_every -DIMENSION requests '' incremental 1 1 - -CHART phpfpm_$m.performance '' "PHP-FPM Performance" "status" phpfpm phpfpm.performance line $((phpfpm_priority + 3)) $phpfpm_update_every -DIMENSION reached 'max children reached' absolute 1 1 -EOF - if [ $((phpfpm_slow_requests)) -ne -1 ]; then - echo "DIMENSION slow 'slow requests' absolute 1 1" - fi - done - - return 0 -} - -# _update is called continuously, to collect the values -phpfpm_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - local m - for m in "${!phpfpm_urls[@]}"; do - phpfpm_get "${phpfpm_curl_opts[$m]}" "${phpfpm_urls[$m]}" - # shellcheck disable=SC2181 - if [ $? -ne 0 ]; then - continue - fi - - # write the result of the work. - cat <<EOF -BEGIN phpfpm_$m.connections $1 -SET active = $((phpfpm_active_processes)) -SET maxActive = $((phpfpm_max_active_processes)) -SET idle = $((phpfpm_idle_processes)) -END -BEGIN phpfpm_$m.requests $1 -SET requests = $((phpfpm_accepted_conn)) -END -BEGIN phpfpm_$m.performance $1 -SET reached = $((phpfpm_max_children_reached)) -EOF - if [ $((phpfpm_slow_requests)) -ne -1 ]; then - echo "SET slow = $((phpfpm_slow_requests))" - fi - echo "END" - done - - return 0 -} diff --git a/collectors/charts.d.plugin/phpfpm/phpfpm.conf b/collectors/charts.d.plugin/phpfpm/phpfpm.conf deleted file mode 100644 index e4dd0231b..000000000 --- a/collectors/charts.d.plugin/phpfpm/phpfpm.conf +++ /dev/null @@ -1,27 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -# first, you need open php-fpm status in php-fpm.conf -# second, you need add status location in nginx.conf -# you can see, https://easyengine.io/tutorials/php/fpm-status-page/ -#phpfpm_urls[name]="" -#phpfpm_curl_opts[name]="" - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#phpfpm_update_every= - -# the charts priority on the dashboard -#phpfpm_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#phpfpm_retries=10 - diff --git a/collectors/charts.d.plugin/postfix/Makefile.inc b/collectors/charts.d.plugin/postfix/Makefile.inc deleted file mode 100644 index 6e148352d..000000000 --- a/collectors/charts.d.plugin/postfix/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += postfix/postfix.chart.sh -dist_chartsconfig_DATA += postfix/postfix.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += postfix/README.md postfix/Makefile.inc - diff --git a/collectors/charts.d.plugin/postfix/README.md b/collectors/charts.d.plugin/postfix/README.md deleted file mode 100644 index d9bf77f2f..000000000 --- a/collectors/charts.d.plugin/postfix/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# postfix - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/postfix) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -The plugin will collect the postfix queue size. - -It will create two charts: - -1. **queue size in emails** -2. **queue size in KB** - -## configuration - -This is the internal default for `/etc/netdata/postfix.conf` - -```sh -# the postqueue command -# if empty, it will use the one found in the system path -postfix_postqueue= - -# how frequently to collect queue size -postfix_update_every=15 -``` - ---- - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fpostfix%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/postfix/postfix.chart.sh b/collectors/charts.d.plugin/postfix/postfix.chart.sh deleted file mode 100644 index ff59db9fe..000000000 --- a/collectors/charts.d.plugin/postfix/postfix.chart.sh +++ /dev/null @@ -1,87 +0,0 @@ -# shellcheck shell=bash disable=SC1117 -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -# the postqueue command -# if empty, it will use the one found in the system path -postfix_postqueue= - -# how frequently to collect queue size -postfix_update_every=15 - -postfix_priority=60000 - -postfix_check() { - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - # try to find the postqueue executable - if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ]; then - # shellcheck disable=SC2230 - postfix_postqueue="$(which postqueue 2>/dev/null || command -v postqueue 2>/dev/null)" - fi - - if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ]; then - # shellcheck disable=SC2154 - error "cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" - return 1 - fi - - return 0 -} - -postfix_create() { - cat <<EOF -CHART postfix_local.qemails '' "Postfix Queue Emails" "emails" queue postfix.queued.emails line $((postfix_priority + 1)) $postfix_update_every -DIMENSION emails '' absolute 1 1 -CHART postfix_local.qsize '' "Postfix Queue Emails Size" "emails size in KB" queue postfix.queued.size area $((postfix_priority + 2)) $postfix_update_every -DIMENSION size '' absolute 1 1 -EOF - - return 0 -} - -postfix_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - # 1. execute postqueue -p - # 2. get the line that begins with -- - # 3. match the 2 numbers on the line and output 2 lines like these: - # local postfix_q_size=NUMBER - # local postfix_q_emails=NUMBER - # 4. then execute this a script with the eval - # - # be very carefull with eval: - # prepare the script and always egrep at the end the lines that are usefull, so that - # even if something goes wrong, no other code can be executed - postfix_q_emails=0 - postfix_q_size=0 - - eval "$(run "$postfix_postqueue" -p | - grep "^--" | - sed -e "s/-- \([0-9]\+\) Kbytes in \([0-9]\+\) Requests.$/local postfix_q_size=\1\nlocal postfix_q_emails=\2/g" | - grep -E "^local postfix_q_(emails|size)=[0-9]+$")" - - # write the result of the work. - cat <<VALUESEOF -BEGIN postfix_local.qemails $1 -SET emails = $postfix_q_emails -END -BEGIN postfix_local.qsize $1 -SET size = $postfix_q_size -END -VALUESEOF - - return 0 -} diff --git a/collectors/charts.d.plugin/postfix/postfix.conf b/collectors/charts.d.plugin/postfix/postfix.conf deleted file mode 100644 index b77817bd6..000000000 --- a/collectors/charts.d.plugin/postfix/postfix.conf +++ /dev/null @@ -1,25 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -# the postqueue command -# if empty, it will use the one found in the system path -#postfix_postqueue= - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#postfix_update_every=15 - -# the charts priority on the dashboard -#postfix_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#postfix_retries=10 - diff --git a/collectors/charts.d.plugin/sensors/README.md b/collectors/charts.d.plugin/sensors/README.md index a3fa9d20f..cee3f601c 100644 --- a/collectors/charts.d.plugin/sensors/README.md +++ b/collectors/charts.d.plugin/sensors/README.md @@ -1,7 +1,12 @@ -# sensors +<!-- +title: "Linux machine sensors monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/charts.d.plugin/sensors/README.md +--> + +# Linux machine sensors monitoring with Netdata > THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/sensors) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT +> USE [THE PYTHON ONE](/collectors/python.d.plugin/sensors) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT > > Unlike the python one, this module can collect temperature on RPi. @@ -24,9 +29,17 @@ The plugin will create Netdata charts for: One chart for every sensor chip found and each of the above will be created. -## configuration +## Configuration + +Edit the `charts.d/sensors.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/sensors.conf +``` -This is the internal default for `/etc/netdata/sensors.conf` +This is the internal default for `charts.d/sensors.conf` ```sh # the directory the kernel keeps sensor data diff --git a/collectors/charts.d.plugin/squid/Makefile.inc b/collectors/charts.d.plugin/squid/Makefile.inc deleted file mode 100644 index ad470d88c..000000000 --- a/collectors/charts.d.plugin/squid/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += squid/squid.chart.sh -dist_chartsconfig_DATA += squid/squid.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += squid/README.md squid/Makefile.inc - diff --git a/collectors/charts.d.plugin/squid/README.md b/collectors/charts.d.plugin/squid/README.md deleted file mode 100644 index 831a04f73..000000000 --- a/collectors/charts.d.plugin/squid/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# squid - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/squid) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -The plugin will monitor a squid server. - -It will produce 4 charts: - -1. **Squid Client Bandwidth** in kbps - -- in -- out -- hits - -2. **Squid Client Requests** in requests/sec - -- requests -- hits -- errors - -3. **Squid Server Bandwidth** in kbps - -- in -- out - -4. **Squid Server Requests** in requests/sec - -- requests -- errors - -## autoconfig - -The plugin will by itself detect squid servers running on -localhost, on ports 3128 or 8080. - -It will attempt to download URLs in the form: - -- `cache_object://HOST:PORT/counters` -- `/squid-internal-mgr/counters` - -If any succeeds, it will use this. - -## configuration - -If you need to configure it by hand, create the file -`/etc/netdata/squid.conf` with the following variables: - -- `squid_host=IP` the IP of the squid host -- `squid_port=PORT` the port the squid is listening -- `squid_url="URL"` the URL with the statistics to be fetched from squid -- `squid_timeout=SECONDS` how much time we should wait for squid to respond -- `squid_update_every=SECONDS` the frequency of the data collection - -Example `/etc/netdata/squid.conf`: - -```sh -squid_host=127.0.0.1 -squid_port=3128 -squid_url="cache_object://127.0.0.1:3128/counters" -squid_timeout=2 -squid_update_every=5 -``` - ---- - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fsquid%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/squid/squid.chart.sh b/collectors/charts.d.plugin/squid/squid.chart.sh deleted file mode 100644 index ebddb32c6..000000000 --- a/collectors/charts.d.plugin/squid/squid.chart.sh +++ /dev/null @@ -1,141 +0,0 @@ -# shellcheck shell=bash disable=SC2154 -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# - -squid_host= -squid_port= -squid_url= -squid_update_every=2 -squid_priority=60000 - -squid_get_stats_internal() { - local host="$1" port="$2" url="$3" - run squidclient -h "$host" -p "$port" "$url" -} - -squid_get_stats() { - squid_get_stats_internal "$squid_host" "$squid_port" "$squid_url" -} - -squid_autodetect() { - local host="127.0.0.1" port url x - - for port in 3128 8080; do - for url in "cache_object://$host:$port/counters" "/squid-internal-mgr/counters"; do - x=$(squid_get_stats_internal "$host" "$port" "$url" | grep client_http.requests) - if [ ! -z "$x" ]; then - squid_host="$host" - squid_port="$port" - squid_url="$url" - debug "found squid at '$host:$port' with url '$url'" - return 0 - fi - done - done - - error "cannot find squid running in localhost. Please set squid_url='url' and squid_host='IP' and squid_port='PORT' in $confd/squid.conf" - return 1 -} - -squid_check() { - require_cmd squidclient || return 1 - require_cmd sed || return 1 - require_cmd egrep || return 1 - - if [ -z "$squid_host" ] || [ -z "$squid_port" ] || [ -z "$squid_url" ]; then - squid_autodetect || return 1 - fi - - # check once if the url works - local x - x="$(squid_get_stats | grep client_http.requests)" - # shellcheck disable=SC2181 - if [ ! $? -eq 0 ] || [ -z "$x" ]; then - error "cannot fetch URL '$squid_url' by connecting to $squid_host:$squid_port. Please set squid_url='url' and squid_host='host' and squid_port='port' in $confd/squid.conf" - return 1 - fi - - return 0 -} - -squid_create() { - # create the charts - cat <<EOF -CHART squid_local.clients_net '' "Squid Client Bandwidth" "kilobits / sec" clients squid.clients.net area $((squid_priority + 1)) $squid_update_every -DIMENSION client_http_kbytes_in in incremental 8 1 -DIMENSION client_http_kbytes_out out incremental -8 1 -DIMENSION client_http_hit_kbytes_out hits incremental -8 1 - -CHART squid_local.clients_requests '' "Squid Client Requests" "requests / sec" clients squid.clients.requests line $((squid_priority + 3)) $squid_update_every -DIMENSION client_http_requests requests incremental 1 1 -DIMENSION client_http_hits hits incremental 1 1 -DIMENSION client_http_errors errors incremental -1 1 - -CHART squid_local.servers_net '' "Squid Server Bandwidth" "kilobits / sec" servers squid.servers.net area $((squid_priority + 2)) $squid_update_every -DIMENSION server_all_kbytes_in in incremental 8 1 -DIMENSION server_all_kbytes_out out incremental -8 1 - -CHART squid_local.servers_requests '' "Squid Server Requests" "requests / sec" servers squid.servers.requests line $((squid_priority + 4)) $squid_update_every -DIMENSION server_all_requests requests incremental 1 1 -DIMENSION server_all_errors errors incremental -1 1 -EOF - - return 0 -} - -squid_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - # 1. get the counters page from squid - # 2. sed to remove spaces; replace . with _; remove spaces around =; prepend each line with: local squid_ - # 3. egrep lines starting with: - # local squid_client_http_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 - # local squid_server_all_ then one or more of these a-z 0-9 _ then = and one of more of 0-9 - # 4. then execute this as a script with the eval - # - # be very carefull with eval: - # prepare the script and always grep at the end the lines that are usefull, so that - # even if something goes wrong, no other code can be executed - - # shellcheck disable=SC1117 - eval "$(squid_get_stats | - sed -e "s/ \+/ /g" -e "s/\./_/g" -e "s/^\([a-z0-9_]\+\) *= *\([0-9]\+\)$/local squid_\1=\2/g" | - grep -E "^local squid_(client_http|server_all)_[a-z0-9_]+=[0-9]+$")" - - # write the result of the work. - cat <<VALUESEOF -BEGIN squid_local.clients_net $1 -SET client_http_kbytes_in = $squid_client_http_kbytes_in -SET client_http_kbytes_out = $squid_client_http_kbytes_out -SET client_http_hit_kbytes_out = $squid_client_http_hit_kbytes_out -END - -BEGIN squid_local.clients_requests $1 -SET client_http_requests = $squid_client_http_requests -SET client_http_hits = $squid_client_http_hits -SET client_http_errors = $squid_client_http_errors -END - -BEGIN squid_local.servers_net $1 -SET server_all_kbytes_in = $squid_server_all_kbytes_in -SET server_all_kbytes_out = $squid_server_all_kbytes_out -END - -BEGIN squid_local.servers_requests $1 -SET server_all_requests = $squid_server_all_requests -SET server_all_errors = $squid_server_all_errors -END -VALUESEOF - - return 0 -} diff --git a/collectors/charts.d.plugin/squid/squid.conf b/collectors/charts.d.plugin/squid/squid.conf deleted file mode 100644 index 19e928f25..000000000 --- a/collectors/charts.d.plugin/squid/squid.conf +++ /dev/null @@ -1,26 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -#squid_host= -#squid_port= -#squid_url= -#squid_timeout=2 - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#squid_update_every=2 - -# the charts priority on the dashboard -#squid_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#squid_retries=10 - diff --git a/collectors/charts.d.plugin/tomcat/Makefile.inc b/collectors/charts.d.plugin/tomcat/Makefile.inc deleted file mode 100644 index ef05b1953..000000000 --- a/collectors/charts.d.plugin/tomcat/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_charts_DATA += tomcat/tomcat.chart.sh -dist_chartsconfig_DATA += tomcat/tomcat.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += tomcat/README.md tomcat/Makefile.inc - diff --git a/collectors/charts.d.plugin/tomcat/README.md b/collectors/charts.d.plugin/tomcat/README.md deleted file mode 100644 index 752332cfb..000000000 --- a/collectors/charts.d.plugin/tomcat/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# tomcat - -> THIS MODULE IS OBSOLETE. -> USE [THE PYTHON ONE](../../python.d.plugin/tomcat) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT - -[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Ftomcat%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)](<>) diff --git a/collectors/charts.d.plugin/tomcat/tomcat.chart.sh b/collectors/charts.d.plugin/tomcat/tomcat.chart.sh deleted file mode 100644 index 9ca75e63e..000000000 --- a/collectors/charts.d.plugin/tomcat/tomcat.chart.sh +++ /dev/null @@ -1,152 +0,0 @@ -# shellcheck shell=bash -# no need for shebang - this file is loaded from charts.d.plugin -# SPDX-License-Identifier: GPL-3.0-or-later - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# -# Contributed by @jgeromero with PR #277 - -# Description: Tomcat netdata charts.d plugin -# Author: Jorge Romero - -# the URL to download tomcat status info -# usually http://localhost:8080/manager/status?XML=true -tomcat_url="" -tomcat_curl_opts="" - -# set tomcat username/password here -tomcat_user="" -tomcat_password="" - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -tomcat_update_every= - -tomcat_priority=60000 - -# convert tomcat floating point values -# to integer using this multiplier -# this only affects precision - the values -# will be in the proper units -tomcat_decimal_detail=1000000 - -# used by volume chart to convert bytes to kB -tomcat_decimal_kB_detail=1000 - -tomcat_check() { - - require_cmd xmlstarlet || return 1 - - # check if url, username, passwords are set - if [ -z "${tomcat_url}" ]; then - error "tomcat url is unset or set to the empty string" - return 1 - fi - if [ -z "${tomcat_user}" ]; then - # check backwards compatibility - # shellcheck disable=SC2154 - if [ -z "${tomcatUser}" ]; then - error "tomcat user is unset or set to the empty string" - return 1 - else - tomcat_user="${tomcatUser}" - fi - fi - if [ -z "${tomcat_password}" ]; then - # check backwards compatibility - # shellcheck disable=SC2154 - if [ -z "${tomcatPassword}" ]; then - error "tomcat password is unset or set to the empty string" - return 1 - else - tomcat_password="${tomcatPassword}" - fi - fi - - # check if we can get to tomcat's status page - tomcat_get - # shellcheck disable=2181 - if [ $? -ne 0 ]; then - error "cannot get to status page on URL '${tomcat_url}'. Please make sure tomcat url, username and password are correct." - return 1 - fi - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - return 0 -} - -tomcat_get() { - # collect tomcat values - tomcat_port="$( - IFS=/ read -ra a <<<"$tomcat_url" - hostport=${a[2]} - echo "${hostport#*:}" - )" - mapfile -t lines < <(run curl -u "$tomcat_user":"$tomcat_password" -Ss ${tomcat_curl_opts} "$tomcat_url" | - run xmlstarlet sel \ - -t -m "/status/jvm/memory" -v @free \ - -n -m "/status/connector[@name='\"http-bio-$tomcat_port\"']/threadInfo" -v @currentThreadCount \ - -n -v @currentThreadsBusy \ - -n -m "/status/connector[@name='\"http-bio-$tomcat_port\"']/requestInfo" -v @requestCount \ - -n -v @bytesSent -n -) - - tomcat_jvm_freememory="${lines[0]}" - tomcat_threads="${lines[1]}" - tomcat_threads_busy="${lines[2]}" - tomcat_accesses="${lines[3]}" - tomcat_volume="${lines[4]}" - - return 0 -} - -# _create is called once, to create the charts -tomcat_create() { - cat <<EOF -CHART tomcat.accesses '' "tomcat requests" "requests/s" statistics tomcat.accesses area $((tomcat_priority + 8)) $tomcat_update_every -DIMENSION accesses '' incremental -CHART tomcat.volume '' "tomcat volume" "kB/s" volume tomcat.volume area $((tomcat_priority + 5)) $tomcat_update_every -DIMENSION volume '' incremental divisor ${tomcat_decimal_kB_detail} -CHART tomcat.threads '' "tomcat threads" "current threads" statistics tomcat.threads line $((tomcat_priority + 6)) $tomcat_update_every -DIMENSION current '' absolute 1 -DIMENSION busy '' absolute 1 -CHART tomcat.jvm '' "JVM Free Memory" "MB" statistics tomcat.jvm area $((tomcat_priority + 8)) $tomcat_update_every -DIMENSION jvm '' absolute 1 ${tomcat_decimal_detail} -EOF - return 0 -} - -# _update is called continuously, to collect the values -tomcat_update() { - # the first argument to this function is the microseconds since last update - # pass this parameter to the BEGIN statement (see bellow). - - # do all the work to collect / calculate the values - # for each dimension - # remember: KEEP IT SIMPLE AND SHORT - - tomcat_get || return 1 - - # write the result of the work. - cat <<VALUESEOF -BEGIN tomcat.accesses $1 -SET accesses = $((tomcat_accesses)) -END -BEGIN tomcat.volume $1 -SET volume = $((tomcat_volume)) -END -BEGIN tomcat.threads $1 -SET current = $((tomcat_threads)) -SET busy = $((tomcat_threads_busy)) -END -BEGIN tomcat.jvm $1 -SET jvm = $((tomcat_jvm_freememory)) -END -VALUESEOF - - return 0 -} diff --git a/collectors/charts.d.plugin/tomcat/tomcat.conf b/collectors/charts.d.plugin/tomcat/tomcat.conf deleted file mode 100644 index e9f3eefa9..000000000 --- a/collectors/charts.d.plugin/tomcat/tomcat.conf +++ /dev/null @@ -1,38 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2018 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ - -# THIS PLUGIN IS DEPRECATED -# USE THE PYTHON.D ONE - -# the URL to download tomcat status info -# usually http://localhost:8080/manager/status?XML=true -#tomcat_url="" -#tomcat_curl_opts="" - -# set tomcat username/password here -#tomcat_user="" -#tomcat_password="" - -# the data collection frequency -# if unset, will inherit the netdata update frequency -#tomcat_update_every=1 - -# the charts priority on the dashboard -#tomcat_priority=60000 - -# the number of retries to do in case of failure -# before disabling the module -#tomcat_retries=10 - -# convert tomcat floating point values -# to integer using this multiplier -# this only affects precision - the values -# will be in the proper units -#tomcat_decimal_detail=1000000 - -# used by volume chart to convert bytes to KB -#tomcat_decimal_KB_detail=1000 |