summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/opensips/opensips.chart.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/charts.d.plugin/opensips/opensips.chart.sh (renamed from charts.d/opensips.chart.sh)10
1 files changed, 7 insertions, 3 deletions
diff --git a/charts.d/opensips.chart.sh b/collectors/charts.d.plugin/opensips/opensips.chart.sh
index 2a0249dae..c227bd4f2 100644
--- a/charts.d/opensips.chart.sh
+++ b/collectors/charts.d.plugin/opensips/opensips.chart.sh
@@ -1,9 +1,10 @@
+# shellcheck shell=bash disable=SC1117,SC2154,SC2086
# 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>
-# GPL v3+
#
opensips_opts="fifo get_statistics all"
@@ -34,8 +35,10 @@ opensips_check() {
fi
# check once if the command works
- local x="$(opensips_get_stats | grep "^opensips_core_")"
- if [ ! $? -eq 0 -o -z "$x" ]
+ 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
@@ -218,6 +221,7 @@ opensips_update() {
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