From a64a253794ac64cb40befee54db53bde17dd0d49 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Nov 2018 13:19:29 +0100 Subject: New upstream version 1.11.0+dfsg Signed-off-by: Daniel Baumann --- charts.d/Makefile.am | 31 --- charts.d/Makefile.in | 575 ----------------------------------------- charts.d/README.md | 344 ------------------------ charts.d/ap.chart.sh | 181 ------------- charts.d/apache.chart.sh | 254 ------------------ charts.d/apcupsd.chart.sh | 198 -------------- charts.d/cpu_apps.chart.sh | 71 ----- charts.d/cpufreq.chart.sh | 88 ------- charts.d/example.chart.sh | 119 --------- charts.d/exim.chart.sh | 47 ---- charts.d/hddtemp.chart.sh | 74 ------ charts.d/libreswan.chart.sh | 173 ------------- charts.d/load_average.chart.sh | 70 ----- charts.d/mem_apps.chart.sh | 62 ----- charts.d/mysql.chart.sh | 522 ------------------------------------- charts.d/nginx.chart.sh | 141 ---------- charts.d/nut.chart.sh | 222 ---------------- charts.d/opensips.chart.sh | 322 ----------------------- charts.d/phpfpm.chart.sh | 194 -------------- charts.d/postfix.chart.sh | 86 ------ charts.d/sensors.chart.sh | 250 ------------------ charts.d/squid.chart.sh | 144 ----------- charts.d/tomcat.chart.sh | 147 ----------- 23 files changed, 4315 deletions(-) delete mode 100644 charts.d/Makefile.am delete mode 100644 charts.d/Makefile.in delete mode 100644 charts.d/README.md delete mode 100644 charts.d/ap.chart.sh delete mode 100644 charts.d/apache.chart.sh delete mode 100644 charts.d/apcupsd.chart.sh delete mode 100644 charts.d/cpu_apps.chart.sh delete mode 100644 charts.d/cpufreq.chart.sh delete mode 100644 charts.d/example.chart.sh delete mode 100644 charts.d/exim.chart.sh delete mode 100644 charts.d/hddtemp.chart.sh delete mode 100644 charts.d/libreswan.chart.sh delete mode 100644 charts.d/load_average.chart.sh delete mode 100644 charts.d/mem_apps.chart.sh delete mode 100644 charts.d/mysql.chart.sh delete mode 100644 charts.d/nginx.chart.sh delete mode 100644 charts.d/nut.chart.sh delete mode 100644 charts.d/opensips.chart.sh delete mode 100644 charts.d/phpfpm.chart.sh delete mode 100644 charts.d/postfix.chart.sh delete mode 100644 charts.d/sensors.chart.sh delete mode 100644 charts.d/squid.chart.sh delete mode 100644 charts.d/tomcat.chart.sh (limited to 'charts.d') diff --git a/charts.d/Makefile.am b/charts.d/Makefile.am deleted file mode 100644 index 104ba86af..000000000 --- a/charts.d/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2015 Alon Bar-Lev -# -MAINTAINERCLEANFILES= $(srcdir)/Makefile.in - -dist_charts_SCRIPTS = \ - $(NULL) - -dist_charts_DATA = \ - README.md \ - ap.chart.sh \ - apcupsd.chart.sh \ - apache.chart.sh \ - cpu_apps.chart.sh \ - cpufreq.chart.sh \ - example.chart.sh \ - exim.chart.sh \ - hddtemp.chart.sh \ - libreswan.chart.sh \ - load_average.chart.sh \ - mem_apps.chart.sh \ - mysql.chart.sh \ - nginx.chart.sh \ - nut.chart.sh \ - opensips.chart.sh \ - phpfpm.chart.sh \ - postfix.chart.sh \ - sensors.chart.sh \ - squid.chart.sh \ - tomcat.chart.sh \ - $(NULL) diff --git a/charts.d/Makefile.in b/charts.d/Makefile.in deleted file mode 100644 index ebd1af2be..000000000 --- a/charts.d/Makefile.in +++ /dev/null @@ -1,575 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 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@ - - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -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 = charts.d -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(dist_charts_SCRIPTS) $(dist_charts_DATA) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___atomic.m4 \ - $(top_srcdir)/m4/ax_c__generic.m4 $(top_srcdir)/m4/ax_c_lto.m4 \ - $(top_srcdir)/m4/ax_c_mallinfo.m4 \ - $(top_srcdir)/m4/ax_c_mallopt.m4 \ - $(top_srcdir)/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ - $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/jemalloc.m4 \ - $(top_srcdir)/m4/tcmalloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -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)$(chartsdir)" -SCRIPTS = $(dist_charts_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) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -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@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -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@ -LDFLAGS = @LDFLAGS@ -LIBCAP_CFLAGS = @LIBCAP_CFLAGS@ -LIBCAP_LIBS = @LIBCAP_LIBS@ -LIBMNL_CFLAGS = @LIBMNL_CFLAGS@ -LIBMNL_LIBS = @LIBMNL_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @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_IPMIMONITORING_CFLAGS = @OPTIONAL_IPMIMONITORING_CFLAGS@ -OPTIONAL_IPMIMONITORING_LIBS = @OPTIONAL_IPMIMONITORING_LIBS@ -OPTIONAL_LIBCAP_CFLAGS = @OPTIONAL_LIBCAP_CFLAGS@ -OPTIONAL_LIBCAP_LIBS = @OPTIONAL_LIBCAP_LIBS@ -OPTIONAL_MATH_CLFAGS = @OPTIONAL_MATH_CLFAGS@ -OPTIONAL_MATH_LIBS = @OPTIONAL_MATH_LIBS@ -OPTIONAL_NFACCT_CLFAGS = @OPTIONAL_NFACCT_CLFAGS@ -OPTIONAL_NFACCT_LIBS = @OPTIONAL_NFACCT_LIBS@ -OPTIONAL_UUID_CLFAGS = @OPTIONAL_UUID_CLFAGS@ -OPTIONAL_UUID_LIBS = @OPTIONAL_UUID_LIBS@ -OPTIONAL_ZLIB_CLFAGS = @OPTIONAL_ZLIB_CLFAGS@ -OPTIONAL_ZLIB_LIBS = @OPTIONAL_ZLIB_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_RPM_RELEASE = @PACKAGE_RPM_RELEASE@ -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@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SSE_CANDIDATE = @SSE_CANDIDATE@ -STRIP = @STRIP@ -UUID_CFLAGS = @UUID_CFLAGS@ -UUID_LIBS = @UUID_LIBS@ -VERSION = @VERSION@ -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@ -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_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@ -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@ -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@ - -# -# Copyright (C) 2015 Alon Bar-Lev -# -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in -dist_charts_SCRIPTS = \ - $(NULL) - -dist_charts_DATA = \ - README.md \ - ap.chart.sh \ - apcupsd.chart.sh \ - apache.chart.sh \ - cpu_apps.chart.sh \ - cpufreq.chart.sh \ - example.chart.sh \ - exim.chart.sh \ - hddtemp.chart.sh \ - libreswan.chart.sh \ - load_average.chart.sh \ - mem_apps.chart.sh \ - mysql.chart.sh \ - nginx.chart.sh \ - nut.chart.sh \ - opensips.chart.sh \ - phpfpm.chart.sh \ - postfix.chart.sh \ - sensors.chart.sh \ - squid.chart.sh \ - tomcat.chart.sh \ - $(NULL) - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu charts.d/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu charts.d/Makefile -.PRECIOUS: 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_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_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) -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)$(chartsdir)"; 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: - -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-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -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 - -.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-dvi install-dvi-am \ - install-exec install-exec-am 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 - - -# 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/charts.d/README.md b/charts.d/README.md deleted file mode 100644 index 748af08a1..000000000 --- a/charts.d/README.md +++ /dev/null @@ -1,344 +0,0 @@ -The following charts.d plugins are supported: - ---- - -# hddtemp - -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=() -``` - ---- - -# libreswan - -The plugin will collects bytes-in, bytes-out and uptime for all established libreswan IPSEC tunnels. - -The following charts are created, **per tunnel**: - -1. **Uptime** - - * the uptime of the tunnel - -2. **Traffic** - - * bytes in - * bytes out - -### configuration - -Its config file is `/etc/netdata/charts.d/libreswan.conf`. - -The plugin executes 2 commands to collect all the information it needs: - -```sh -ipsec whack --status -ipsec whack --trafficstatus -``` - -The first command is used to extract the currently established tunnels, their IDs and their names. -The second command is used to extract the current uptime and traffic. - -Most probably user `netdata` will not be able to query libreswan, so the `ipsec` commands will be denied. -The plugin attempts to run `ipsec` as `sudo ipsec ...`, to get access to libreswan statistics. - -To allow user `netdata` execute `sudo ipsec ...`, create the file `/etc/sudoers.d/netdata` with this content: - -``` -netdata ALL = (root) NOPASSWD: /sbin/ipsec whack --status -netdata ALL = (root) NOPASSWD: /sbin/ipsec whack --trafficstatus -``` - -Make sure the path `/sbin/ipsec` matches your setup (execute `which ipsec` to find the right path). - ---- - -# mysql - -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. - - ---- - -# nut - -The plugin will collect UPS data for all UPSes configured in the system. - -The following charts will be created: - -1. **UPS Charge** - - * percentage changed - -2. **UPS Battery Voltage** - - * current voltage - * high voltage - * low voltage - * nominal voltage - -3. **UPS Input Voltage** - - * current voltage - * fault voltage - * nominal voltage - -4. **UPS Input Current** - - * nominal current - -5. **UPS Input Frequency** - - * current frequency - * nominal frequency - -6. **UPS Output Voltage** - - * current voltage - -7. **UPS Load** - - * current load - -8. **UPS Temperature** - - * current temperature - - -### configuration - -This is the internal default for `/etc/netdata/nut.conf` - -```sh -# a space separated list of UPS names -# if empty, the list returned by 'upsc -l' will be used -nut_ups= - -# how frequently to collect UPS data -nut_update_every=2 -``` - ---- - -# postfix - -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 -``` - ---- - -# sensors - -The plugin will provide charts for all configured system sensors - -> This plugin is reading sensors directly from the kernel. -> The `lm-sensors` package is able to perform calculations on the -> kernel provided values, this plugin will not perform. -> So, the values graphed, are the raw hardware values of the sensors. - -The plugin will create netdata charts for: - -1. **Temperature** -2. **Voltage** -3. **Current** -4. **Power** -5. **Fans Speed** -6. **Energy** -7. **Humidity** - -One chart for every sensor chip found and each of the above will be created. - -### configuration - -This is the internal default for `/etc/netdata/sensors.conf` - -```sh -# the directory the kernel keeps sensor data -sensors_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices" - -# how deep in the tree to check for sensor data -sensors_sys_depth=10 - -# if set to 1, the script will overwrite internal -# script functions with code generated ones -# leave to 1, is faster -sensors_source_update=1 - -# how frequently to collect sensor data -# the default is to collect it at every iteration of charts.d -sensors_update_every= - -# array of sensors which are excluded -# the default is to include all -sensors_excluded=() -``` - ---- - -# squid - -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 -``` diff --git a/charts.d/ap.chart.sh b/charts.d/ap.chart.sh deleted file mode 100644 index ce2eefc9f..000000000 --- a/charts.d/ap.chart.sh +++ /dev/null @@ -1,181 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -ap_update_every= -ap_priority=6900 - -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=$(run iw dev | awk ' - BEGIN { - i = ""; - ssid = ""; - ap = 0; - } - /^[ \t]+Interface / { - if( ap == 1 ) { - print "ap_devs[" i "]=\"" ssid "\"" - } - - i = $2; - ssid = ""; - ap = 0; - } - /^[ \t]+ssid / { ssid = $2; } - /^[ \t]+type AP$/ { ap = 1; } - END { - if( ap == 1 ) { - print "ap_devs[" i "]=\"" ssid "\"" - } - } - ') - eval "${ev}" - - # 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 -} - -# _create is called once, to create the charts -ap_create() { - local ssid dev - - for dev in "${!ap_devs[@]}" - do - ssid="${ap_devs[${dev}]}" - - # create the chart with 3 dimensions - cat < 0) { - print \"BEGIN ap_clients.\" dev; - print \"SET clients = \" c; - print \"END\"; - print \"BEGIN ap_bandwidth.\" dev; - print \"SET received = \" rb; - print \"SET sent = \" tb; - print \"END\"; - print \"BEGIN ap_packets.\" dev; - print \"SET received = \" rp; - print \"SET sent = \" tp; - print \"END\"; - print \"BEGIN ap_issues.\" dev; - print \"SET retries = \" tr; - print \"SET failures = \" tf; - print \"END\"; - - if( c == 0 ) c = 1; - print \"BEGIN ap_signal.\" dev; - print \"SET signal = \" int(s / c); - print \"END\"; - print \"BEGIN ap_bitrate.\" dev; - print \"SET receive = \" int(rt / c); - print \"SET transmit = \" int(tt / c); - print \"SET expected = \" int(e / c); - print \"END\"; - } - zero_data(); - } - BEGIN { - zero_data(); - } - /^DEVICE / { - print_device(); - dev = \$2; - } - /^Station/ { c++; } - /^[ \\t]+rx bytes:/ { rb += \$3; } - /^[ \\t]+tx bytes:/ { tb += \$3; } - /^[ \\t]+rx packets:/ { rp += \$3; } - /^[ \\t]+tx packets:/ { tp += \$3; } - /^[ \\t]+tx retries:/ { tr += \$3; } - /^[ \\t]+tx failed:/ { tf += \$3; } - /^[ \\t]+signal:/ { x = \$2; s += x * 1000; } - /^[ \\t]+rx bitrate:/ { x = \$3; rt += x * 1000; } - /^[ \\t]+tx bitrate:/ { x = \$3; tt += x * 1000; } - /^[ \\t]+expected throughput:(.*)Mbps/ { - x=\$3; - sub(/Mbps/, \"\", x); - e += x * 1000; - } - END { - print_device(); - } - " - - return 0 -} - diff --git a/charts.d/apache.chart.sh b/charts.d/apache.chart.sh deleted file mode 100644 index a8ac08014..000000000 --- a/charts.d/apache.chart.sh +++ /dev/null @@ -1,254 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -# 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}" \ - -a ! -z "${apache_key_connsasyncwriting}" \ - -a ! -z "${apache_key_connsasynckeepalive}" \ - -a ! -z "${apache_key_connsasyncclosing}" \ - ] - then - apache_has_conns=1 - else - apache_has_conns=0 - fi - - return 0 -} - -apache_get() { - local oIFS="${IFS}" ret - IFS=$':\n' apache_response=($(run curl -Ss ${apache_curl_opts} "${apache_url}")) - ret=$? - IFS="${oIFS}" - - [ $ret -ne 0 -o "${#apache_response[@]}" -eq 0 ] && return 1 - - # 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 -o "${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}" \ - -o -z "${apache_kbytes}" \ - -o -z "${apache_reqpersec}" \ - -o -z "${apache_bytespersec}" \ - -o -z "${apache_bytesperreq}" \ - -o -z "${apache_busyworkers}" \ - -o -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 - if [ $? -ne 0 ] - then - 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 < -# GPL v3+ -# - -apcupsd_ip= -apcupsd_port= - -declare -A apcupsd_sources=( - ["local"]="127.0.0.1:3551" -) - -# how frequently to collect UPS data -apcupsd_update_every=10 - -apcupsd_timeout=3 - -# the priority of apcupsd related to other charts -apcupsd_priority=90000 - -apcupsd_get() { - run -t $apcupsd_timeout apcaccess status "$1" -} - -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 - if [ $? -ne 0 ] - then - error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}." - failed=$((failed + 1)) - elif [ $(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }') != "ONLINE" ] - then - error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online." - failed=$((failed + 1)) - else - working=$((working + 1)) - 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}]} - - # create the charts - cat < -# GPL v3+ -# -# 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/charts.d/cpufreq.chart.sh b/charts.d/cpufreq.chart.sh deleted file mode 100644 index 1c41c38f2..000000000 --- a/charts.d/cpufreq.chart.sh +++ /dev/null @@ -1,88 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -# 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 - [ $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 - - [ $cpufreq_source_update -eq 0 ] && . $TMP_DIR/cpufreq.sh $1 - - return 0 -} - diff --git a/charts.d/example.chart.sh b/charts.d/example.chart.sh deleted file mode 100644 index ffc98712f..000000000 --- a/charts.d/example.chart.sh +++ /dev/null @@ -1,119 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -# if this chart is called X.chart.sh, then all functions and global variables -# must start with X_ - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -example_update_every= - -# the priority is used to sort the charts on the dashboard -# 1 = the first chart -example_priority=150000 - -# to enable this chart, you have to set this to 12345 -# (just a demonstration for something that needs to be checked) -example_magic_number= - -# global variables to store our collected data -# remember: they need to start with the module name example_ -example_value1= -example_value2= -example_value3= -example_value4= -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) )) - - [ $example_last -gt 16383 -a $example_value4 -gt 16383 ] && example_value4=$((example_value4 - 16383)) - [ $example_last -le 16383 -a $example_value4 -lt 16383 ] && example_value4=$((example_value4 + 16383)) - 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 - - # 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 - - return 0 -} - -# _create is called once, to create the charts -example_create() { - # create the chart with 3 dimensions - cat < -# GPL v3+ -# -# 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 < -# GPL v3+ -# -# 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 - 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 - 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 -# GPL v3+ -# - -# _update_every is a special variable - it holds the number of seconds -# between the calls of the _update() function -libreswan_update_every=1 - -# the priority is used to sort the charts on the dashboard -# 1 = the first chart -libreswan_priority=90000 - -# set to 1, to run ipsec with sudo -libreswan_sudo=1 - -# global variables to store our collected data - -# [TUNNELID] = TUNNELNAME -# here we track the *latest* established tunnels -# as detected by: ipsec whack --status -declare -A libreswan_connected_tunnels=() - -# [TUNNELID] = VALUE -# here we track values of all established tunnels (not only the latest) -# as detected by: ipsec whack --trafficstatus -declare -A libreswan_traffic_in=() -declare -A libreswan_traffic_out=() -declare -A libreswan_established_add_time=() - -# [TUNNELNAME] = CHARTID -# here we remember CHARTIDs of all tunnels -# we need this to avoid converting tunnel names to chart IDs on every iteration -declare -A libreswan_tunnel_charts=() - -# run the ipsec command -libreswan_ipsec() { - 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 - 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 -} - -# _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 - - require_cmd ipsec || return 1 - - # make sure it is libreswan - if [ -z "$(ipsec --version | grep -i libreswan)" ] - then - error "ipsec command is not Libreswan. Disabling Libreswan plugin." - return 1 - fi - - # check that we can collect data - libreswan_get || return 1 - - return 0 -} - -# create the charts for an ipsec tunnel -libreswan_create_one() { - local n="${1}" name - - name="${libreswan_connected_tunnels[${n}]}" - - [ ! -z "${libreswan_tunnel_charts[${name}]}" ] && return 0 - - libreswan_tunnel_charts[${name}]="$(fixid "${name}")" - - cat < -# GPL v3+ -# - -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 < -# GPL v3+ -# - -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/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh deleted file mode 100644 index 1363d01f4..000000000 --- a/charts.d/mysql.chart.sh +++ /dev/null @@ -1,522 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -# 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]" )) - arr=($(run "${@}" -N -e "SHOW GLOBAL STATUS;" | egrep "^(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 -# GPL v3+ -# - -# 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() { - nginx_response=($(run curl -Ss ${nginx_curl_opts} "${nginx_url}")) - [ $? -ne 0 -o "${#nginx_response[@]}" -eq 0 ] && return 1 - - if [ "${nginx_response[0]}" != "Active" \ - -o "${nginx_response[1]}" != "connections:" \ - -o "${nginx_response[3]}" != "server" \ - -o "${nginx_response[4]}" != "accepts" \ - -o "${nginx_response[5]}" != "handled" \ - -o "${nginx_response[6]}" != "requests" \ - -o "${nginx_response[10]}" != "Reading:" \ - -o "${nginx_response[12]}" != "Writing:" \ - -o "${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}" \ - -o -z "${nginx_accepts}" \ - -o -z "${nginx_handled}" \ - -o -z "${nginx_requests}" \ - -o -z "${nginx_reading}" \ - -o -z "${nginx_writing}" \ - -o -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 - if [ $? -ne 0 ] - then - 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 < -# GPL v3+ -# - -# a space separated list of UPS names -# if empty, the list returned by 'upsc -l' will be used -nut_ups= - -# how frequently to collect UPS data -nut_update_every=2 - -# how much time in seconds, to wait for nut to respond -nut_timeout=2 - -# set this to 1, to enable another chart showing the number -# of UPS clients connected to upsd -nut_clients_chart=0 - -# the priority of nut related to other charts -nut_priority=90000 - -declare -A nut_ids=() - -nut_get_all() { - run -t $nut_timeout upsc -l -} - -nut_get() { - 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 -} - -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 - if [ $? -eq 0 ] - then - nut_ids[$x]="$( fixid "$x" )" - continue - fi - error "cannot get information for NUT UPS '$x'." - done - - if [ ${#nut_ids[@]} -eq 0 ] - then - 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 - - for x in "${nut_ids[@]}" - do - cat < -# GPL v3+ -# - -opensips_opts="fifo get_statistics all" -opensips_cmd= -opensips_update_every=5 -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 -} - -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="$(opensips_get_stats | grep "^opensips_core_")" - if [ ! $? -eq 0 -o -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 < -# GPL v3+ -# -# 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}" - - phpfpm_response=($(run curl -Ss ${opts} "${url}")) - [ $? -ne 0 -o "${#phpfpm_response[@]}" -eq 0 ] && return 1 - - 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]}" - if [ $? -ne 0 ]; then - error "cannot find status on URL '${phpfpm_url[$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 < -# GPL v3+ -# - -# 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" -o ! -x "$postfix_postqueue" ] - then - postfix_postqueue="$(which postqueue 2>/dev/null || command -v postqueue 2>/dev/null)" - fi - - if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ] - then - error "cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" - return 1 - fi - - return 0 -} - -postfix_create() { -cat < -# GPL v3+ -# - -# sensors docs -# https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface - -# if this chart is called X.chart.sh, then all functions and global variables -# must start with X_ - -# the directory the kernel keeps sensor data -sensors_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices" - -# how deep in the tree to check for sensor data -sensors_sys_depth=10 - -# if set to 1, the script will overwrite internal -# script functions with code generated ones -# leave to 1, is faster -sensors_source_update=1 - -# how frequently to collect sensor data -# the default is to collect it at every iteration of charts.d -sensors_update_every= - -sensors_priority=90000 - -declare -A sensors_excluded=() - -sensors_find_all_files() { - find $1 -maxdepth $sensors_sys_depth -name \*_input -o -name temp 2>/dev/null -} - -sensors_find_all_dirs() { - sensors_find_all_files $1 | while read - do - dirname $REPLY - done | sort -u -} - -# _check is called once, to find out if this chart should be enabled or not -sensors_check() { - - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart - - [ -z "$( sensors_find_all_files $sensors_sys_dir )" ] && error "no sensors found in '$sensors_sys_dir'." && return 1 - return 0 -} - -sensors_check_files() { - # we only need sensors that report a non-zero value - # also remove not needed sensors - - local f= v= excluded= - for f in $* - do - [ ! -f "$f" ] && continue - for ex in ${sensors_excluded[@]}; do - [[ $f =~ .*$ex$ ]] && excluded='1' && break - done - - [ "$excluded" != "1" ] && v="$( cat $f )" || v=0 - v=$(( v + 1 - 1 )) - [ $v -ne 0 ] && echo "$f" && continue - excluded= - - error "$f gives zero values" - done -} - -sensors_check_temp_type() { - # valid temp types are 1 to 6 - # disabled sensors have the value 0 - - local f= t= v= - for f in $* - do - t=$( echo $f | sed "s|_input$|_type|g" ) - [ "$f" = "$t" ] && echo "$f" && continue - [ ! -f "$t" ] && echo "$f" && continue - - v="$( cat $t )" - v=$(( v + 1 - 1 )) - [ $v -ne 0 ] && echo "$f" && continue - - error "$f is disabled" - done -} - -# _create is called once, to create the charts -sensors_create() { - local path= dir= name= x= file= lfile= labelname= labelid= device= subsystem= id= type= mode= files= multiplier= divisor= - - # we create a script with the source of the - # sensors_update() function - # - the highest speed we can achieve - - [ $sensors_source_update -eq 1 ] && echo >$TMP_DIR/sensors.sh "sensors_update() {" - - for path in $( sensors_find_all_dirs $sensors_sys_dir | sort -u ) - do - dir=$( basename $path ) - device= - subsystem= - id= - type= - name= - - [ -h $path/device ] && device=$( readlink -f $path/device ) - [ ! -z "$device" ] && device=$( basename $device ) - [ -z "$device" ] && device="$dir" - - [ -h $path/subsystem ] && subsystem=$( readlink -f $path/subsystem ) - [ ! -z "$subsystem" ] && subsystem=$( basename $subsystem ) - [ -z "$subsystem" ] && subsystem="$dir" - - [ -f $path/name ] && name=$( cat $path/name ) - [ -z "$name" ] && name="$dir" - - [ -f $path/type ] && type=$( cat $path/type ) - [ -z "$type" ] && type="$dir" - - id="$( fixid "$device.$subsystem.$dir" )" - - debug "path='$path', dir='$dir', device='$device', subsystem='$subsystem', id='$id', name='$name'" - - for mode in temperature voltage fans power current energy humidity - do - files= - multiplier=1 - divisor=1 - algorithm="absolute" - - case $mode in - temperature) - files="$( ls $path/temp*_input 2>/dev/null; ls $path/temp 2>/dev/null )" - files="$( sensors_check_files $files )" - files="$( sensors_check_temp_type $files )" - [ -z "$files" ] && continue - echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.temp_$id \$1\"" - divisor=1000 - ;; - - voltage) - files="$( ls $path/in*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.volt_$id \$1\"" - divisor=1000 - ;; - - current) - files="$( ls $path/curr*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.curr_$id \$1\"" - divisor=1000 - ;; - - power) - files="$( ls $path/power*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.power_$id \$1\"" - divisor=1000000 - ;; - - fans) - files="$( ls $path/fan*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.fan_$id \$1\"" - ;; - - energy) - files="$( ls $path/energy*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.energy_$id \$1\"" - algorithm="incremental" - divisor=1000000 - ;; - - humidity) - files="$( ls $path/humidity*_input 2>/dev/null )" - files="$( sensors_check_files $files )" - [ -z "$files" ] && continue - echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every" - echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.humidity_$id \$1\"" - divisor=1000 - ;; - - *) - continue - ;; - esac - - for x in $files - do - file="$x" - fid="$( fixid "$file" )" - lfile="$( basename $file | sed "s|_input$|_label|g" )" - labelname="$( basename $file | sed "s|_input$||g" )" - - if [ ! "$path/$lfile" = "$file" -a -f "$path/$lfile" ] - then - labelname="$( cat "$path/$lfile" )" - fi - - echo "DIMENSION $fid '$labelname' $algorithm $multiplier $divisor" - echo >>$TMP_DIR/sensors.sh "echo \"SET $fid = \"\$(< $file )" - done - - echo >>$TMP_DIR/sensors.sh "echo END" - done - done - - [ $sensors_source_update -eq 1 ] && echo >>$TMP_DIR/sensors.sh "}" - - # ok, load the function sensors_update() we created - [ $sensors_source_update -eq 1 ] && . $TMP_DIR/sensors.sh - - return 0 -} - -# _update is called continuously, to collect the values -sensors_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 - - [ $sensors_source_update -eq 0 ] && . $TMP_DIR/sensors.sh $1 - - return 0 -} - diff --git a/charts.d/squid.chart.sh b/charts.d/squid.chart.sh deleted file mode 100644 index 2c19c35d5..000000000 --- a/charts.d/squid.chart.sh +++ /dev/null @@ -1,144 +0,0 @@ -# no need for shebang - this file is loaded from charts.d.plugin - -# netdata -# real-time performance and health monitoring, done right! -# (C) 2016 Costa Tsaousis -# GPL v3+ -# - -squid_host= -squid_port= -squid_url= -squid_timeout=2 -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" -o -z "$squid_port" -o -z "$squid_url" ] - then - squid_autodetect || return 1 - fi - - # check once if the url works - local x="$(squid_get_stats | grep client_http.requests)" - if [ ! $? -eq 0 -o -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 < -# GPL v3+ -# -# 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 - 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 - 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 - 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 <