summaryrefslogtreecommitdiffstats
path: root/tests/stress.sh
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2019-09-29 09:10:35 +0000
committerChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-09-29 11:10:35 +0200
commit325857ef07822fa5e6a1330d96be55276d9e664a (patch)
treed9bcb3f8fa6f3ec61e911b901314df67a590988d /tests/stress.sh
parent7de804a4e1e0a34424bad7ecb6541cb71c0c7b2a (diff)
Common pattern for web and alarms together with two bug fixes (#6783)
* script_pattern: Fix script and bring pattern This commit fixes the error given by shellckeck on stress.sh and brings a pattern for the other scripts, no less important its given the possibility to change the url from outside of the scripts * script_pattern: shellcheke Correct the request.sh after to change it to avoid warning errors from shellchecker * script_pattern: Remove of garbage value With this PR I am removing the garbage value of a script * script_pattern: Restore color These 3 scripts changed in this commit was not restoring the terminal color, this commit fixes this
Diffstat (limited to 'tests/stress.sh')
-rwxr-xr-xtests/stress.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/stress.sh b/tests/stress.sh
index cef5327776..97cced0325 100755
--- a/tests/stress.sh
+++ b/tests/stress.sh
@@ -8,7 +8,7 @@ then
fi
# set the host to connect to
-if [ ! -z "$1" ]
+if [ -n "$1" ]
then
host="$1"
else
@@ -17,17 +17,17 @@ fi
echo "using netdata server at: $host"
# shellcheck disable=SC2207 disable=SC1117
-charts=($(curl "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u))
+charts=($(curl -k "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u))
if [ "${#charts[@]}" -eq 0 ]
then
echo "Cannot download charts from server: $host"
exit 1
fi
-update_every="$(curl "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)"
+update_every="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)"
[ $(( update_every + 1 - 1)) -eq 0 ] && update_every=1
-entries="$(curl "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)"
+entries="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)"
[ $(( entries + 1 - 1)) -eq 0 ] && entries=3600
# to compare equal things, set the entries to 3600 max
@@ -55,7 +55,7 @@ trap cleanup EXIT
while true
do
- echo "curl --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file"
+ echo "curl -k --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file"
# shellcheck disable=SC2034
for x in {1..100}
do