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/nginx | |
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/nginx')
-rw-r--r-- | collectors/charts.d.plugin/nginx/Makefile.inc | 13 | ||||
-rw-r--r-- | collectors/charts.d.plugin/nginx/README.md | 6 | ||||
-rw-r--r-- | collectors/charts.d.plugin/nginx/nginx.chart.sh | 141 | ||||
-rw-r--r-- | collectors/charts.d.plugin/nginx/nginx.conf | 23 |
4 files changed, 0 insertions, 183 deletions
diff --git a/collectors/charts.d.plugin/nginx/Makefile.inc b/collectors/charts.d.plugin/nginx/Makefile.inc deleted file mode 100644 index c9d31aad..00000000 --- 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 57b4a4b1..00000000 --- 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 812de2cb..00000000 --- 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 c46100a5..00000000 --- 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 |