@cryptotaxi247 / netdata-1 / commits / ec28e63c3

Fix #282 use modern arithmetic expansion in shell

Use $((.*)) instead of $[.*] The later one is old syntax

Simon Nagl committed Apr 28, 2016 at 22:41 UTC ec28e63c30962818dab315d64ee4da10005e47fd
15 files changed +154 -154
charts.d/ap.chart.sh
+6 -6
@@ -54,25 +54,25 @@ ap_create() {
54
55 # create the chart with 3 dimensions
56 cat <<EOF
57 -CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ap.clients line $[ap_priority + 1] $ap_update_every
57 +CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ap.clients line $((ap_priority + 1)) $ap_update_every
58 DIMENSION clients '' absolute 1 1
59
60 -CHART ap_bandwidth.${dev} '' "Bandwidth for ${ssid} on ${dev}" "kilobits/s" ${dev} ap.net area $[ap_priority + 2] $ap_update_every
60 +CHART ap_bandwidth.${dev} '' "Bandwidth for ${ssid} on ${dev}" "kilobits/s" ${dev} ap.net area $((ap_priority + 2)) $ap_update_every
61 DIMENSION received '' incremental 8 1024
62 DIMENSION sent '' incremental -8 1024
63
64 -CHART ap_packets.${dev} '' "Packets for ${ssid} on ${dev}" "packets/s" ${dev} ap.packets line $[ap_priority + 3] $ap_update_every
64 +CHART ap_packets.${dev} '' "Packets for ${ssid} on ${dev}" "packets/s" ${dev} ap.packets line $((ap_priority + 3)) $ap_update_every
65 DIMENSION received '' incremental 1 1
66 DIMENSION sent '' incremental -1 1
67
68 -CHART ap_issues.${dev} '' "Transmit Issues for ${ssid} on ${dev}" "issues/s" ${dev} ap.issues line $[ap_priority + 4] $ap_update_every
68 +CHART ap_issues.${dev} '' "Transmit Issues for ${ssid} on ${dev}" "issues/s" ${dev} ap.issues line $((ap_priority + 4)) $ap_update_every
69 DIMENSION retries 'tx retries' incremental 1 1
70 DIMENSION failures 'tx failures' incremental -1 1
71
72 -CHART ap_signal.${dev} '' "Average Signal for ${ssid} on ${dev}" "dBm" ${dev} ap.signal line $[ap_priority + 5] $ap_update_every
72 +CHART ap_signal.${dev} '' "Average Signal for ${ssid} on ${dev}" "dBm" ${dev} ap.signal line $((ap_priority + 5)) $ap_update_every
73 DIMENSION signal 'average signal' absolute 1 1
74
75 -CHART ap_bitrate.${dev} '' "Bitrate for ${ssid} on ${dev}" "Mbps" ${dev} ap.bitrate line $[ap_priority + 6] $ap_update_every
75 +CHART ap_bitrate.${dev} '' "Bitrate for ${ssid} on ${dev}" "Mbps" ${dev} ap.bitrate line $((ap_priority + 6)) $ap_update_every
76 DIMENSION receive '' absolute 1 1000
77 DIMENSION transmit '' absolute -1 1000
78 DIMENSION expected 'expected throughput' absolute 1 1000
charts.d/apache.chart.sh
+33 -33
@@ -47,21 +47,21 @@ apache_detect() {
47 for x in "${@}"
48 do
49 case "${x}" in
50 - 'Total Accesses') apache_key_accesses=$[i + 1] ;;
51 - 'Total kBytes') apache_key_kbytes=$[i + 1] ;;
52 - 'ReqPerSec') apache_key_reqpersec=$[i + 1] ;;
53 - 'BytesPerSec') apache_key_bytespersec=$[i + 1] ;;
54 - 'BytesPerReq') apache_key_bytesperreq=$[i + 1] ;;
55 - 'BusyWorkers') apache_key_busyworkers=$[i + 1] ;;
56 - 'IdleWorkers') apache_key_idleworkers=$[i + 1];;
57 - 'ConnsTotal') apache_key_connstotal=$[i + 1] ;;
58 - 'ConnsAsyncWriting') apache_key_connsasyncwriting=$[i + 1] ;;
59 - 'ConnsAsyncKeepAlive') apache_key_connsasynckeepalive=$[i + 1] ;;
60 - 'ConnsAsyncClosing') apache_key_connsasyncclosing=$[i + 1] ;;
61 - 'Scoreboard') apache_key_scoreboard=$[i] ;;
50 + 'Total Accesses') apache_key_accesses=$((i + 1)) ;;
51 + 'Total kBytes') apache_key_kbytes=$((i + 1)) ;;
52 + 'ReqPerSec') apache_key_reqpersec=$((i + 1)) ;;
53 + 'BytesPerSec') apache_key_bytespersec=$((i + 1)) ;;
54 + 'BytesPerReq') apache_key_bytesperreq=$((i + 1)) ;;
55 + 'BusyWorkers') apache_key_busyworkers=$((i + 1)) ;;
56 + 'IdleWorkers') apache_key_idleworkers=$((i + 1));;
57 + 'ConnsTotal') apache_key_connstotal=$((i + 1)) ;;
58 + 'ConnsAsyncWriting') apache_key_connsasyncwriting=$((i + 1)) ;;
59 + 'ConnsAsyncKeepAlive') apache_key_connsasynckeepalive=$((i + 1)) ;;
60 + 'ConnsAsyncClosing') apache_key_connsasyncclosing=$((i + 1)) ;;
61 + 'Scoreboard') apache_key_scoreboard=$((i)) ;;
62 esac
63
64 - i=$[i + 1]
64 + i=$((i + 1))
65 done
66
67 # we will not check of the Conns*
@@ -167,27 +167,27 @@ apache_check() {
167 # _create is called once, to create the charts
168 apache_create() {
169 cat <<EOF
170 -CHART apache.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" statistics apache.bytesperreq area $[apache_priority + 8] $apache_update_every
170 +CHART apache.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" statistics apache.bytesperreq area $((apache_priority + 8)) $apache_update_every
171 DIMENSION size '' absolute 1 ${apache_decimal_detail}
172 -CHART apache.workers '' "apache Workers" "workers" workers apache.workers stacked $[apache_priority + 5] $apache_update_every
172 +CHART apache.workers '' "apache Workers" "workers" workers apache.workers stacked $((apache_priority + 5)) $apache_update_every
173 DIMENSION idle '' absolute 1 1
174 DIMENSION busy '' absolute 1 1
175 -CHART apache.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" statistics apache.reqpersec line $[apache_priority + 6] $apache_update_every
175 +CHART apache.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" statistics apache.reqpersec line $((apache_priority + 6)) $apache_update_every
176 DIMENSION requests '' absolute 1 ${apache_decimal_detail}
177 -CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" statistics apache.bytespersec area $[apache_priority + 7] $apache_update_every
178 -DIMENSION sent '' absolute 8 $[apache_decimal_detail * 1000]
179 -CHART apache.requests '' "apache Requests" "requests/s" requests apache.requests line $[apache_priority + 1] $apache_update_every
177 +CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" statistics apache.bytespersec area $((apache_priority + 7)) $apache_update_every
178 +DIMENSION sent '' absolute 8 $((apache_decimal_detail * 1000))
179 +CHART apache.requests '' "apache Requests" "requests/s" requests apache.requests line $((apache_priority + 1)) $apache_update_every
180 DIMENSION requests '' incremental 1 1
181 -CHART apache.net '' "apache Bandwidth" "kilobits/s" bandwidth apache.net area $[apache_priority + 3] $apache_update_every
181 +CHART apache.net '' "apache Bandwidth" "kilobits/s" bandwidth apache.net area $((apache_priority + 3)) $apache_update_every
182 DIMENSION sent '' incremental 8 1
183 EOF
184
185 if [ ${apache_has_conns} -eq 1 ]
186 then
187 cat <<EOF2
188 -CHART apache.connections '' "apache Connections" "connections" connections apache.connections line $[apache_priority + 2] $apache_update_every
188 +CHART apache.connections '' "apache Connections" "connections" connections apache.connections line $((apache_priority + 2)) $apache_update_every
189 DIMENSION connections '' absolute 1 1
190 -CHART apache.conns_async '' "apache Async Connections" "connections" connections apache.conns_async stacked $[apache_priority + 4] $apache_update_every
190 +CHART apache.conns_async '' "apache Async Connections" "connections" connections apache.conns_async stacked $((apache_priority + 4)) $apache_update_every
191 DIMENSION keepalive '' absolute 1 1
192 DIMENSION closing '' absolute 1 1
193 DIMENSION writing '' absolute 1 1
@@ -212,23 +212,23 @@ apache_update() {
212 # write the result of the work.
213 cat <<VALUESEOF
214 BEGIN apache.requests $1
215 -SET requests = $[apache_accesses]
215 +SET requests = $((apache_accesses))
216 END
217 BEGIN apache.net $1
218 -SET sent = $[apache_kbytes]
218 +SET sent = $((apache_kbytes))
219 END
220 BEGIN apache.reqpersec $1
221 -SET requests = $[apache_reqpersec]
221 +SET requests = $((apache_reqpersec))
222 END
223 BEGIN apache.bytespersec $1
224 -SET sent = $[apache_bytespersec]
224 +SET sent = $((apache_bytespersec))
225 END
226 BEGIN apache.bytesperreq $1
227 -SET size = $[apache_bytesperreq]
227 +SET size = $((apache_bytesperreq))
228 END
229 BEGIN apache.workers $1
230 -SET idle = $[apache_idleworkers]
231 -SET busy = $[apache_busyworkers]
230 +SET idle = $((apache_idleworkers))
231 +SET busy = $((apache_busyworkers))
232 END
233 VALUESEOF
234
@@ -236,12 +236,12 @@ VALUESEOF
236 then
237 cat <<VALUESEOF2
238 BEGIN apache.connections $1
239 -SET connections = $[apache_connstotal]
239 +SET connections = $((apache_connstotal))
240 END
241 BEGIN apache.conns_async $1
242 -SET keepalive = $[apache_connsasynckeepalive]
243 -SET closing = $[apache_connsasyncwriting]
244 -SET writing = $[apache_connsasyncwriting]
242 +SET keepalive = $((apache_connsasynckeepalive))
243 +SET closing = $((apache_connsasyncwriting))
244 +SET writing = $((apache_connsasyncwriting))
245 END
246 VALUESEOF2
247 fi
charts.d/cpufreq.chart.sh
+1 -1
@@ -36,7 +36,7 @@ cpufreq_create() {
36 # - the highest speed we can achieve -
37 [ $cpufreq_source_update -eq 1 ] && echo >$TMP_DIR/cpufreq.sh "cpufreq_update() {"
38
39 - echo "CHART cpu.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line $[cpufreq_priority + 1] $cpufreq_update_every"
39 + echo "CHART cpu.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line $((cpufreq_priority + 1)) $cpufreq_update_every"
40 echo >>$TMP_DIR/cpufreq.sh "echo \"BEGIN cpu.cpufreq \$1\""
41
42 i=0
charts.d/example.chart.sh
+9 -9
@@ -22,11 +22,11 @@ example_check() {
22 example_create() {
23 # create the chart with 3 dimensions
24 cat <<EOF
25 -CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked $[example_priority] $example_update_every
25 +CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked $((example_priority)) $example_update_every
26 DIMENSION random1 '' percentage-of-absolute-row 1 1
27 DIMENSION random2 '' percentage-of-absolute-row 1 1
28 DIMENSION random3 '' percentage-of-absolute-row 1 1
29 -CHART example.random2 '' "A random number" "random number" random random area $[example_priority + 1] $example_update_every
29 +CHART example.random2 '' "A random number" "random number" random random area $((example_priority + 1)) $example_update_every
30 DIMENSION random '' absolute 1 1
31 EOF
32
@@ -49,19 +49,19 @@ example_update() {
49 value1=$RANDOM
50 value2=$RANDOM
51 value3=$RANDOM
52 - value4=$[8192 + (RANDOM * 16383 / 32767) ]
52 + value4=$((8192 + (RANDOM * 16383 / 32767) ))
53
54 if [ $example_count -gt 0 ]
55 then
56 - example_count=$[example_count - 1]
56 + example_count=$((example_count - 1))
57
58 - [ $example_last -gt 16383 ] && value4=$[example_last + (RANDOM * ( (32767 - example_last) / 2) / 32767)]
59 - [ $example_last -le 16383 ] && value4=$[example_last - (RANDOM * (example_last / 2) / 32767)]
58 + [ $example_last -gt 16383 ] && value4=$((example_last + (RANDOM * ( (32767 - example_last) / 2) / 32767)))
59 + [ $example_last -le 16383 ] && value4=$((example_last - (RANDOM * (example_last / 2) / 32767)))
60 else
61 - example_count=$[1 + (RANDOM * 5 / 32767) ]
61 + example_count=$((1 + (RANDOM * 5 / 32767) ))
62
63 - [ $example_last -gt 16383 -a $value4 -gt 16383 ] && value4=$[value4 - 16383]
64 - [ $example_last -le 16383 -a $value4 -lt 16383 ] && value4=$[value4 + 16383]
63 + [ $example_last -gt 16383 -a $value4 -gt 16383 ] && value4=$((value4 - 16383))
64 + [ $example_last -le 16383 -a $value4 -lt 16383 ] && value4=$((value4 + 16383))
65 fi
66 example_last=$value4
67
charts.d/load_average.chart.sh
+1 -1
@@ -28,7 +28,7 @@ load_average_check() {
28 load_average_create() {
29 # create a chart with 3 dimensions
30 cat <<EOF
31 -CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
31 +CHART system.load '' "System Load Average" "load" load system.load line $((load_priority + 1)) $load_average_update_every
32 DIMENSION load1 '1 min' absolute 1 100
33 DIMENSION load5 '5 mins' absolute 1 100
34 DIMENSION load15 '15 mins' absolute 1 100
charts.d/mysql.chart.sh
+21 -21
@@ -187,16 +187,16 @@ mysql_create() {
187 for x in "${mysql_ids[@]}"
188 do
189 cat <<EOF
190 -CHART mysql_$x.net '' "mysql Bandwidth" "kilobits/s" bandwidth mysql.net area $[mysql_priority + 1] $mysql_update_every
190 +CHART mysql_$x.net '' "mysql Bandwidth" "kilobits/s" bandwidth mysql.net area $((mysql_priority + 1)) $mysql_update_every
191 DIMENSION Bytes_received in incremental 8 1024
192 DIMENSION Bytes_sent out incremental -8 1024
193
194 -CHART mysql_$x.queries '' "mysql Queries" "queries/s" queries mysql.queries line $[mysql_priority + 2] $mysql_update_every
194 +CHART mysql_$x.queries '' "mysql Queries" "queries/s" queries mysql.queries line $((mysql_priority + 2)) $mysql_update_every
195 DIMENSION Queries queries incremental 1 1
196 DIMENSION Questions questions incremental 1 1
197 DIMENSION Slow_queries slow_queries incremental -1 1
198
199 -CHART mysql_$x.handlers '' "mysql Handlers" "handlers/s" handlers mysql.handlers line $[mysql_priority + 3] $mysql_update_every
199 +CHART mysql_$x.handlers '' "mysql Handlers" "handlers/s" handlers mysql.handlers line $((mysql_priority + 3)) $mysql_update_every
200 DIMENSION Handler_commit commit incremental 1 1
201 DIMENSION Handler_delete delete incremental 1 1
202 DIMENSION Handler_prepare prepare incremental 1 1
@@ -212,75 +212,75 @@ DIMENSION Handler_savepoint_rollback savepoint_rollback incremental 1 1
212 DIMENSION Handler_update update incremental 1 1
213 DIMENSION Handler_write write incremental 1 1
214
215 -CHART mysql_$x.table_locks '' "mysql Tables Locks" "locks/s" locks mysql.table_locks line $[mysql_priority + 4] $mysql_update_every
215 +CHART mysql_$x.table_locks '' "mysql Tables Locks" "locks/s" locks mysql.table_locks line $((mysql_priority + 4)) $mysql_update_every
216 DIMENSION Table_locks_immediate immediate incremental 1 1
217 DIMENSION Table_locks_waited waited incremental -1 1
218
219 -CHART mysql_$x.join_issues '' "mysql Select Join Issues" "joins/s" issues mysql.join_issues line $[mysql_priority + 5] $mysql_update_every
219 +CHART mysql_$x.join_issues '' "mysql Select Join Issues" "joins/s" issues mysql.join_issues line $((mysql_priority + 5)) $mysql_update_every
220 DIMENSION Select_full_join full_join incremental 1 1
221 DIMENSION Select_full_range_join full_range_join incremental 1 1
222 DIMENSION Select_range range incremental 1 1
223 DIMENSION Select_range_check range_check incremental 1 1
224 DIMENSION Select_scan scan incremental 1 1
225
226 -CHART mysql_$x.sort_issues '' "mysql Sort Issues" "issues/s" issues mysql.sort.issues line $[mysql_priority + 6] $mysql_update_every
226 +CHART mysql_$x.sort_issues '' "mysql Sort Issues" "issues/s" issues mysql.sort.issues line $((mysql_priority + 6)) $mysql_update_every
227 DIMENSION Sort_merge_passes merge_passes incremental 1 1
228 DIMENSION Sort_range range incremental 1 1
229 DIMENSION Sort_scan scan incremental 1 1
230
231 -CHART mysql_$x.tmp '' "mysql Tmp Operations" "counter" temporaries mysql.tmp line $[mysql_priority + 7] $mysql_update_every
231 +CHART mysql_$x.tmp '' "mysql Tmp Operations" "counter" temporaries mysql.tmp line $((mysql_priority + 7)) $mysql_update_every
232 DIMENSION Created_tmp_disk_tables disk_tables incremental 1 1
233 DIMENSION Created_tmp_files files incremental 1 1
234 DIMENSION Created_tmp_tables tables incremental 1 1
235
236 -CHART mysql_$x.connections '' "mysql Connections" "connections/s" connections mysql.connections line $[mysql_priority + 8] $mysql_update_every
236 +CHART mysql_$x.connections '' "mysql Connections" "connections/s" connections mysql.connections line $((mysql_priority + 8)) $mysql_update_every
237 DIMENSION Connections all incremental 1 1
238 DIMENSION Aborted_connects aborded incremental 1 1
239
240 -CHART mysql_$x.binlog_cache '' "mysql Binlog Cache" "transactions/s" binlog mysql.binlog_cache line $[mysql_priority + 9] $mysql_update_every
240 +CHART mysql_$x.binlog_cache '' "mysql Binlog Cache" "transactions/s" binlog mysql.binlog_cache line $((mysql_priority + 9)) $mysql_update_every
241 DIMENSION Binlog_cache_disk_use disk incremental 1 1
242 DIMENSION Binlog_cache_use all incremental 1 1
243
244 -CHART mysql_$x.threads '' "mysql Threads" "threads" threads mysql.threads line $[mysql_priority + 10] $mysql_update_every
244 +CHART mysql_$x.threads '' "mysql Threads" "threads" threads mysql.threads line $((mysql_priority + 10)) $mysql_update_every
245 DIMENSION Threads_connected connected absolute 1 1
246 DIMENSION Threads_created created incremental 1 1
247 DIMENSION Threads_cached cached absolute -1 1
248 DIMENSION Threads_running running absolute 1 1
249
250 -CHART mysql_$x.thread_cache_misses '' "mysql Threads Cache Misses" "misses" threads mysql.thread_cache_misses area $[mysql_priority + 11] $mysql_update_every
250 +CHART mysql_$x.thread_cache_misses '' "mysql Threads Cache Misses" "misses" threads mysql.thread_cache_misses area $((mysql_priority + 11)) $mysql_update_every
251 DIMENSION misses misses absolute 1 100
252
253 -CHART mysql_$x.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" innodb mysql.innodb_io area $[mysql_priority + 12] $mysql_update_every
253 +CHART mysql_$x.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" innodb mysql.innodb_io area $((mysql_priority + 12)) $mysql_update_every
254 DIMENSION Innodb_data_read read incremental 1 1024
255 DIMENSION Innodb_data_written write incremental -1 1024
256
257 -CHART mysql_$x.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" innodb mysql.innodb_io_ops line $[mysql_priority + 13] $mysql_update_every
257 +CHART mysql_$x.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" innodb mysql.innodb_io_ops line $((mysql_priority + 13)) $mysql_update_every
258 DIMENSION Innodb_data_reads reads incremental 1 1
259 DIMENSION Innodb_data_writes writes incremental -1 1
260 DIMENSION Innodb_data_fsyncs fsyncs incremental 1 1
261
262 -CHART mysql_$x.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" innodb mysql.innodb_io_pending_ops line $[mysql_priority + 14] $mysql_update_every
262 +CHART mysql_$x.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" innodb mysql.innodb_io_pending_ops line $((mysql_priority + 14)) $mysql_update_every
263 DIMENSION Innodb_data_pending_reads reads absolute 1 1
264 DIMENSION Innodb_data_pending_writes writes absolute -1 1
265 DIMENSION Innodb_data_pending_fsyncs fsyncs absolute 1 1
266
267 -CHART mysql_$x.innodb_log '' "mysql InnoDB Log Operations" "operations/s" innodb mysql.innodb_log line $[mysql_priority + 15] $mysql_update_every
267 +CHART mysql_$x.innodb_log '' "mysql InnoDB Log Operations" "operations/s" innodb mysql.innodb_log line $((mysql_priority + 15)) $mysql_update_every
268 DIMENSION Innodb_log_waits waits incremental 1 1
269 DIMENSION Innodb_log_write_requests write_requests incremental -1 1
270 DIMENSION Innodb_log_writes writes incremental -1 1
271
272 -CHART mysql_$x.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" innodb mysql.innodb_os_log line $[mysql_priority + 16] $mysql_update_every
272 +CHART mysql_$x.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" innodb mysql.innodb_os_log line $((mysql_priority + 16)) $mysql_update_every
273 DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 1
274 DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs absolute 1 1
275 DIMENSION Innodb_os_log_pending_writes pending_writes absolute -1 1
276
277 -CHART mysql_$x.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" innodb mysql.innodb_os_log_io area $[mysql_priority + 17] $mysql_update_every
277 +CHART mysql_$x.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" innodb mysql.innodb_os_log_io area $((mysql_priority + 17)) $mysql_update_every
278 DIMENSION Innodb_os_log_written write incremental -1 1024
279
280 -CHART mysql_$x.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" innodb mysql.innodb_cur_row_lock area $[mysql_priority + 18] $mysql_update_every
280 +CHART mysql_$x.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" innodb mysql.innodb_cur_row_lock area $((mysql_priority + 18)) $mysql_update_every
281 DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 1
282
283 -CHART mysql_$x.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" innodb mysql.innodb_rows area $[mysql_priority + 19] $mysql_update_every
283 +CHART mysql_$x.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" innodb mysql.innodb_rows area $((mysql_priority + 19)) $mysql_update_every
284 DIMENSION Innodb_rows_read read incremental 1 1
285 DIMENSION Innodb_rows_deleted deleted incremental -1 1
286 DIMENSION Innodb_rows_inserted inserted incremental 1 1
@@ -291,7 +291,7 @@ EOF
291 if [ ! -z "$mysql_Binlog_stmt_cache_disk_use" ]
292 then
293 cat <<EOF
294 -CHART mysql_$x.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" binlog mysql.binlog_stmt_cache line $[mysql_priority + 20] $mysql_update_every
294 +CHART mysql_$x.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" binlog mysql.binlog_stmt_cache line $((mysql_priority + 20)) $mysql_update_every
295 DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 1
296 DIMENSION Binlog_stmt_cache_use all incremental 1 1
297 EOF
@@ -300,7 +300,7 @@ EOF
300 if [ ! -z "$mysql_Connection_errors_accept" ]
301 then
302 cat <<EOF
303 -CHART mysql_$x.connection_errors '' "mysql Connection Errors" "connections/s" connections mysql.connection_errors line $[mysql_priority + 21] $mysql_update_every
303 +CHART mysql_$x.connection_errors '' "mysql Connection Errors" "connections/s" connections mysql.connection_errors line $((mysql_priority + 21)) $mysql_update_every
304 DIMENSION Connection_errors_accept accept incremental 1 1
305 DIMENSION Connection_errors_internal internal incremental 1 1
306 DIMENSION Connection_errors_max_connections max incremental 1 1
charts.d/nginx.chart.sh
+11 -11
@@ -81,18 +81,18 @@ nginx_check() {
81 # _create is called once, to create the charts
82 nginx_create() {
83 cat <<EOF
84 -CHART nginx.connections '' "nginx Active Connections" "connections" nginx nginx.connections line $[nginx_priority + 1] $nginx_update_every
84 +CHART nginx.connections '' "nginx Active Connections" "connections" nginx nginx.connections line $((nginx_priority + 1)) $nginx_update_every
85 DIMENSION active '' absolute 1 1
86
87 -CHART nginx.requests '' "nginx Requests" "requests/s" nginx nginx.requests line $[nginx_priority + 2] $nginx_update_every
87 +CHART nginx.requests '' "nginx Requests" "requests/s" nginx nginx.requests line $((nginx_priority + 2)) $nginx_update_every
88 DIMENSION requests '' incremental 1 1
89
90 -CHART nginx.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx.connections.status line $[nginx_priority + 3] $nginx_update_every
90 +CHART nginx.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx.connections.status line $((nginx_priority + 3)) $nginx_update_every
91 DIMENSION reading '' absolute 1 1
92 DIMENSION writing '' absolute 1 1
93 DIMENSION waiting idle absolute 1 1
94
95 -CHART nginx.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx.connections.rate line $[nginx_priority + 4] $nginx_update_every
95 +CHART nginx.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx.connections.rate line $((nginx_priority + 4)) $nginx_update_every
96 DIMENSION accepts accepted incremental 1 1
97 DIMENSION handled '' incremental 1 1
98 EOF
@@ -114,19 +114,19 @@ nginx_update() {
114 # write the result of the work.
115 cat <<VALUESEOF
116 BEGIN nginx.connections $1
117 -SET active = $[nginx_active_connections]
117 +SET active = $((nginx_active_connections))
118 END
119 BEGIN nginx.requests $1
120 -SET requests = $[nginx_requests]
120 +SET requests = $((nginx_requests))
121 END
122 BEGIN nginx.connections_status $1
123 -SET reading = $[nginx_reading]
124 -SET writing = $[nginx_writing]
125 -SET waiting = $[nginx_waiting]
123 +SET reading = $((nginx_reading))
124 +SET writing = $((nginx_writing))
125 +SET waiting = $((nginx_waiting))
126 END
127 BEGIN nginx.connect_rate $1
128 -SET accepts = $[nginx_accepts]
129 -SET handled = $[nginx_handled]
128 +SET accepts = $((nginx_accepts))
129 +SET handled = $((nginx_handled))
130 END
131 VALUESEOF
132
charts.d/nut.chart.sh
+8 -8
@@ -61,34 +61,34 @@ nut_create() {
61 for x in "${nut_ids[@]}"
62 do
63 cat <<EOF
64 -CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $[nut_priority + 1] $nut_update_every
64 +CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $((nut_priority + 1)) $nut_update_every
65 DIMENSION battery_charge charge absolute 1 100
66
67 -CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups nut.battery.voltage line $[nut_priority + 2] $nut_update_every
67 +CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups nut.battery.voltage line $((nut_priority + 2)) $nut_update_every
68 DIMENSION battery_voltage voltage absolute 1 100
69 DIMENSION battery_voltage_high high absolute 1 100
70 DIMENSION battery_voltage_low low absolute 1 100
71 DIMENSION battery_voltage_nominal nominal absolute 1 100
72
73 -CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" input nut.input.voltage line $[nut_priority + 3] $nut_update_every
73 +CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" input nut.input.voltage line $((nut_priority + 3)) $nut_update_every
74 DIMENSION input_voltage voltage absolute 1 100
75 DIMENSION input_voltage_fault fault absolute 1 100
76 DIMENSION input_voltage_nominal nominal absolute 1 100
77
78 -CHART nut_$x.input_current '' "UPS Input Current" "Ampere" input nut.input.current line $[nut_priority + 4] $nut_update_every
78 +CHART nut_$x.input_current '' "UPS Input Current" "Ampere" input nut.input.current line $((nut_priority + 4)) $nut_update_every
79 DIMENSION input_current_nominal nominal absolute 1 100
80
81 -CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" input nut.input.frequency line $[nut_priority + 5] $nut_update_every
81 +CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" input nut.input.frequency line $((nut_priority + 5)) $nut_update_every
82 DIMENSION input_frequency frequency absolute 1 100
83 DIMENSION input_frequency_nominal nominal absolute 1 100
84
85 -CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" output nut.output.voltage line $[nut_priority + 6] $nut_update_every
85 +CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" output nut.output.voltage line $((nut_priority + 6)) $nut_update_every
86 DIMENSION output_voltage voltage absolute 1 100
87
88 -CHART nut_$x.load '' "UPS Load" "percentage" ups nut.load area $[nut_priority] $nut_update_every
88 +CHART nut_$x.load '' "UPS Load" "percentage" ups nut.load area $((nut_priority)) $nut_update_every
89 DIMENSION load load absolute 1 100
90
91 -CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $[nut_priority + 7] $nut_update_every
91 +CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $((nut_priority + 7)) $nut_update_every
92 DIMENSION temp temp absolute 1 100
93 EOF
94 done
charts.d/opensips.chart.sh
+19 -19
@@ -45,61 +45,61 @@ opensips_check() {
45 opensips_create() {
46 # create the charts
47 cat <<EOF
48 -CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" dialogs '' area $[opensips_priority + 1] $opensips_update_every
48 +CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" dialogs '' area $((opensips_priority + 1)) $opensips_update_every
49 DIMENSION dialog_active_dialogs active absolute 1 1
50 DIMENSION dialog_early_dialogs early absolute -1 1
51
52 -CHART opensips.users '' "OpenSIPS Users" "users" users '' line $[opensips_priority + 2] $opensips_update_every
52 +CHART opensips.users '' "OpenSIPS Users" "users" users '' line $((opensips_priority + 2)) $opensips_update_every
53 DIMENSION usrloc_registered_users registered absolute 1 1
54 DIMENSION usrloc_location_users location absolute 1 1
55 DIMENSION usrloc_location_contacts contacts absolute 1 1
56 DIMENSION usrloc_location_expires expires incremental -1 1
57
58 -CHART opensips.registrar '' "OpenSIPS Registrar" "registrations/s" registrar '' line $[opensips_priority + 3] $opensips_update_every
58 +CHART opensips.registrar '' "OpenSIPS Registrar" "registrations/s" registrar '' line $((opensips_priority + 3)) $opensips_update_every
59 DIMENSION registrar_accepted_regs accepted incremental 1 1
60 DIMENSION registrar_rejected_regs rejected incremental -1 1
61
62 -CHART opensips.transactions '' "OpenSIPS Transactions" "transactions/s" transactions '' line $[opensips_priority + 4] $opensips_update_every
62 +CHART opensips.transactions '' "OpenSIPS Transactions" "transactions/s" transactions '' line $((opensips_priority + 4)) $opensips_update_every
63 DIMENSION tm_UAS_transactions UAS incremental 1 1
64 DIMENSION tm_UAC_transactions UAC incremental -1 1
65
66 -CHART opensips.core_rcv '' "OpenSIPS Core Receives" "queries/s" core '' line $[opensips_priority + 5] $opensips_update_every
66 +CHART opensips.core_rcv '' "OpenSIPS Core Receives" "queries/s" core '' line $((opensips_priority + 5)) $opensips_update_every
67 DIMENSION core_rcv_requests requests incremental 1 1
68 DIMENSION core_rcv_replies replies incremental -1 1
69
70 -CHART opensips.core_fwd '' "OpenSIPS Core Forwards" "queries/s" core '' line $[opensips_priority + 6] $opensips_update_every
70 +CHART opensips.core_fwd '' "OpenSIPS Core Forwards" "queries/s" core '' line $((opensips_priority + 6)) $opensips_update_every
71 DIMENSION core_fwd_requests requests incremental 1 1
72 DIMENSION core_fwd_replies replies incremental -1 1
73
74 -CHART opensips.core_drop '' "OpenSIPS Core Drops" "queries/s" core '' line $[opensips_priority + 7] $opensips_update_every
74 +CHART opensips.core_drop '' "OpenSIPS Core Drops" "queries/s" core '' line $((opensips_priority + 7)) $opensips_update_every
75 DIMENSION core_drop_requests requests incremental 1 1
76 DIMENSION core_drop_replies replies incremental -1 1
77
78 -CHART opensips.core_err '' "OpenSIPS Core Errors" "queries/s" core '' line $[opensips_priority + 8] $opensips_update_every
78 +CHART opensips.core_err '' "OpenSIPS Core Errors" "queries/s" core '' line $((opensips_priority + 8)) $opensips_update_every
79 DIMENSION core_err_requests requests incremental 1 1
80 DIMENSION core_err_replies replies incremental -1 1
81
82 -CHART opensips.core_bad '' "OpenSIPS Core Bad" "queries/s" core '' line $[opensips_priority + 9] $opensips_update_every
82 +CHART opensips.core_bad '' "OpenSIPS Core Bad" "queries/s" core '' line $((opensips_priority + 9)) $opensips_update_every
83 DIMENSION core_bad_URIs_rcvd bad_URIs_rcvd incremental 1 1
84 DIMENSION core_unsupported_methods unsupported_methods incremental 1 1
85 DIMENSION core_bad_msg_hdr bad_msg_hdr incremental 1 1
86
87 -CHART opensips.tm_replies '' "OpenSIPS TM Replies" "replies/s" transactions '' line $[opensips_priority + 10] $opensips_update_every
87 +CHART opensips.tm_replies '' "OpenSIPS TM Replies" "replies/s" transactions '' line $((opensips_priority + 10)) $opensips_update_every
88 DIMENSION tm_received_replies received incremental 1 1
89 DIMENSION tm_relayed_replies relayed incremental 1 1
90 DIMENSION tm_local_replies local incremental 1 1
91
92 -CHART opensips.transactions_status '' "OpenSIPS Transactions Status" "transactions/s" transactions '' line $[opensips_priority + 11] $opensips_update_every
92 +CHART opensips.transactions_status '' "OpenSIPS Transactions Status" "transactions/s" transactions '' line $((opensips_priority + 11)) $opensips_update_every
93 DIMENSION tm_2xx_transactions 2xx incremental 1 1
94 DIMENSION tm_3xx_transactions 3xx incremental 1 1
95 DIMENSION tm_4xx_transactions 4xx incremental 1 1
96 DIMENSION tm_5xx_transactions 5xx incremental 1 1
97 DIMENSION tm_6xx_transactions 6xx incremental 1 1
98
99 -CHART opensips.transactions_inuse '' "OpenSIPS InUse Transactions" "transactions" transactions '' line $[opensips_priority + 12] $opensips_update_every
99 +CHART opensips.transactions_inuse '' "OpenSIPS InUse Transactions" "transactions" transactions '' line $((opensips_priority + 12)) $opensips_update_every
100 DIMENSION tm_inuse_transactions inuse absolute 1 1
101
102 -CHART opensips.sl_replies '' "OpenSIPS SL Replies" "replies/s" core '' line $[opensips_priority + 13] $opensips_update_every
102 +CHART opensips.sl_replies '' "OpenSIPS SL Replies" "replies/s" core '' line $((opensips_priority + 13)) $opensips_update_every
103 DIMENSION sl_1xx_replies 1xx incremental 1 1
104 DIMENSION sl_2xx_replies 2xx incremental 1 1
105 DIMENSION sl_3xx_replies 3xx incremental 1 1
@@ -110,31 +110,31 @@ DIMENSION sl_sent_replies sent incremental 1 1
110 DIMENSION sl_sent_err_replies error incremental 1 1
111 DIMENSION sl_received_ACKs ACKed incremental 1 1
112
113 -CHART opensips.dialogs '' "OpenSIPS Dialogs" "dialogs/s" dialogs '' line $[opensips_priority + 14] $opensips_update_every
113 +CHART opensips.dialogs '' "OpenSIPS Dialogs" "dialogs/s" dialogs '' line $((opensips_priority + 14)) $opensips_update_every
114 DIMENSION dialog_processed_dialogs processed incremental 1 1
115 DIMENSION dialog_expired_dialogs expired incremental 1 1
116 DIMENSION dialog_failed_dialogs failed incremental -1 1
117
118 -CHART opensips.net_waiting '' "OpenSIPS Network Waiting" "kilobytes" net '' line $[opensips_priority + 15] $opensips_update_every
118 +CHART opensips.net_waiting '' "OpenSIPS Network Waiting" "kilobytes" net '' line $((opensips_priority + 15)) $opensips_update_every
119 DIMENSION net_waiting_udp UDP absolute 1 1024
120 DIMENSION net_waiting_tcp TCP absolute 1 1024
121
122 -CHART opensips.uri_checks '' "OpenSIPS URI Checks" "checks / sec" uri '' line $[opensips_priority + 16] $opensips_update_every
122 +CHART opensips.uri_checks '' "OpenSIPS URI Checks" "checks / sec" uri '' line $((opensips_priority + 16)) $opensips_update_every
123 DIMENSION uri_positive_checks positive incremental 1 1
124 DIMENSION uri_negative_checks negative incremental -1 1
125
126 -CHART opensips.traces '' "OpenSIPS Traces" "traces / sec" traces '' line $[opensips_priority + 17] $opensips_update_every
126 +CHART opensips.traces '' "OpenSIPS Traces" "traces / sec" traces '' line $((opensips_priority + 17)) $opensips_update_every
127 DIMENSION siptrace_traced_requests requests incremental 1 1
128 DIMENSION siptrace_traced_replies replies incremental -1 1
129
130 -CHART opensips.shmem '' "OpenSIPS Shared Memory" "kilobytes" mem '' line $[opensips_priority + 18] $opensips_update_every
130 +CHART opensips.shmem '' "OpenSIPS Shared Memory" "kilobytes" mem '' line $((opensips_priority + 18)) $opensips_update_every
131 DIMENSION shmem_total_size total absolute 1 1024
132 DIMENSION shmem_used_size used absolute 1 1024
133 DIMENSION shmem_real_used_size real_used absolute 1 1024
134 DIMENSION shmem_max_used_size max_used absolute 1 1024
135 DIMENSION shmem_free_size free absolute 1 1024
136
137 -CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragments" mem '' line $[opensips_priority + 19] $opensips_update_every
137 +CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragments" mem '' line $((opensips_priority + 19)) $opensips_update_every
138 DIMENSION shmem_fragments fragments absolute 1 1
139 EOF
140
charts.d/phpfpm.chart.sh
+9 -9
@@ -120,15 +120,15 @@ phpfpm_create() {
120 for m in "${!phpfpm_urls[@]}"
121 do
122 cat <<EOF
123 -CHART phpfpm_$m.connections '' "PHP-FPM Active Connections" "connections" phpfpm phpfpm.connections line $[phpfpm_priority + 1] $phpfpm_update_every
123 +CHART phpfpm_$m.connections '' "PHP-FPM Active Connections" "connections" phpfpm phpfpm.connections line $((phpfpm_priority + 1)) $phpfpm_update_every
124 DIMENSION active '' absolute 1 1
125 DIMENSION maxActive 'max active' absolute 1 1
126 DIMENSION idle '' absolute 1 1
127
128 -CHART phpfpm_$m.requests '' "PHP-FPM Requests" "requests/s" phpfpm phpfpm.requests line $[phpfpm_priority + 2] $phpfpm_update_every
128 +CHART phpfpm_$m.requests '' "PHP-FPM Requests" "requests/s" phpfpm phpfpm.requests line $((phpfpm_priority + 2)) $phpfpm_update_every
129 DIMENSION requests '' incremental 1 1
130
131 -CHART phpfpm_$m.performance '' "PHP-FPM Performance" "status" phpfpm phpfpm.performance line $[phpfpm_priority + 3] $phpfpm_update_every
131 +CHART phpfpm_$m.performance '' "PHP-FPM Performance" "status" phpfpm phpfpm.performance line $((phpfpm_priority + 3)) $phpfpm_update_every
132 DIMENSION reached 'max children reached' absolute 1 1
133 DIMENSION slow 'slow requests' absolute 1 1
134 EOF
@@ -157,16 +157,16 @@ phpfpm_update() {
157 # write the result of the work.
158 cat <<EOF
159 BEGIN phpfpm_$m.connections $1
160 -SET active = $[phpfpm_active_processes]
161 -SET maxActive = $[phpfpm_max_active_processes]
162 -SET idle = $[phpfpm_idle_processes]
160 +SET active = $((phpfpm_active_processes))
161 +SET maxActive = $((phpfpm_max_active_processes))
162 +SET idle = $((phpfpm_idle_processes))
163 END
164 BEGIN phpfpm_$m.requests $1
165 -SET requests = $[phpfpm_accepted_conn]
165 +SET requests = $((phpfpm_accepted_conn))
166 END
167 BEGIN phpfpm_$m.performance $1
168 -SET reached = $[phpfpm_max_children_reached]
169 -SET slow = $[phpfpm_slow_requests]
168 +SET reached = $((phpfpm_max_children_reached))
169 +SET slow = $((phpfpm_slow_requests))
170 END
171 EOF
172 done
charts.d/postfix.chart.sh
+2 -2
@@ -43,9 +43,9 @@ postfix_check() {
43
44 postfix_create() {
45 cat <<EOF
46 -CHART postfix.qemails '' "Postfix Queue Emails" "emails" queue postfix.queued.emails line $[postfix_priority + 1] $postfix_update_every
46 +CHART postfix.qemails '' "Postfix Queue Emails" "emails" queue postfix.queued.emails line $((postfix_priority + 1)) $postfix_update_every
47 DIMENSION emails '' absolute 1 1
48 -CHART postfix.qsize '' "Postfix Queue Emails Size" "emails size in KB" queue postfix.queued.size area $[postfix_priority + 2] $postfix_update_every
48 +CHART postfix.qsize '' "Postfix Queue Emails Size" "emails size in KB" queue postfix.queued.size area $((postfix_priority + 2)) $postfix_update_every
49 DIMENSION size '' absolute 1 1
50 EOF
51
charts.d/sensors.chart.sh
+7 -7
@@ -129,7 +129,7 @@ sensors_create() {
129 files="$( sensors_check_files $files )"
130 files="$( sensors_check_temp_type $files )"
131 [ -z "$files" ] && continue
132 - echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $[sensors_priority + 1] $sensors_update_every"
132 + echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every"
133 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.temp_$id \$1\""
134 divisor=1000
135 ;;
@@ -138,7 +138,7 @@ sensors_create() {
138 files="$( ls $path/in*_input 2>/dev/null )"
139 files="$( sensors_check_files $files )"
140 [ -z "$files" ] && continue
141 - echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $[sensors_priority + 2] $sensors_update_every"
141 + echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every"
142 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.volt_$id \$1\""
143 divisor=1000
144 ;;
@@ -147,7 +147,7 @@ sensors_create() {
147 files="$( ls $path/curr*_input 2>/dev/null )"
148 files="$( sensors_check_files $files )"
149 [ -z "$files" ] && continue
150 - echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $[sensors_priority + 3] $sensors_update_every"
150 + echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every"
151 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.curr_$id \$1\""
152 divisor=1000
153 ;;
@@ -156,7 +156,7 @@ sensors_create() {
156 files="$( ls $path/power*_input 2>/dev/null )"
157 files="$( sensors_check_files $files )"
158 [ -z "$files" ] && continue
159 - echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $[sensors_priority + 4] $sensors_update_every"
159 + echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every"
160 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.power_$id \$1\""
161 divisor=1000000
162 ;;
@@ -165,7 +165,7 @@ sensors_create() {
165 files="$( ls $path/fan*_input 2>/dev/null )"
166 files="$( sensors_check_files $files )"
167 [ -z "$files" ] && continue
168 - echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $[sensors_priority + 5] $sensors_update_every"
168 + echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every"
169 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.fan_$id \$1\""
170 ;;
171
@@ -173,7 +173,7 @@ sensors_create() {
173 files="$( ls $path/energy*_input 2>/dev/null )"
174 files="$( sensors_check_files $files )"
175 [ -z "$files" ] && continue
176 - echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $[sensors_priority + 6] $sensors_update_every"
176 + echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every"
177 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.energy_$id \$1\""
178 algorithm="incremental"
179 divisor=1000000
@@ -183,7 +183,7 @@ sensors_create() {
183 files="$( ls $path/humidity*_input 2>/dev/null )"
184 files="$( sensors_check_files $files )"
185 [ -z "$files" ] && continue
186 - echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $[sensors_priority + 7] $sensors_update_every"
186 + echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every"
187 echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.humidity_$id \$1\""
188 divisor=1000
189 ;;
charts.d/squid.chart.sh
+4 -4
@@ -63,21 +63,21 @@ squid_check() {
63 squid_create() {
64 # create the charts
65 cat <<EOF
66 -CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" clients squid.clients.net area $[squid_priority + 1] $squid_update_every
66 +CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" clients squid.clients.net area $((squid_priority + 1)) $squid_update_every
67 DIMENSION client_http_kbytes_in in incremental 8 1
68 DIMENSION client_http_kbytes_out out incremental -8 1
69 DIMENSION client_http_hit_kbytes_out hits incremental -8 1
70
71 -CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" clients squid.clients.requests line $[squid_priority + 3] $squid_update_every
71 +CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" clients squid.clients.requests line $((squid_priority + 3)) $squid_update_every
72 DIMENSION client_http_requests requests incremental 1 1
73 DIMENSION client_http_hits hits incremental 1 1
74 DIMENSION client_http_errors errors incremental -1 1
75
76 -CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" servers squid.servers.net area $[squid_priority + 2] $squid_update_every
76 +CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" servers squid.servers.net area $((squid_priority + 2)) $squid_update_every
77 DIMENSION server_all_kbytes_in in incremental 8 1
78 DIMENSION server_all_kbytes_out out incremental -8 1
79
80 -CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" servers squid.servers.requests line $[squid_priority + 4] $squid_update_every
80 +CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" servers squid.servers.requests line $((squid_priority + 4)) $squid_update_every
81 DIMENSION server_all_requests requests incremental 1 1
82 DIMENSION server_all_errors errors incremental -1 1
83 EOF
charts.d/tomcat.chart.sh
+9 -9
@@ -61,14 +61,14 @@ tomcat_get() {
61 # _create is called once, to create the charts
62 tomcat_create() {
63 cat <<EOF
64 -CHART tomcat.accesses '' "tomcat requests" "requests/s" statistics tomcat.accesses area $[tomcat_priority + 8] $tomcat_update_every
64 +CHART tomcat.accesses '' "tomcat requests" "requests/s" statistics tomcat.accesses area $((tomcat_priority + 8)) $tomcat_update_every
65 DIMENSION accesses '' incremental
66 -CHART tomcat.volume '' "tomcat volume" "KB/s" volume tomcat.volume area $[tomcat_priority + 5] $tomcat_update_every
66 +CHART tomcat.volume '' "tomcat volume" "KB/s" volume tomcat.volume area $((tomcat_priority + 5)) $tomcat_update_every
67 DIMENSION volume '' incremental divisor ${tomcat_decimal_KB_detail}
68 -CHART tomcat.threads '' "tomcat threads" "current threads" statistics tomcat.threads line $[tomcat_priority + 6] $tomcat_update_every
68 +CHART tomcat.threads '' "tomcat threads" "current threads" statistics tomcat.threads line $((tomcat_priority + 6)) $tomcat_update_every
69 DIMENSION current '' absolute 1
70 DIMENSION busy '' absolute 1
71 -CHART tomcat.jvm '' "JVM Free Memory" "MB" statistics tomcat.jvm area $[tomcat_priority + 8] $tomcat_update_every
71 +CHART tomcat.jvm '' "JVM Free Memory" "MB" statistics tomcat.jvm area $((tomcat_priority + 8)) $tomcat_update_every
72 DIMENSION jvm '' absolute 1 ${tomcat_decimal_detail}
73 EOF
74 return 0
@@ -89,17 +89,17 @@ tomcat_update() {
89 # write the result of the work.
90 cat <<VALUESEOF
91 BEGIN tomcat.accesses $1
92 -SET accesses = $[tomcat_accesses]
92 +SET accesses = $((tomcat_accesses))
93 END
94 BEGIN tomcat.volume $1
95 -SET volume = $[tomcat_volume]
95 +SET volume = $((tomcat_volume))
96 END
97 BEGIN tomcat.threads $1
98 -SET current = $[tomcat_threads]
99 -SET busy = $[tomcat_threads_busy]
98 +SET current = $((tomcat_threads))
99 +SET busy = $((tomcat_threads_busy))
100 END
101 BEGIN tomcat.jvm $1
102 -SET jvm = $[tomcat_jvm_freememory]
102 +SET jvm = $((tomcat_jvm_freememory))
103 END
104 VALUESEOF
105
tests/stress.sh
+14 -14
@@ -17,10 +17,10 @@ if [ "${#charts[@]}" -eq 0 ]
17 fi
18
19 update_every="$(curl "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)"
20 -[ $[ update_every + 1 - 1] -eq 0 ] && update_every=1
20 +[ $(( update_every + 1 - 1)) -eq 0 ] && update_every=1
21
22 entries="$(curl "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)"
23 -[ $[ entries + 1 - 1] -eq 0 ] && entries=3600
23 +[ $(( entries + 1 - 1)) -eq 0 ] && entries=3600
24
25 # to compare equal things, set the entries to 3600 max
26 [ $entries -gt 3600 ] && entries=3600
@@ -35,8 +35,8 @@ formats=("jsonp" "json" "ssv" "csv" "datatable" "datasource" "tsv" "ssvcomma" "h
35 options="flip|jsonwrap"
36
37 now=$(date +%s)
38 -first=$[now - (entries * update_every)]
39 -duration=$[now - first]
38 +first=$((now - (entries * update_every)))
39 +duration=$((now - first))
40
41 file="$(mktemp /tmp/netdata-stress-XXXXXXXX)"
42 cleanup() {
@@ -50,22 +50,22 @@ do
50 echo "curl --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >$file
51 for x in {1..100}
52 do
53 - dt=$[RANDOM * duration / 32767]
54 - st=$[RANDOM * duration / 32767]
55 - et=$[ st + dt ]
56 - [ $et -gt $now ] && st=$[ now - dt ]
53 + dt=$((RANDOM * duration / 32767))
54 + st=$((RANDOM * duration / 32767))
55 + et=$(( st + dt ))
56 + [ $et -gt $now ] && st=$(( now - dt ))
57
58 - points=$[RANDOM * 2000 / 32767 + 2]
59 - st=$[first + st]
60 - et=$[first + et]
58 + points=$((RANDOM * 2000 / 32767 + 2))
59 + st=$((first + st))
60 + et=$((first + et))
61
62 - mode=$[RANDOM * ${#modes[@]} / 32767]
62 + mode=$((RANDOM * ${#modes[@]} / 32767))
63 mode="${modes[$mode]}"
64
65 - chart=$[RANDOM * ${#charts[@]} / 32767]
65 + chart=$((RANDOM * ${#charts[@]} / 32767))
66 chart="${charts[$chart]}"
67
68 - format=$[RANDOM * ${#formats[@]} / 32767]
68 + format=$((RANDOM * ${#formats[@]} / 32767))
69 format="${formats[$format]}"
70
71 echo "--url \"$host/api/v1/data?chart=$chart&mode=$mode&format=$format&options=$options&after=$st&before=$et&points=$points\" \\"