summaryrefslogtreecommitdiffstats
path: root/charts.d/phpfpm.chart.sh
diff options
context:
space:
mode:
authorSimon Nagl <simonnagl@aim.com>2016-04-28 22:41:15 +0200
committerSimon Nagl <simonnagl@aim.com>2016-04-29 02:31:15 +0200
commitec28e63c30962818dab315d64ee4da10005e47fd (patch)
treee4697d0be4d11c27726366b97351fa378722a3f4 /charts.d/phpfpm.chart.sh
parent444aab651daab58c4e727fffe74ea21bc920cdab (diff)
Fix #282 use modern arithmetic expansion in shell
Use $((.*)) instead of $[.*] The later one is old syntax
Diffstat (limited to 'charts.d/phpfpm.chart.sh')
-rwxr-xr-xcharts.d/phpfpm.chart.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/charts.d/phpfpm.chart.sh b/charts.d/phpfpm.chart.sh
index 60e6b2c102..c0532fab11 100755
--- a/charts.d/phpfpm.chart.sh
+++ b/charts.d/phpfpm.chart.sh
@@ -120,15 +120,15 @@ phpfpm_create() {
for m in "${!phpfpm_urls[@]}"
do
cat <<EOF
-CHART phpfpm_$m.connections '' "PHP-FPM Active Connections" "connections" phpfpm phpfpm.connections line $[phpfpm_priority + 1] $phpfpm_update_every
+CHART phpfpm_$m.connections '' "PHP-FPM Active Connections" "connections" phpfpm phpfpm.connections line $((phpfpm_priority + 1)) $phpfpm_update_every
DIMENSION active '' absolute 1 1
DIMENSION maxActive 'max active' absolute 1 1
DIMENSION idle '' absolute 1 1
-CHART phpfpm_$m.requests '' "PHP-FPM Requests" "requests/s" phpfpm phpfpm.requests line $[phpfpm_priority + 2] $phpfpm_update_every
+CHART phpfpm_$m.requests '' "PHP-FPM Requests" "requests/s" phpfpm phpfpm.requests line $((phpfpm_priority + 2)) $phpfpm_update_every
DIMENSION requests '' incremental 1 1
-CHART phpfpm_$m.performance '' "PHP-FPM Performance" "status" phpfpm phpfpm.performance line $[phpfpm_priority + 3] $phpfpm_update_every
+CHART phpfpm_$m.performance '' "PHP-FPM Performance" "status" phpfpm phpfpm.performance line $((phpfpm_priority + 3)) $phpfpm_update_every
DIMENSION reached 'max children reached' absolute 1 1
DIMENSION slow 'slow requests' absolute 1 1
EOF
@@ -157,16 +157,16 @@ phpfpm_update() {
# write the result of the work.
cat <<EOF
BEGIN phpfpm_$m.connections $1
-SET active = $[phpfpm_active_processes]
-SET maxActive = $[phpfpm_max_active_processes]
-SET idle = $[phpfpm_idle_processes]
+SET active = $((phpfpm_active_processes))
+SET maxActive = $((phpfpm_max_active_processes))
+SET idle = $((phpfpm_idle_processes))
END
BEGIN phpfpm_$m.requests $1
-SET requests = $[phpfpm_accepted_conn]
+SET requests = $((phpfpm_accepted_conn))
END
BEGIN phpfpm_$m.performance $1
-SET reached = $[phpfpm_max_children_reached]
-SET slow = $[phpfpm_slow_requests]
+SET reached = $((phpfpm_max_children_reached))
+SET slow = $((phpfpm_slow_requests))
END
EOF
done