From 1746898cefcb17f58b5cf27b4dad3d28236f1152 Mon Sep 17 00:00:00 2001 From: Lennart Weller Date: Mon, 5 Sep 2016 10:27:21 +0200 Subject: Imported Upstream version 1.3.0+dfsg --- charts.d/nginx.chart.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'charts.d/nginx.chart.sh') diff --git a/charts.d/nginx.chart.sh b/charts.d/nginx.chart.sh index 450aa94b3..a2a9b320f 100755 --- a/charts.d/nginx.chart.sh +++ b/charts.d/nginx.chart.sh @@ -1,9 +1,10 @@ -#!/bin/bash +# no need for shebang - this file is loaded from charts.d.plugin # 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 @@ -19,7 +20,7 @@ nginx_reading=0 nginx_writing=0 nginx_waiting=0 nginx_get() { - nginx_response=($(curl -Ss "${nginx_url}")) + nginx_response=($(curl -Ss ${nginx_curl_opts} "${nginx_url}")) [ $? -ne 0 -o "${#nginx_response[@]}" -eq 0 ] && return 1 if [ "${nginx_response[0]}" != "Active" \ @@ -81,18 +82,18 @@ nginx_check() { # _create is called once, to create the charts nginx_create() { cat <