summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/opensips/opensips.chart.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:31:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:31:03 +0000
commit50485bedfd9818165aa1d039d0abe95a559134b7 (patch)
tree79c7b08f67edcfb0c936e7a22931653b91189b9f /collectors/charts.d.plugin/opensips/opensips.chart.sh
parentReleasing debian version 1.11.1+dfsg-7. (diff)
downloadnetdata-50485bedfd9818165aa1d039d0abe95a559134b7.tar.xz
netdata-50485bedfd9818165aa1d039d0abe95a559134b7.zip
Merging upstream version 1.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin/opensips/opensips.chart.sh')
-rw-r--r--collectors/charts.d.plugin/opensips/opensips.chart.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/collectors/charts.d.plugin/opensips/opensips.chart.sh b/collectors/charts.d.plugin/opensips/opensips.chart.sh
index c227bd4f2..b42462d6d 100644
--- a/collectors/charts.d.plugin/opensips/opensips.chart.sh
+++ b/collectors/charts.d.plugin/opensips/opensips.chart.sh
@@ -14,8 +14,8 @@ 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:]]*$" |\
+ 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" \
@@ -29,8 +29,7 @@ opensips_get_stats() {
opensips_check() {
# if the user did not provide an opensips_cmd
# try to find it in the system
- if [ -z "$opensips_cmd" ]
- then
+ if [ -z "$opensips_cmd" ]; then
require_cmd opensipsctl || return 1
fi
@@ -38,8 +37,7 @@ opensips_check() {
local x
x="$(opensips_get_stats | grep "^opensips_core_")"
# shellcheck disable=SC2181
- if [ ! $? -eq 0 ] || [ -z "$x" ]
- then
+ 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
fi