diff options
author | Lennart Weller <lhw@ring0.de> | 2017-01-24 15:21:09 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2017-01-24 15:21:09 +0000 |
commit | 3ed3b02ed96ddab1c084811f3579b3a2aec83e04 (patch) | |
tree | 7a61ab288ae47800c4f11be5677d6ad8288dcd98 /charts.d/opensips.chart.sh | |
parent | New upstream version 1.4.0+dfsg (diff) | |
download | netdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.tar.xz netdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.zip |
New upstream version 1.5.0+dfsgupstream/1.5.0+dfsg
Diffstat (limited to 'charts.d/opensips.chart.sh')
-rwxr-xr-x | charts.d/opensips.chart.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/charts.d/opensips.chart.sh b/charts.d/opensips.chart.sh index 779087e35..2a0249dae 100755 --- a/charts.d/opensips.chart.sh +++ b/charts.d/opensips.chart.sh @@ -1,5 +1,11 @@ # no need for shebang - this file is loaded from charts.d.plugin +# netdata +# real-time performance and health monitoring, done right! +# (C) 2016 Costa Tsaousis <costa@tsaousis.gr> +# GPL v3+ +# + opensips_opts="fifo get_statistics all" opensips_cmd= opensips_update_every=5 @@ -7,7 +13,7 @@ opensips_timeout=2 opensips_priority=80000 opensips_get_stats() { - timeout $opensips_timeout "$opensips_cmd" $opensips_opts |\ + 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" \ @@ -31,7 +37,7 @@ opensips_check() { local x="$(opensips_get_stats | grep "^opensips_core_")" if [ ! $? -eq 0 -o -z "$x" ] then - echo >&2 "$PROGRAM_NAME: opensips: cannot get global status. Please set opensips_opts='options' whatever needed to get connected to opensips server, in $confd/opensips.conf" + 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 @@ -214,7 +220,7 @@ opensips_update() { eval "local $(opensips_get_stats)" [ $? -ne 0 ] && return 1 - [ $opensips_command_failed -eq 1 ] && echo >&2 "$PROGRAM_NAME: opensips: failed to get values, disabling." && return 1 + [ $opensips_command_failed -eq 1 ] && error "failed to get values, disabling." && return 1 # write the result of the work. cat <<VALUESEOF |