added a new element on all charts: context, which is the template upon the chart is build, changed the meaning of element: family, which now reflects the submenu of the dashboard; changed the priorities of most charts to allow the dashboard have dynamic sorting; added submenus to most categories of the main menu; now the dashboard is completely dynamic (except the top key charts)
Costa Tsaousis (ktsaou) committed
Feb 8, 2016 at 01:22 UTC
7c0ba6a675cbca3a6fa1a0b79a37259ad4b52aee
46 files changed
+1004
-1190
charts.d/ap.chart.sh
+7
-6
@@ -3,6 +3,7 @@
3
# _update_every is a special variable - it holds the number of seconds
4
# between the calls of the _update() function
5
ap_update_every=
6
+ap_priority=6900
7
8
declare -A ap_devs=()
9
@@ -53,25 +54,25 @@ ap_create() {
54
55
# create the chart with 3 dimensions
56
cat <<EOF
56
-CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ${dev} line 15000 $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
59
-CHART ap_bandwidth.${dev} '' "Bandwidth for ${ssid} on ${dev}" "kilobits/s" ${dev} ${dev} area 15001 $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
63
-CHART ap_packets.${dev} '' "Packets for ${ssid} on ${dev}" "packets/s" ${dev} ${dev} line 15002 $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
67
-CHART ap_issues.${dev} '' "Transmit Issues for ${ssid} on ${dev}" "issues/s" ${dev} ${dev} line 15003 $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
71
-CHART ap_signal.${dev} '' "Average Signal for ${ssid} on ${dev}" "dBm" ${dev} ${dev} line 15004 $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
74
-CHART ap_bitrate.${dev} '' "Bitrate for ${ssid} on ${dev}" "Mbps" ${dev} ${dev} line 15005 $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
+10
-8
@@ -7,6 +7,8 @@ apache_url="http://127.0.0.1:80/server-status?auto"
7
# between the calls of the _update() function
8
apache_update_every=
9
10
+apache_priority=60000
11
+
12
# convert apache floating point values
13
# to integer using this multiplier
14
# this only affects precision - the values
@@ -165,27 +167,27 @@ apache_check() {
167
# _create is called once, to create the charts
168
apache_create() {
169
cat <<EOF
168
-CHART apache.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" apache apache area 16008 $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}
170
-CHART apache.workers '' "apache Workers" "workers" apache apache stacked 16005 $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
173
-CHART apache.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" apache apache line 16006 $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}
175
-CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" apache apache area 16007 $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]
177
-CHART apache.requests '' "apache Requests" "requests/s" apache apache line 16001 $apache_update_every
179
+CHART apache.requests '' "apache Requests" "requests/s" requests apache.requests line $[apache_priority + 1] $apache_update_every
180
DIMENSION requests '' incremental 1 1
179
-CHART apache.net '' "apache Bandwidth" "kilobits/s" apache apache area 16003 $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
186
-CHART apache.connections '' "apache Connections" "connections" apache apache line 16002 $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
188
-CHART apache.conns_async '' "apache Async Connections" "connections" apache apache stacked 16004 $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
charts.d/cpu_apps.chart.sh
+2
-2
@@ -29,7 +29,7 @@ cpu_apps_bc_finalze=
29
30
cpu_apps_create() {
31
32
- echo "CHART apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
32
+ echo "CHART chartsd_apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
33
34
local x=
35
for x in $cpu_apps_apps
@@ -48,7 +48,7 @@ cpu_apps_update() {
48
# for each dimension
49
# remember: KEEP IT SIMPLE AND SHORT
50
51
- echo "BEGIN apps.cpu"
51
+ echo "BEGIN chartsd_apps.cpu"
52
ps -o pid,comm -C "$cpu_apps_apps" |\
53
grep -v "COMMAND" |\
54
(
charts.d/cpufreq.chart.sh
+3
-2
@@ -10,6 +10,7 @@ cpufreq_source_update=1
10
# _update_every is a special variable - it holds the number of seconds
11
# between the calls of the _update() function
12
cpufreq_update_every=
13
+cpufreq_priority=10000
14
15
cpufreq_find_all_files() {
16
find $1 -maxdepth $cpufreq_sys_depth -name scaling_cur_freq 2>/dev/null
@@ -35,8 +36,8 @@ cpufreq_create() {
36
# - the highest speed we can achieve -
37
[ $cpufreq_source_update -eq 1 ] && echo >$TMP_DIR/cpufreq.sh "cpufreq_update() {"
38
38
- echo "CHART sensors.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line 7000 $cpufreq_update_every"
39
- echo >>$TMP_DIR/cpufreq.sh "echo \"BEGIN sensors.cpufreq \$1\""
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
43
for file in $( cpufreq_find_all_files $cpufreq_sys_dir | sort -u )
charts.d/example.chart.sh
+4
-2
@@ -7,6 +7,8 @@
7
# between the calls of the _update() function
8
example_update_every=
9
10
+example_priority=150000
11
+
12
# _check is called once, to find out if this chart should be enabled or not
13
example_check() {
14
# this should return:
@@ -20,11 +22,11 @@ example_check() {
22
example_create() {
23
# create the chart with 3 dimensions
24
cat <<EOF
23
-CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked 5000 $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
27
-CHART example.random2 '' "A random number" "random number" random random area 5001 $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
charts.d/load_average.chart.sh
+11
-3
@@ -1,19 +1,27 @@
1
#!/bin/sh
2
3
-load_average_update_every=
3
+load_average_update_every=5
4
+load_priority=100
5
6
load_average_check() {
7
# this should return:
8
# - 0 to enable the chart
9
# - 1 to disable the chart
10
11
+ if [ ${load_average_update_every} -lt 5 ]
12
+ then
13
+ # there is no meaning for shorter than 5 seconds
14
+ # the kernel changes this value every 5 seconds
15
+ load_average_update_every=5
16
+ fi
17
+
18
return 0
19
}
20
21
load_average_create() {
22
# create a chart with 3 dimensions
23
cat <<EOF
16
-CHART example.load '' "System Load Average" "load" load load line 500 $load_average_update_every
24
+CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
25
DIMENSION load1 '1 min' absolute 1 100
26
DIMENSION load5 '5 mins' absolute 1 100
27
DIMENSION load15 '15 mins' absolute 1 100
@@ -37,7 +45,7 @@ load_average_update() {
45
46
# write the result of the work.
47
cat <<VALUESEOF
40
-BEGIN example.load
48
+BEGIN system.load
49
SET load1 = $load1
50
SET load5 = $load5
51
SET load15 = $load15
charts.d/mem_apps.chart.sh
+2
-2
@@ -25,7 +25,7 @@ mem_apps_bc_finalze=
25
26
mem_apps_create() {
27
28
- echo "CHART apps.mem '' 'Apps Memory' MB apps apps stacked 20000 $mem_apps_update_every"
28
+ echo "CHART chartsd_apps.mem '' 'Apps Memory' MB apps apps.mem stacked 20000 $mem_apps_update_every"
29
30
local x=
31
for x in $mem_apps_apps
@@ -44,7 +44,7 @@ mem_apps_update() {
44
# for each dimension
45
# remember: KEEP IT SIMPLE AND SHORT
46
47
- echo "BEGIN apps.mem"
47
+ echo "BEGIN chartsd_apps.mem"
48
ps -o comm,rss -C "$mem_apps_apps" |\
49
grep -v "^COMMAND" |\
50
( sed -e "s/ \+/ /g" -e "s/ /+=/g";
charts.d/mysql.chart.sh
+23
-22
@@ -8,6 +8,7 @@
8
# It requires only the ability to connect to the server.
9
10
mysql_update_every=5
11
+mysql_priority=60000
12
13
declare -A mysql_cmds=() mysql_opts=() mysql_ids=()
14
@@ -163,16 +164,16 @@ mysql_create() {
164
for m in "${mysql_ids[@]}"
165
do
166
cat <<EOF
166
-CHART mysql_$m.bandwidth '' "mysql Bandwidth" "kilobits/s" mysql_$m mysql area 20001 $mysql_update_every
167
+CHART mysql_$m.net '' "mysql Bandwidth" "kilobits/s" bandwidth mysql.net area $[mysql_priority + 1] $mysql_update_every
168
DIMENSION Bytes_received in incremental 8 1024
169
DIMENSION Bytes_sent out incremental -8 1024
170
170
-CHART mysql_$m.queries '' "mysql Queries" "queries/s" mysql_$m mysql line 20002 $mysql_update_every
171
+CHART mysql_$m.queries '' "mysql Queries" "queries/s" queries mysql.queries line $[mysql_priority + 2] $mysql_update_every
172
DIMENSION Queries queries incremental 1 1
173
DIMENSION Questions questions incremental 1 1
174
DIMENSION Slow_queries slow_queries incremental -1 1
175
175
-CHART mysql_$m.handlers '' "mysql Handlers" "handlers/s" mysql_$m mysql line 20003 $mysql_update_every
176
+CHART mysql_$m.handlers '' "mysql Handlers" "handlers/s" handlers mysql.handlers line $[mysql_priority + 3] $mysql_update_every
177
DIMENSION Handler_commit commit incremental 1 1
178
DIMENSION Handler_delete delete incremental 1 1
179
DIMENSION Handler_prepare prepare incremental 1 1
@@ -188,75 +189,75 @@ DIMENSION Handler_savepoint_rollback savepoint_rollback incremental 1 1
189
DIMENSION Handler_update update incremental 1 1
190
DIMENSION Handler_write write incremental 1 1
191
191
-CHART mysql_$m.table_locks '' "mysql Tables Locks" "locks/s" mysql_$m mysql line 20004 $mysql_update_every
192
+CHART mysql_$m.table_locks '' "mysql Tables Locks" "locks/s" locks mysql.table_locks line $[mysql_priority + 4] $mysql_update_every
193
DIMENSION Table_locks_immediate immediate incremental 1 1
194
DIMENSION Table_locks_waited waited incremental -1 1
195
195
-CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins/s" mysql_$m mysql line 20005 $mysql_update_every
196
+CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins/s" issues mysql.join_issues line $[mysql_priority + 5] $mysql_update_every
197
DIMENSION Select_full_join full_join incremental 1 1
198
DIMENSION Select_full_range_join full_range_join incremental 1 1
199
DIMENSION Select_range range incremental 1 1
200
DIMENSION Select_range_check range_check incremental 1 1
201
DIMENSION Select_scan scan incremental 1 1
202
202
-CHART mysql_$m.sort_issues '' "mysql Sort Issues" "issues/s" mysql_$m mysql line 20006 $mysql_update_every
203
+CHART mysql_$m.sort_issues '' "mysql Sort Issues" "issues/s" issues mysql.sort.issues line $[mysql_priority + 6] $mysql_update_every
204
DIMENSION Sort_merge_passes merge_passes incremental 1 1
205
DIMENSION Sort_range range incremental 1 1
206
DIMENSION Sort_scan scan incremental 1 1
207
207
-CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" mysql_$m mysql line 20007 $mysql_update_every
208
+CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" temporaries mysql.tmp line $[mysql_priority + 7] $mysql_update_every
209
DIMENSION Created_tmp_disk_tables disk_tables incremental 1 1
210
DIMENSION Created_tmp_files files incremental 1 1
211
DIMENSION Created_tmp_tables tables incremental 1 1
212
212
-CHART mysql_$m.connections '' "mysql Connections" "connections/s" mysql_$m mysql line 20009 $mysql_update_every
213
+CHART mysql_$m.connections '' "mysql Connections" "connections/s" connections mysql.connections line $[mysql_priority + 8] $mysql_update_every
214
DIMENSION Connections all incremental 1 1
215
DIMENSION Aborted_connects aborded incremental 1 1
216
216
-CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" mysql_$m mysql line 20010 $mysql_update_every
217
+CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" binlog mysql.binlog_cache line $[mysql_priority + 9] $mysql_update_every
218
DIMENSION Binlog_cache_disk_use disk incremental 1 1
219
DIMENSION Binlog_cache_use all incremental 1 1
220
220
-CHART mysql_$m.threads '' "mysql Threads" "threads" mysql_$m mysql line 20012 $mysql_update_every
221
+CHART mysql_$m.threads '' "mysql Threads" "threads" threads mysql.threads line $[mysql_priority + 10] $mysql_update_every
222
DIMENSION Threads_connected connected absolute 1 1
223
DIMENSION Threads_created created incremental 1 1
224
DIMENSION Threads_cached cached absolute -1 1
225
DIMENSION Threads_running running absolute 1 1
226
226
-CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" mysql_$m mysql area 20013 $mysql_update_every
227
+CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" threads mysql.thread_cache_misses area $[mysql_priority + 11] $mysql_update_every
228
DIMENSION misses misses absolute 1 100
229
229
-CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" mysql_$m mysql area 20014 $mysql_update_every
230
+CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" innodb mysql.innodb_io area $[mysql_priority + 12] $mysql_update_every
231
DIMENSION Innodb_data_read read incremental 1 1024
232
DIMENSION Innodb_data_written write incremental -1 1024
233
233
-CHART mysql_$m.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" mysql_$m mysql line 20015 $mysql_update_every
234
+CHART mysql_$m.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" innodb mysql.innodb_io_ops line $[mysql_priority + 13] $mysql_update_every
235
DIMENSION Innodb_data_reads reads incremental 1 1
236
DIMENSION Innodb_data_writes writes incremental -1 1
237
DIMENSION Innodb_data_fsyncs fsyncs incremental 1 1
238
238
-CHART mysql_$m.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" mysql_$m mysql line 20015 $mysql_update_every
239
+CHART mysql_$m.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" innodb mysql.innodb_io_pending_ops line $[mysql_priority + 14] $mysql_update_every
240
DIMENSION Innodb_data_pending_reads reads absolute 1 1
241
DIMENSION Innodb_data_pending_writes writes absolute -1 1
242
DIMENSION Innodb_data_pending_fsyncs fsyncs absolute 1 1
243
243
-CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" mysql_$m mysql line 20016 $mysql_update_every
244
+CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" innodb mysql.innodb_log line $[mysql_priority + 15] $mysql_update_every
245
DIMENSION Innodb_log_waits waits incremental 1 1
246
DIMENSION Innodb_log_write_requests write_requests incremental -1 1
247
DIMENSION Innodb_log_writes writes incremental -1 1
248
248
-CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" mysql_$m mysql line 20017 $mysql_update_every
249
+CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" innodb mysql.innodb_os_log line $[mysql_priority + 16] $mysql_update_every
250
DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 1
251
DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs absolute 1 1
252
DIMENSION Innodb_os_log_pending_writes pending_writes absolute -1 1
253
253
-CHART mysql_$m.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" mysql_$m mysql area 20018 $mysql_update_every
254
+CHART mysql_$m.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" innodb mysql.innodb_os_log_io area $[mysql_priority + 17] $mysql_update_every
255
DIMENSION Innodb_os_log_written write incremental -1 1024
256
256
-CHART mysql_$m.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" mysql_$m mysql area 20019 $mysql_update_every
257
+CHART mysql_$m.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" innodb mysql.innodb_cur_row_lock area $[mysql_priority + 18] $mysql_update_every
258
DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 1
259
259
-CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" mysql_$m mysql area 20020 $mysql_update_every
260
+CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" innodb mysql.innodb_rows area $[mysql_priority + 19] $mysql_update_every
261
DIMENSION Innodb_rows_read read incremental 1 1
262
DIMENSION Innodb_rows_deleted deleted incremental -1 1
263
DIMENSION Innodb_rows_inserted inserted incremental 1 1
@@ -267,7 +268,7 @@ EOF
268
if [ ! -z "$mysql_Binlog_stmt_cache_disk_use" ]
269
then
270
cat <<EOF
270
-CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" mysql_$m mysql line 20011 $mysql_update_every
271
+CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" binlog mysql.binlog_stmt_cache line $[mysql_priority + 20] $mysql_update_every
272
DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 1
273
DIMENSION Binlog_stmt_cache_use all incremental 1 1
274
EOF
@@ -276,7 +277,7 @@ EOF
277
if [ ! -z "$mysql_Connection_errors_accept" ]
278
then
279
cat <<EOF
279
-CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" mysql_$m mysql line 20008 $mysql_update_every
280
+CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" connections mysql.connection_errors line $[mysql_priority + 21] $mysql_update_every
281
DIMENSION Connection_errors_accept accept incremental 1 1
282
DIMENSION Connection_errors_internal internal incremental 1 1
283
DIMENSION Connection_errors_max_connections max incremental 1 1
@@ -327,7 +328,7 @@ mysql_update() {
328
329
# write the result of the work.
330
cat <<VALUESEOF
330
-BEGIN mysql_$x.bandwidth $1
331
+BEGIN mysql_$x.net $1
332
SET Bytes_received = $mysql_Bytes_received
333
SET Bytes_sent = $mysql_Bytes_sent
334
END
charts.d/nginx.chart.sh
+5
-4
@@ -8,6 +8,7 @@ nginx_url="http://127.0.0.1:80/stub_status"
8
# _update_every is a special variable - it holds the number of seconds
9
# between the calls of the _update() function
10
nginx_update_every=
11
+nginx_priority=60000
12
13
declare -a nginx_response=()
14
nginx_active_connections=0
@@ -80,18 +81,18 @@ nginx_check() {
81
# _create is called once, to create the charts
82
nginx_create() {
83
cat <<EOF
83
-CHART nginx.connections '' "nginx Active Connections" "connections" nginx nginx line 16000 $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
86
-CHART nginx.requests '' "nginx Requests" "requests/s" nginx nginx line 16001 $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
89
-CHART nginx.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx line 16002 $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
94
-CHART nginx.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx line 16003 $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
charts.d/nut.chart.sh
+11
-8
@@ -9,6 +9,9 @@ nut_update_every=2
9
10
nut_timeout=2
11
12
+# the priority of nut related to other charts
13
+nut_priority=90000
14
+
15
declare -A nut_ids=()
16
17
nut_get_all() {
@@ -58,34 +61,34 @@ nut_create() {
61
for x in "${nut_ids[@]}"
62
do
63
cat <<EOF
61
-CHART nut_$x.charge '' "UPS Charge" "percentage" ups_$x nut area 21001 $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
64
-CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups_$x nut line 21002 $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
70
-CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" ups_$x nut line 21003 $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
75
-CHART nut_$x.input_current '' "UPS Input Current" "Ampere" ups_$x nut line 21004 $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
78
-CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" ups_$x nut line 21005 $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
82
-CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" ups_$x nut line 21006 $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
85
-CHART nut_$x.load '' "UPS Load" "percentage" ups_$x nut area 21000 $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
88
-CHART nut_$x.temp '' "UPS Temperature" "temperature" ups_$x nut line 21007 $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
+20
-19
@@ -4,6 +4,7 @@ opensips_opts="fifo get_statistics all"
4
opensips_cmd=
5
opensips_update_every=5
6
opensips_timeout=2
7
+opensips_priority=80000
8
9
opensips_get_stats() {
10
timeout $opensips_timeout "$opensips_cmd" $opensips_opts |\
@@ -44,61 +45,61 @@ opensips_check() {
45
opensips_create() {
46
# create the charts
47
cat <<EOF
47
-CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" opensips '' area 20001 $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
51
-CHART opensips.users '' "OpenSIPS Users" "users" opensips '' line 20002 $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
57
-CHART opensips.registrar '' "OpenSIPS Registrar" "registrations/s" opensips '' line 20003 $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
61
-CHART opensips.transactions '' "OpenSIPS Transactions" "transactions/s" opensips '' line 20004 $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
65
-CHART opensips.core_rcv '' "OpenSIPS Core Receives" "queries/s" opensips '' line 20005 $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
69
-CHART opensips.core_fwd '' "OpenSIPS Core Forwards" "queries/s" opensips '' line 20006 $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
73
-CHART opensips.core_drop '' "OpenSIPS Core Drops" "queries/s" opensips '' line 20007 $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
77
-CHART opensips.core_err '' "OpenSIPS Core Errors" "queries/s" opensips '' line 20008 $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
81
-CHART opensips.core_bad '' "OpenSIPS Core Bad" "queries/s" opensips '' line 20009 $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
86
-CHART opensips.tm_replies '' "OpenSIPS TM Replies" "replies/s" opensips '' line 20010 $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
91
-CHART opensips.transactions_status '' "OpenSIPS Transactions Status" "transactions/s" opensips '' line 20011 $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
98
-CHART opensips.transactions_inuse '' "OpenSIPS InUse Transactions" "transactions" opensips '' line 20012 $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
101
-CHART opensips.sl_replies '' "OpenSIPS SL Replies" "replies/s" opensips '' line 20013 $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
@@ -109,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
112
-CHART opensips.dialogs '' "OpenSIPS Dialogs" "dialogs/s" opensips '' line 20014 $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
117
-CHART opensips.net_waiting '' "OpenSIPS Network Waiting" "kilobytes" opensips '' line 20015 $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
121
-CHART opensips.uri_checks '' "OpenSIPS URI Checks" "checks / sec" opensips '' line 20016 $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
125
-CHART opensips.traces '' "OpenSIPS Traces" "traces / sec" opensips '' line 20017 $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
129
-CHART opensips.shmem '' "OpenSIPS Shared Memory" "kilobytes" opensips '' line 20018 $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
136
-CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragments" opensips '' line 20019 $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/postfix.chart.sh
+4
-2
@@ -7,6 +7,8 @@ postfix_postqueue=
7
# how frequently to collect queue size
8
postfix_update_every=15
9
10
+postfix_priority=60000
11
+
12
postfix_check() {
13
# this should return:
14
# - 0 to enable the chart
@@ -41,9 +43,9 @@ postfix_check() {
43
44
postfix_create() {
45
cat <<EOF
44
-CHART postfix.qemails '' "Postfix Queue Emails" "emails" postfix postfix line 5000 $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
46
-CHART postfix.qsize '' "Postfix Queue Emails Size" "emails size in KB" postfix postfix area 5001 $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
+9
-7
@@ -21,6 +21,8 @@ sensors_source_update=1
21
# the default is to collect it at every iteration of charts.d
22
sensors_update_every=
23
24
+sensors_priority=90000
25
+
26
sensors_find_all_files() {
27
find $1 -maxdepth $sensors_sys_depth -name \*_input -o -name temp 2>/dev/null
28
}
@@ -127,7 +129,7 @@ sensors_create() {
129
files="$( sensors_check_files $files )"
130
files="$( sensors_check_temp_type $files )"
131
[ -z "$files" ] && continue
130
- echo "CHART sensors.temp_$id '' '$name Temperature' 'Celcius' '$device' '' line 6000 $sensors_update_every"
132
+ echo "CHART sensors.temp_$id '' '$name Temperature' 'Celcius' '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
;;
@@ -136,7 +138,7 @@ sensors_create() {
138
files="$( ls $path/in*_input 2>/dev/null )"
139
files="$( sensors_check_files $files )"
140
[ -z "$files" ] && continue
139
- echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' '$device' '' line 6001 $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
;;
@@ -145,7 +147,7 @@ sensors_create() {
147
files="$( ls $path/curr*_input 2>/dev/null )"
148
files="$( sensors_check_files $files )"
149
[ -z "$files" ] && continue
148
- echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' '$device' '' line 6002 $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
;;
@@ -154,7 +156,7 @@ sensors_create() {
156
files="$( ls $path/power*_input 2>/dev/null )"
157
files="$( sensors_check_files $files )"
158
[ -z "$files" ] && continue
157
- echo "CHART sensors.power_$id '' '$name Power' 'Watt' '$device' '' line 6003 $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
;;
@@ -163,7 +165,7 @@ sensors_create() {
165
files="$( ls $path/fan*_input 2>/dev/null )"
166
files="$( sensors_check_files $files )"
167
[ -z "$files" ] && continue
166
- echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' '$device' '' line 6004 $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
@@ -171,7 +173,7 @@ sensors_create() {
173
files="$( ls $path/energy*_input 2>/dev/null )"
174
files="$( sensors_check_files $files )"
175
[ -z "$files" ] && continue
174
- echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' '$device' '' areastack 6005 $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
@@ -181,7 +183,7 @@ sensors_create() {
183
files="$( ls $path/humidity*_input 2>/dev/null )"
184
files="$( sensors_check_files $files )"
185
[ -z "$files" ] && continue
184
- echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' '$device' '' line 6006 $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
+5
-4
@@ -5,6 +5,7 @@ squid_port=
5
squid_url=
6
squid_timeout=2
7
squid_update_every=5
8
+squid_priority=60000
9
10
squid_get_stats_internal() {
11
local host="$1" port="$2" url="$3"
@@ -69,21 +70,21 @@ squid_check() {
70
squid_create() {
71
# create the charts
72
cat <<EOF
72
-CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" squid '' area 20001 $squid_update_every
73
+CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" clients squid.clients.net area $[squid_priority + 1] $squid_update_every
74
DIMENSION client_http_kbytes_in in incremental 8 1
75
DIMENSION client_http_kbytes_out out incremental -8 1
76
DIMENSION client_http_hit_kbytes_out hits incremental -8 1
77
77
-CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" squid '' line 20003 $squid_update_every
78
+CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" clients squid.clients.requests line $[squid_priority + 3] $squid_update_every
79
DIMENSION client_http_requests requests incremental 1 1
80
DIMENSION client_http_hits hits incremental 1 1
81
DIMENSION client_http_errors errors incremental -1 1
82
82
-CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" squid '' area 20002 $squid_update_every
83
+CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" servers squid.servers.net area $[squid_priority + 2] $squid_update_every
84
DIMENSION server_all_kbytes_in in incremental 8 1
85
DIMENSION server_all_kbytes_out out incremental -8 1
86
86
-CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" squid '' line 20004 $squid_update_every
87
+CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" servers squid.servers.requests line $[squid_priority + 4] $squid_update_every
88
DIMENSION server_all_requests requests incremental 1 1
89
DIMENSION server_all_errors errors incremental -1 1
90
EOF
node.d/named.node.js
+35
-35
@@ -47,19 +47,19 @@ var named = {
47
name: __filename,
48
enable_autodetect: true,
49
update_every: 1,
50
-
50
+ base_priority: 60000,
51
charts: {},
52
53
- chartFromMembersCreate: function(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor) {
53
+ chartFromMembersCreate: function(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor) {
54
var chart = {
55
id: id, // the unique id of the chart
56
name: '', // the unique name of the chart
57
title: service.name + ' ' + title_suffix, // the title of the chart
58
units: units, // the units of the chart dimensions
59
- family: family_prefix + '_' + service.name, // the family of the chart
60
- category: category_prefix + '_' + service.name, // the category of the chart
59
+ family: family, // the family of the chart
60
+ context: context, // the context of the chart
61
type: type, // the type of the chart
62
- priority: priority, // the priority relative to others in the same family and category
62
+ priority: priority, // the priority relative to others in the same family
63
update_every: service.update_every, // the expected update frequency of the chart
64
dimensions: {}
65
}
@@ -87,19 +87,19 @@ var named = {
87
return chart;
88
},
89
90
- chartFromMembers: function(service, obj, id_suffix, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor) {
90
+ chartFromMembers: function(service, obj, id_suffix, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor) {
91
var id = 'named_' + service.name + '.' + id_suffix;
92
var chart = this.charts[id];
93
94
if(typeof chart === 'undefined') {
95
- chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor);
95
+ chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor);
96
if(chart === null) return false;
97
}
98
else {
99
// check if we need to re-generate the chart
100
for(var x in obj) {
101
if(typeof(chart.dimensions[x]) === 'undefined') {
102
- chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor);
102
+ chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor);
103
if(chart === null) return false;
104
break;
105
}
@@ -300,28 +300,28 @@ var named = {
300
}
301
302
if(global_requests_enable == true)
303
- service.module.chartFromMembers(service, global_requests, 'received_requests', 'Bind, Global Received Requests by IP version', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 100, netdata.chartAlgorithms.incremental, 1, 1);
303
+ service.module.chartFromMembers(service, global_requests, 'received_requests', 'Bind, Global Received Requests by IP version', 'requests/s', 'requests', 'named.requests', netdata.chartTypes.stacked, named.base_priority + 1, netdata.chartAlgorithms.incremental, 1, 1);
304
305
if(global_queries_success_enable == true)
306
- service.module.chartFromMembers(service, global_queries_success, 'global_queries_success', 'Bind, Global Successful Queries', 'queries/s', 'named', 'named', netdata.chartTypes.line, 150, netdata.chartAlgorithms.incremental, 1, 1);
306
+ service.module.chartFromMembers(service, global_queries_success, 'global_queries_success', 'Bind, Global Successful Queries', 'queries/s', 'queries', 'named.queries.succcess', netdata.chartTypes.line, named.base_priority + 2, netdata.chartAlgorithms.incremental, 1, 1);
307
308
if(protocol_queries_enable == true)
309
- service.module.chartFromMembers(service, protocol_queries, 'protocols_queries', 'Bind, Global Queries by IP Protocol', 'queries/s', 'named', 'named', netdata.chartTypes.stacked, 200, netdata.chartAlgorithms.incremental, 1, 1);
309
+ service.module.chartFromMembers(service, protocol_queries, 'protocols_queries', 'Bind, Global Queries by IP Protocol', 'queries/s', 'queries', 'named.protocol.queries', netdata.chartTypes.stacked, named.base_priority + 3, netdata.chartAlgorithms.incremental, 1, 1);
310
311
if(global_queries_enable == true)
312
- service.module.chartFromMembers(service, global_queries, 'global_queries', 'Bind, Global Queries Analysis', 'queries/s', 'named', 'named', netdata.chartTypes.stacked, 300, netdata.chartAlgorithms.incremental, 1, 1);
312
+ service.module.chartFromMembers(service, global_queries, 'global_queries', 'Bind, Global Queries Analysis', 'queries/s', 'queries', 'named.global.queries', netdata.chartTypes.stacked, named.base_priority + 4, netdata.chartAlgorithms.incremental, 1, 1);
313
314
if(global_updates_enable == true)
315
- service.module.chartFromMembers(service, global_updates, 'received_updates', 'Bind, Global Received Updates', 'updates/s', 'named', 'named', netdata.chartTypes.stacked, 900, netdata.chartAlgorithms.incremental, 1, 1);
315
+ service.module.chartFromMembers(service, global_updates, 'received_updates', 'Bind, Global Received Updates', 'updates/s', 'updates', 'named.global.updates', netdata.chartTypes.stacked, named.base_priority + 5, netdata.chartAlgorithms.incremental, 1, 1);
316
317
if(global_failures_enable == true)
318
- service.module.chartFromMembers(service, global_failures, 'query_failures', 'Bind, Global Query Failures', 'failures/s', 'named', 'named', netdata.chartTypes.line, 950, netdata.chartAlgorithms.incremental, 1, 1);
318
+ service.module.chartFromMembers(service, global_failures, 'query_failures', 'Bind, Global Query Failures', 'failures/s', 'failures', 'named.global.failures', netdata.chartTypes.line, named.base_priority + 6, netdata.chartAlgorithms.incremental, 1, 1);
319
320
if(global_failures_detail_enable == true)
321
- service.module.chartFromMembers(service, global_failures_detail, 'query_failures_detail', 'Bind, Global Query Failures Analysis', 'failures/s', 'named', 'named', netdata.chartTypes.stacked, 960, netdata.chartAlgorithms.incremental, 1, 1);
321
+ service.module.chartFromMembers(service, global_failures_detail, 'query_failures_detail', 'Bind, Global Query Failures Analysis', 'failures/s', 'failures', 'named.global.failures.detail', netdata.chartTypes.stacked, named.base_priority + 7, netdata.chartAlgorithms.incremental, 1, 1);
322
323
if(default_enable === true)
324
- service.module.chartFromMembers(service, r.nsstats, 'nsstats', 'Bind, Other Global Server Statistics', 'operations/s', 'named', 'named', netdata.chartTypes.line, 999, netdata.chartAlgorithms.incremental, 1, 1);
324
+ service.module.chartFromMembers(service, r.nsstats, 'nsstats', 'Bind, Other Global Server Statistics', 'operations/s', 'other', 'named.nsstats', netdata.chartTypes.line, named.base_priority + 8, netdata.chartAlgorithms.incremental, 1, 1);
325
326
// RecursClients chart
327
{
@@ -334,10 +334,10 @@ var named = {
334
name: '', // the unique name of the chart
335
title: service.name + ' Bind, Current Recursive Clients', // the title of the chart
336
units: 'clients', // the units of the chart dimensions
337
- family: 'named', // the family of the chart
338
- category: 'named', // the category of the chart
337
+ family: 'clients', // the family of the chart
338
+ context: 'named.recursive.clients', // the context of the chart
339
type: netdata.chartTypes.line, // the type of the chart
340
- priority: 150, // the priority relative to others in the same family and category
340
+ priority: named.base_priority + 1, // the priority relative to others in the same family
341
update_every: service.update_every, // the expected update frequency of the chart
342
dimensions: {
343
'clients': {
@@ -362,13 +362,13 @@ var named = {
362
}
363
364
if(typeof r.opcodes !== 'undefined')
365
- service.module.chartFromMembers(service, r.opcodes, 'in_opcodes', 'Bind, Global Incoming Requests by OpCode', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 1000, netdata.chartAlgorithms.incremental, 1, 1);
365
+ service.module.chartFromMembers(service, r.opcodes, 'in_opcodes', 'Bind, Global Incoming Requests by OpCode', 'requests/s', 'requests', 'named.in.opcodes', netdata.chartTypes.stacked, named.base_priority + 9, netdata.chartAlgorithms.incremental, 1, 1);
366
367
if(typeof r.qtypes !== 'undefined')
368
- service.module.chartFromMembers(service, r.qtypes, 'in_qtypes', 'Bind, Global Incoming Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 2000, netdata.chartAlgorithms.incremental, 1, 1);
368
+ service.module.chartFromMembers(service, r.qtypes, 'in_qtypes', 'Bind, Global Incoming Requests by Query Type', 'requests/s', 'requests', 'named.in.qtypes', netdata.chartTypes.stacked, named.base_priority + 10, netdata.chartAlgorithms.incremental, 1, 1);
369
370
if(typeof r.sockstats !== 'undefined')
371
- service.module.chartFromMembers(service, r.sockstats, 'in_sockstats', 'Bind, Global Socket Statistics', 'operations/s', 'named', 'named', netdata.chartTypes.line, 2500, netdata.chartAlgorithms.incremental, 1, 1);
371
+ service.module.chartFromMembers(service, r.sockstats, 'in_sockstats', 'Bind, Global Socket Statistics', 'operations/s', 'sockets', 'named.in.sockstats', netdata.chartTypes.line, named.base_priority + 11, netdata.chartAlgorithms.incremental, 1, 1);
372
373
if(typeof r.views !== 'undefined') {
374
for( var x in r.views ) {
@@ -422,10 +422,10 @@ var named = {
422
}
423
424
if(rtt_enable)
425
- service.module.chartFromMembers(service, rtt, 'view_resolver_rtt_' + x, 'Bind, ' + x + ' View, Resolver Round Trip Timings', 'queries/s', 'named', 'named', netdata.chartTypes.stacked, 5600, netdata.chartAlgorithms.incremental, 1, 1);
425
+ service.module.chartFromMembers(service, rtt, 'view_resolver_rtt_' + x, 'Bind, ' + x + ' View, Resolver Round Trip Timings', 'queries/s', 'view_' + x, 'named.resolver.rtt', netdata.chartTypes.stacked, named.base_priority + 12, netdata.chartAlgorithms.incremental, 1, 1);
426
427
if(default_enable)
428
- service.module.chartFromMembers(service, resolver.stats, 'view_resolver_stats_' + x, 'Bind, ' + x + ' View, Resolver Statistics', 'operations/s', 'named', 'named', netdata.chartTypes.line, 5500, netdata.chartAlgorithms.incremental, 1, 1);
428
+ service.module.chartFromMembers(service, resolver.stats, 'view_resolver_stats_' + x, 'Bind, ' + x + ' View, Resolver Statistics', 'operations/s', 'view_' + x, 'named.resolver.stats', netdata.chartTypes.line, named.base_priority + 13, netdata.chartAlgorithms.incremental, 1, 1);
429
430
// NumFetch chart
431
if(typeof named.lookups.numfetch[key] !== 'undefined') {
@@ -438,10 +438,10 @@ var named = {
438
name: '', // the unique name of the chart
439
title: service.name + ' Bind, ' + x + ' View, Resolver Active Queries', // the title of the chart
440
units: 'queries', // the units of the chart dimensions
441
- family: 'named', // the family of the chart
442
- category: 'named', // the category of the chart
441
+ family: 'view_' + x, // the family of the chart
442
+ context: 'named.resolver.active.queries', // the context of the chart
443
type: netdata.chartTypes.line, // the type of the chart
444
- priority: 5000, // the priority relative to others in the same family and category
444
+ priority: named.base_priority + 1001, // the priority relative to others in the same family
445
update_every: service.update_every, // the expected update frequency of the chart
446
dimensions: {
447
'queries': {
@@ -467,10 +467,10 @@ var named = {
467
}
468
469
if(typeof resolver.qtypes !== 'undefined')
470
- service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 6000, netdata.chartAlgorithms.incremental, 1, 1);
470
+ service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'view_' + x, 'named.resolver.qtypes', netdata.chartTypes.stacked, named.base_priority + 14, netdata.chartAlgorithms.incremental, 1, 1);
471
472
//if(typeof resolver.cache !== 'undefined')
473
- // service.module.chartFromMembers(service, resolver.cache, 'view_resolver_cache_' + x, 'Bind, ' + x + ' View, Cache Entries', 'entries', 'named', 'named', netdata.chartTypes.stacked, 7000, netdata.chartAlgorithms.absolute, 1, 1);
473
+ // service.module.chartFromMembers(service, resolver.cache, 'view_resolver_cache_' + x, 'Bind, ' + x + ' View, Cache Entries', 'entries', 'view_' + x, 'named.resolver.cache', netdata.chartTypes.stacked, named.base_priority + 15, netdata.chartAlgorithms.absolute, 1, 1);
474
475
if(typeof resolver.cachestats['CacheHits'] !== 'undefined' && resolver.cachestats['CacheHits'] > 0) {
476
var id = 'named_' + service.name + '.view_resolver_cachehits_' + x;
@@ -481,11 +481,11 @@ var named = {
481
id: id, // the unique id of the chart
482
name: '', // the unique name of the chart
483
title: service.name + ' Bind, ' + x + ' View, Resolver Cache Hits', // the title of the chart
484
- units: 'operations/s', // the units of the chart dimensions
485
- family: 'named', // the family of the chart
486
- category: 'named', // the category of the chart
484
+ units: 'operations/s', // the units of the chart dimensions
485
+ family: 'view_' + x, // the family of the chart
486
+ context: 'named.resolver.cache.hits', // the context of the chart
487
type: netdata.chartTypes.area, // the type of the chart
488
- priority: 8000, // the priority relative to others in the same family and category
488
+ priority: named.base_priority + 1100, // the priority relative to others in the same family
489
update_every: service.update_every, // the expected update frequency of the chart
490
dimensions: {
491
'CacheHits': {
@@ -525,10 +525,10 @@ var named = {
525
// 5. TreeMemTotal, TreeMemInUse - absolute
526
// 6. HeapMemMax, HeapMemTotal, HeapMemInUse - absolute
527
//if(typeof resolver.cachestats !== 'undefined')
528
- // service.module.chartFromMembers(service, resolver.cachestats, 'view_resolver_cachestats_' + x, 'Bind, ' + x + ' View, Cache Statistics', 'requests/s', 'named', 'named', netdata.chartTypes.line, 8000, netdata.chartAlgorithms.incremental, 1, 1);
528
+ // service.module.chartFromMembers(service, resolver.cachestats, 'view_resolver_cachestats_' + x, 'Bind, ' + x + ' View, Cache Statistics', 'requests/s', 'view_' + x, 'named.resolver.cache.stats', netdata.chartTypes.line, named.base_priority + 1001, netdata.chartAlgorithms.incremental, 1, 1);
529
530
//if(typeof resolver.adb !== 'undefined')
531
- // service.module.chartFromMembers(service, resolver.adb, 'view_resolver_adb_' + x, 'Bind, ' + x + ' View, ADB Statistics', 'entries', 'named', 'named', netdata.chartTypes.line, 8500, netdata.chartAlgorithms.absolute, 1, 1);
531
+ // service.module.chartFromMembers(service, resolver.adb, 'view_resolver_adb_' + x, 'Bind, ' + x + ' View, ADB Statistics', 'entries', 'view_' + x, 'named.resolver.adb', netdata.chartTypes.line, named.base_priority + 1002, netdata.chartAlgorithms.absolute, 1, 1);
532
}
533
}
534
}
node.d/node_modules/netdata.js
+19
-14
@@ -13,9 +13,9 @@ var example_chart = {
13
title: 'title', // the title of the chart
14
units: 'units', // the units of the chart dimensions
15
family: 'family', // the family of the chart
16
- category: 'category', // the category of the chart
16
+ context: 'context', // the context of the chart
17
type: netdata.chartTypes.line, // the type of the chart
18
- priority: 0, // the priority relative to others in the same family and category
18
+ priority: 0, // the priority relative to others in the same family
19
update_every: 1, // the expected update frequency of the chart
20
dimensions: {
21
'dim1': {
@@ -150,6 +150,8 @@ var netdata = {
150
if(typeof service === 'undefined')
151
service = {};
152
153
+ var now = new Date().getTime();
154
+
155
service._current_chart = null; // the current chart we work on
156
service._queue = ''; // data to be sent to netdata
157
@@ -161,7 +163,6 @@ var netdata = {
163
service.running = false;
164
service.started = 0;
165
service.ended = 0;
164
- service.next_run = new Date().getTime();
166
167
if(typeof service.module === 'undefined') {
168
service.module = { name: 'not-defined-module' };
@@ -169,8 +170,12 @@ var netdata = {
170
service.enabled = false;
171
}
172
172
- if(typeof service.name === 'undefined')
173
- service.name = 'unnamed@' + service.module.name + '/' + service.next_run;
173
+ if(typeof service.name === 'undefined') {
174
+ service.name = 'unnamed@' + service.module.name + '/' + now;
175
+ }
176
+
177
+ if(typeof service.processor === 'undefined')
178
+ service.processor = netdata.processors.http;
179
180
if(typeof service.update_every === 'undefined')
181
service.update_every = service.module.update_every;
@@ -178,12 +183,12 @@ var netdata = {
183
if(typeof service.update_every === 'undefined')
184
service.update_every = netdata.options.update_every;
185
181
- if(typeof service.processor === 'undefined')
182
- service.processor = netdata.processors.http;
183
-
186
if(service.update_every < netdata.options.update_every)
187
service.update_every = netdata.options.update_every;
188
189
+ // align the runs
190
+ service.next_run = now - (now % (service.update_every * 1000));
191
+
192
service.commit = function() {
193
if(this.added !== true) {
194
this.added = true;
@@ -272,7 +277,7 @@ var netdata = {
277
278
service._send_chart_to_netdata = function(chart) {
279
// internal function to send a chart to netdata
275
- this.queue('CHART "' + chart.id + '" "' + chart.name + '" "' + chart.title + '" "' + chart.units + '" "' + chart.family + '" "' + chart.category + '" "' + chart.type + '" ' + chart.priority.toString() + ' ' + chart.update_every.toString());
280
+ this.queue('CHART "' + chart.id + '" "' + chart.name + '" "' + chart.title + '" "' + chart.units + '" "' + chart.family + '" "' + chart.context + '" "' + chart.type + '" ' + chart.priority.toString() + ' ' + chart.update_every.toString());
281
282
for(var dim in chart.dimensions) {
283
var d = chart.dimensions[dim];
@@ -387,9 +392,9 @@ var netdata = {
392
title: 'untitled chart',
393
units: 'a unit',
394
family: '',
390
- category: '',
395
+ context: '',
396
type: netdata.chartTypes.line,
392
- priority: 0,
397
+ priority: 50000,
398
update_every: netdata.options.update_every,
399
dimensions: {}
400
};
@@ -421,9 +426,9 @@ var netdata = {
426
c._updated = true;
427
}
428
424
- if(typeof(chart.category) !== 'undefined' && chart.category !== c.category) {
425
- if(netdata.options.DEBUG === true) netdata.debug('chart ' + id + ' updated its category');
426
- c.category = chart.category;
429
+ if(typeof(chart.context) !== 'undefined' && chart.context !== c.context) {
430
+ if(netdata.options.DEBUG === true) netdata.debug('chart ' + id + ' updated its context');
431
+ c.context = chart.context;
432
c._updated = true;
433
}
434
node.d/sma_webbox.node.js
+10
-10
@@ -33,7 +33,7 @@ var webbox = {
33
name: __filename,
34
enable_autodetect: true,
35
update_every: 1,
36
-
36
+ base_priority: 60000,
37
charts: {},
38
39
processResponse: function(service, data) {
@@ -83,10 +83,10 @@ var webbox = {
83
name: '', // the unique name of the chart
84
title: service.name + ' Current Grid Power', // the title of the chart
85
units: d['GriPwr'].unit, // the units of the chart dimensions
86
- family: 'sma_webbox_' + service.name, // the family of the chart
87
- category: 'sma_webbox_' + service.name, // the category of the chart
86
+ family: 'now', // the family of the chart
87
+ context: 'sma_webbox.grid.power', // the context of the chart
88
type: netdata.chartTypes.area, // the type of the chart
89
- priority: 1000, // the priority relative to others in the same family and category
89
+ priority: webbox.base_priority + 1, // the priority relative to others in the same family
90
update_every: service.update_every, // the expected update frequency of the chart
91
dimensions: {
92
'GriPwr': {
@@ -119,10 +119,10 @@ var webbox = {
119
name: '', // the unique name of the chart
120
title: service.name + ' Today Grid Power', // the title of the chart
121
units: d['GriEgyTdy'].unit, // the units of the chart dimensions
122
- family: 'sma_webbox_' + service.name, // the family of the chart
123
- category: 'sma_webbox_' + service.name, // the category of the chart
122
+ family: 'today', // the family of the chart
123
+ context: 'sma_webbox.grid.power.today', // the context of the chart
124
type: netdata.chartTypes.area, // the type of the chart
125
- priority: 1000, // the priority relative to others in the same family and category
125
+ priority: webbox.base_priority + 2, // the priority relative to others in the same family
126
update_every: service.update_every, // the expected update frequency of the chart
127
dimensions: {
128
'GriEgyTdy': {
@@ -155,10 +155,10 @@ var webbox = {
155
name: '', // the unique name of the chart
156
title: service.name + ' Total Grid Power', // the title of the chart
157
units: d['GriEgyTot'].unit, // the units of the chart dimensions
158
- family: 'sma_webbox_' + service.name, // the family of the chart
159
- category: 'sma_webbox_' + service.name, // the category of the chart
158
+ family: 'total', // the family of the chart
159
+ context: 'sma_webbox.grid.power.total', // the context of the chart
160
type: netdata.chartTypes.area, // the type of the chart
161
- priority: 1000, // the priority relative to others in the same family and category
161
+ priority: webbox.base_priority + 3, // the priority relative to others in the same family
162
update_every: service.update_every, // the expected update frequency of the chart
163
dimensions: {
164
'GriEgyTot': {
node.d/snmp.node.js
+8
@@ -185,6 +185,11 @@ netdata.processors.snmp = {
185
186
if(error) {
187
service.error('Received error = ' + netdata.stringify(error) + ' varbinds = ' + netdata.stringify(varbinds));
188
+
189
+ // make all values null
190
+ var len = service.snmp_oids.length;
191
+ while(len--)
192
+ service.snmp_oids_index[service.snmp_oids[len]].value = null;
193
}
194
else {
195
if(netdata.options.DEBUG === true)
@@ -221,6 +226,7 @@ var snmp = {
226
name: __filename,
227
enable_autodetect: true,
228
update_every: 1,
229
+ base_priority: 50000,
230
231
charts: {},
232
@@ -277,6 +283,8 @@ var snmp = {
283
var to = service.request.charts[c].multiply_range[1];
284
var prio = service.request.charts[c].priority || 1;
285
286
+ if(prio < snmp.base_priority) prio += snmp.base_priority;
287
+
288
while(from <= to) {
289
var id = c + from.toString();
290
var chart = extend(true, {}, service.request.charts[c]);
plugins.d/charts.d.plugin
+1
-1
@@ -509,7 +509,7 @@ global_update() {
509
charts_next_update[$chart]=$(( charts_last_update[$chart] + (charts_update_every[$chart] * 1000) ))
510
charts_run_counter[$chart]=0
511
512
- echo "CHART netdata.plugin_chartsd_$chart '' 'Execution time for $chart plugin' 'milliseconds / run' netdata netdata area 90000 ${charts_update_every[$chart]}"
512
+ echo "CHART netdata.plugin_chartsd_$chart '' 'Execution time for $chart plugin' 'milliseconds / run' charts.d netdata.plugin_charts area 145000 ${charts_update_every[$chart]}"
513
echo "DIMENSION run_time 'run time' absolute 1 1"
514
done
515
src/apps_plugin.c
+17
-17
@@ -1751,116 +1751,116 @@ void show_charts(void)
1751
1752
// we have something new to show
1753
// update the charts
1754
- fprintf(stdout, "CHART apps.cpu '' 'Apps CPU Time (%ld%% = %ld core%s)' 'cpu time %%' apps apps stacked 20001 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1754
+ fprintf(stdout, "CHART apps.cpu '' 'Apps CPU Time (%ld%% = %ld core%s)' 'cpu time %%' cpu apps.cpu stacked 20001 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1755
for (w = target_root; w ; w = w->next) {
1756
if(w->target || (!w->processes && !w->exposed)) continue;
1757
1758
fprintf(stdout, "DIMENSION %s '' incremental 100 %llu %s\n", w->name, Hertz, w->hidden ? "hidden,noreset" : "noreset");
1759
}
1760
1761
- fprintf(stdout, "CHART apps.mem '' 'Apps Dedicated Memory (w/o shared)' 'MB' apps apps stacked 20003 %d\n", update_every);
1761
+ fprintf(stdout, "CHART apps.mem '' 'Apps Dedicated Memory (w/o shared)' 'MB' mem apps.mem stacked 20003 %d\n", update_every);
1762
for (w = target_root; w ; w = w->next) {
1763
if(w->target || (!w->processes && !w->exposed)) continue;
1764
1765
fprintf(stdout, "DIMENSION %s '' absolute %ld %ld noreset\n", w->name, sysconf(_SC_PAGESIZE), 1024L*1024L);
1766
}
1767
1768
- fprintf(stdout, "CHART apps.threads '' 'Apps Threads' 'threads' apps apps stacked 20005 %d\n", update_every);
1768
+ fprintf(stdout, "CHART apps.threads '' 'Apps Threads' 'threads' processes apps.threads stacked 20005 %d\n", update_every);
1769
for (w = target_root; w ; w = w->next) {
1770
if(w->target || (!w->processes && !w->exposed)) continue;
1771
1772
fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
1773
}
1774
1775
- fprintf(stdout, "CHART apps.processes '' 'Apps Processes' 'processes' apps apps stacked 20004 %d\n", update_every);
1775
+ fprintf(stdout, "CHART apps.processes '' 'Apps Processes' 'processes' processes apps.processes stacked 20004 %d\n", update_every);
1776
for (w = target_root; w ; w = w->next) {
1777
if(w->target || (!w->processes && !w->exposed)) continue;
1778
1779
fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
1780
}
1781
1782
- fprintf(stdout, "CHART apps.cpu_user '' 'Apps CPU User Time (%ld%% = %ld core%s)' 'cpu time %%' apps none stacked 20020 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1782
+ fprintf(stdout, "CHART apps.cpu_user '' 'Apps CPU User Time (%ld%% = %ld core%s)' 'cpu time %%' cpu apps.cpu_user stacked 20020 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1783
for (w = target_root; w ; w = w->next) {
1784
if(w->target || (!w->processes && !w->exposed)) continue;
1785
1786
fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
1787
}
1788
1789
- fprintf(stdout, "CHART apps.cpu_system '' 'Apps CPU System Time (%ld%% = %ld core%s)' 'cpu time %%' apps none stacked 20021 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1789
+ fprintf(stdout, "CHART apps.cpu_system '' 'Apps CPU System Time (%ld%% = %ld core%s)' 'cpu time %%' cpu apps.cpu_system stacked 20021 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every);
1790
for (w = target_root; w ; w = w->next) {
1791
if(w->target || (!w->processes && !w->exposed)) continue;
1792
1793
fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
1794
}
1795
1796
- fprintf(stdout, "CHART apps.major_faults '' 'Apps Major Page Faults (swaps in)' 'page faults/s' apps apps stacked 20010 %d\n", update_every);
1796
+ fprintf(stdout, "CHART apps.major_faults '' 'Apps Major Page Faults (swap read)' 'page faults/s' swap apps.major_faults stacked 20010 %d\n", update_every);
1797
for (w = target_root; w ; w = w->next) {
1798
if(w->target || (!w->processes && !w->exposed)) continue;
1799
1800
fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name);
1801
}
1802
1803
- fprintf(stdout, "CHART apps.minor_faults '' 'Apps Minor Page Faults' 'page faults/s' apps none stacked 20011 %d\n", update_every);
1803
+ fprintf(stdout, "CHART apps.minor_faults '' 'Apps Minor Page Faults' 'page faults/s' mem apps.minor_faults stacked 20011 %d\n", update_every);
1804
for (w = target_root; w ; w = w->next) {
1805
if(w->target || (!w->processes && !w->exposed)) continue;
1806
1807
fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name);
1808
}
1809
1810
- fprintf(stdout, "CHART apps.lreads '' 'Apps Disk Logical Reads' 'kilobytes/s' apps none stacked 20042 %d\n", update_every);
1810
+ fprintf(stdout, "CHART apps.lreads '' 'Apps Disk Logical Reads' 'kilobytes/s' disk apps.lreads stacked 20042 %d\n", update_every);
1811
for (w = target_root; w ; w = w->next) {
1812
if(w->target || (!w->processes && !w->exposed)) continue;
1813
1814
fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
1815
}
1816
1817
- fprintf(stdout, "CHART apps.lwrites '' 'Apps I/O Logical Writes' 'kilobytes/s' apps none stacked 20042 %d\n", update_every);
1817
+ fprintf(stdout, "CHART apps.lwrites '' 'Apps I/O Logical Writes' 'kilobytes/s' disk apps.lwrites stacked 20042 %d\n", update_every);
1818
for (w = target_root; w ; w = w->next) {
1819
if(w->target || (!w->processes && !w->exposed)) continue;
1820
1821
fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
1822
}
1823
1824
- fprintf(stdout, "CHART apps.preads '' 'Apps Disk Reads' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every);
1824
+ fprintf(stdout, "CHART apps.preads '' 'Apps Disk Reads' 'kilobytes/s' disk apps.preads stacked 20002 %d\n", update_every);
1825
for (w = target_root; w ; w = w->next) {
1826
if(w->target || (!w->processes && !w->exposed)) continue;
1827
1828
fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
1829
}
1830
1831
- fprintf(stdout, "CHART apps.pwrites '' 'Apps Disk Writes' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every);
1831
+ fprintf(stdout, "CHART apps.pwrites '' 'Apps Disk Writes' 'kilobytes/s' disk apps.pwrites stacked 20002 %d\n", update_every);
1832
for (w = target_root; w ; w = w->next) {
1833
if(w->target || (!w->processes && !w->exposed)) continue;
1834
1835
fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
1836
}
1837
1838
- fprintf(stdout, "CHART apps.files '' 'Apps Open Files' 'open files' apps apps stacked 20050 %d\n", update_every);
1838
+ fprintf(stdout, "CHART apps.files '' 'Apps Open Files' 'open files' disk apps.files stacked 20050 %d\n", update_every);
1839
for (w = target_root; w ; w = w->next) {
1840
if(w->target || (!w->processes && !w->exposed)) continue;
1841
1842
fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
1843
}
1844
1845
- fprintf(stdout, "CHART apps.sockets '' 'Apps Open Sockets' 'open sockets' apps apps stacked 20051 %d\n", update_every);
1845
+ fprintf(stdout, "CHART apps.sockets '' 'Apps Open Sockets' 'open sockets' net apps.sockets stacked 20051 %d\n", update_every);
1846
for (w = target_root; w ; w = w->next) {
1847
if(w->target || (!w->processes && !w->exposed)) continue;
1848
1849
fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
1850
}
1851
1852
- fprintf(stdout, "CHART apps.pipes '' 'Apps Pipes' 'open pipes' apps none stacked 20053 %d\n", update_every);
1852
+ fprintf(stdout, "CHART apps.pipes '' 'Apps Pipes' 'open pipes' processes apps.pipes stacked 20053 %d\n", update_every);
1853
for (w = target_root; w ; w = w->next) {
1854
if(w->target || (!w->processes && !w->exposed)) continue;
1855
1856
fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
1857
}
1858
1859
- fprintf(stdout, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' netdata netdata stacked 10000 %d\n", update_every);
1859
+ fprintf(stdout, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' apps.plugin netdata.apps_cpu stacked 140000 %d\n", update_every);
1860
fprintf(stdout, "DIMENSION user '' incremental 1 %d\n", 1000);
1861
fprintf(stdout, "DIMENSION system '' incremental 1 %d\n", 1000);
1862
1863
- fprintf(stdout, "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' netdata netdata line 10001 %d\n", update_every);
1863
+ fprintf(stdout, "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' apps.plugin netdata.apps_files line 140001 %d\n", update_every);
1864
fprintf(stdout, "DIMENSION files '' incremental 1 1\n");
1865
fprintf(stdout, "DIMENSION pids '' absolute 1 1\n");
1866
fprintf(stdout, "DIMENSION fds '' absolute 1 1\n");
src/main.c
+2
-2
@@ -41,8 +41,8 @@ int netdata_exit = 0;
41
void netdata_cleanup_and_exit(int ret)
42
{
43
netdata_exit = 1;
44
- rrdset_free_all();
45
- kill_childs();
44
+ rrdset_save_all();
45
+ // kill_childs();
46
unlink("/var/run/netdata.pid");
47
info("NetData exiting. Bye bye...");
48
exit(ret);
src/plugin_checks.c
+3
-3
@@ -30,15 +30,15 @@ void *checks_main(void *ptr)
30
31
RRDSET *check1, *check2, *check3, *apps_cpu = NULL;
32
33
- check1 = rrdset_create("netdata", "check1", NULL, "netdata", "Caller gives microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
33
+ check1 = rrdset_create("netdata", "check1", NULL, "netdata", NULL, "Caller gives microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
34
rrddim_add(check1, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE);
35
rrddim_add(check1, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL);
36
37
- check2 = rrdset_create("netdata", "check2", NULL, "netdata", "Netdata calcs microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
37
+ check2 = rrdset_create("netdata", "check2", NULL, "netdata", NULL, "Netdata calcs microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
38
rrddim_add(check2, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE);
39
rrddim_add(check2, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL);
40
41
- check3 = rrdset_create("netdata", "checkdt", NULL, "netdata", "Clock difference", "microseconds diff", 99999, rrd_update_every, RRDSET_TYPE_LINE);
41
+ check3 = rrdset_create("netdata", "checkdt", NULL, "netdata", NULL, "Clock difference", "microseconds diff", 99999, rrd_update_every, RRDSET_TYPE_LINE);
42
rrddim_add(check3, "caller", NULL, 1, 1, RRDDIM_ABSOLUTE);
43
rrddim_add(check3, "netdata", NULL, 1, 1, RRDDIM_ABSOLUTE);
44
rrddim_add(check3, "apps.plugin", NULL, 1, 1, RRDDIM_ABSOLUTE);
src/plugin_idlejitter.c
+1
-1
@@ -36,7 +36,7 @@ void *cpuidlejitter_main(void *ptr)
36
37
RRDSET *st = rrdset_find("system.idlejitter");
38
if(!st) {
39
- st = rrdset_create("system", "idlejitter", NULL, "cpu", "CPU Idle Jitter", "microseconds lost/s", 9999, rrd_update_every, RRDSET_TYPE_LINE);
39
+ st = rrdset_create("system", "idlejitter", NULL, "processes", NULL, "CPU Idle Jitter", "microseconds lost/s", 9999, rrd_update_every, RRDSET_TYPE_LINE);
40
rrddim_add(st, "jitter", NULL, 1, 1, RRDDIM_ABSOLUTE);
41
}
42
src/plugin_proc.c
+5
-5
@@ -149,7 +149,7 @@ void *proc_main(void *ptr)
149
150
if(!stcpu_thread) stcpu_thread = rrdset_find("netdata.plugin_proc_cpu");
151
if(!stcpu_thread) {
152
- stcpu_thread = rrdset_create("netdata", "plugin_proc_cpu", NULL, "netdata", "NetData Proc Plugin CPU usage", "milliseconds/s", 9999, rrd_update_every, RRDSET_TYPE_STACKED);
152
+ stcpu_thread = rrdset_create("netdata", "plugin_proc_cpu", NULL, "proc.internal", NULL, "NetData Proc Plugin CPU usage", "milliseconds/s", 131000, rrd_update_every, RRDSET_TYPE_STACKED);
153
154
rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL);
155
rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
@@ -164,7 +164,7 @@ void *proc_main(void *ptr)
164
165
if(!stcpu) stcpu = rrdset_find("netdata.server_cpu");
166
if(!stcpu) {
167
- stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", "NetData CPU usage", "milliseconds/s", 2000, rrd_update_every, RRDSET_TYPE_STACKED);
167
+ stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", NULL, "NetData CPU usage", "milliseconds/s", 130000, rrd_update_every, RRDSET_TYPE_STACKED);
168
169
rrddim_add(stcpu, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL);
170
rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
@@ -179,7 +179,7 @@ void *proc_main(void *ptr)
179
180
if(!stclients) stclients = rrdset_find("netdata.clients");
181
if(!stclients) {
182
- stclients = rrdset_create("netdata", "clients", NULL, "netdata", "NetData Web Clients", "connected clients", 3000, rrd_update_every, RRDSET_TYPE_LINE);
182
+ stclients = rrdset_create("netdata", "clients", NULL, "netdata", NULL, "NetData Web Clients", "connected clients", 131000, rrd_update_every, RRDSET_TYPE_LINE);
183
184
rrddim_add(stclients, "clients", NULL, 1, 1, RRDDIM_ABSOLUTE);
185
}
@@ -192,7 +192,7 @@ void *proc_main(void *ptr)
192
193
if(!streqs) streqs = rrdset_find("netdata.requests");
194
if(!streqs) {
195
- streqs = rrdset_create("netdata", "requests", NULL, "netdata", "NetData Web Requests", "requests/s", 3001, rrd_update_every, RRDSET_TYPE_LINE);
195
+ streqs = rrdset_create("netdata", "requests", NULL, "netdata", NULL, "NetData Web Requests", "requests/s", 131100, rrd_update_every, RRDSET_TYPE_LINE);
196
197
rrddim_add(streqs, "requests", NULL, 1, 1, RRDDIM_INCREMENTAL);
198
}
@@ -205,7 +205,7 @@ void *proc_main(void *ptr)
205
206
if(!stbytes) stbytes = rrdset_find("netdata.net");
207
if(!stbytes) {
208
- stbytes = rrdset_create("netdata", "net", NULL, "netdata", "NetData Network Traffic", "kilobits/s", 3002, rrd_update_every, RRDSET_TYPE_AREA);
208
+ stbytes = rrdset_create("netdata", "net", NULL, "netdata", NULL, "NetData Network Traffic", "kilobits/s", 131200, rrd_update_every, RRDSET_TYPE_AREA);
209
210
rrddim_add(stbytes, "in", NULL, 8, 1024, RRDDIM_INCREMENTAL);
211
rrddim_add(stbytes, "out", NULL, -8, 1024, RRDDIM_INCREMENTAL);
src/plugin_tc.c
+3
-3
@@ -235,7 +235,7 @@ static void tc_device_commit(struct tc_device *d)
235
if(!st) {
236
debug(D_TC_LOOP, "TC: Creating new chart for device '%s'", d->name?d->name:d->id);
237
238
- st = rrdset_create(RRD_TYPE_TC, d->id, d->name?d->name:d->id, d->family?d->family:d->id, "Class Usage", "kilobits/s", 1000, rrd_update_every, RRDSET_TYPE_STACKED);
238
+ st = rrdset_create(RRD_TYPE_TC, d->id, d->name?d->name:d->id, d->family?d->family:d->id, RRD_TYPE_TC ".qos", "Class Usage", "kilobits/s", 7000, rrd_update_every, RRDSET_TYPE_STACKED);
239
240
for(c = d->classes ; c ; c = c->next) {
241
if(!c->updated) continue;
@@ -626,7 +626,7 @@ void *tc_main(void *ptr)
626
627
if(!stcpu) stcpu = rrdset_find("netdata.plugin_tc_cpu");
628
if(!stcpu) {
629
- stcpu = rrdset_create("netdata", "plugin_tc_cpu", NULL, "netdata", "NetData TC CPU usage", "milliseconds/s", 10000, rrd_update_every, RRDSET_TYPE_STACKED);
629
+ stcpu = rrdset_create("netdata", "plugin_tc_cpu", NULL, "tc.helper", NULL, "NetData TC CPU usage", "milliseconds/s", 135000, rrd_update_every, RRDSET_TYPE_STACKED);
630
rrddim_add(stcpu, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL);
631
rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
632
}
@@ -638,7 +638,7 @@ void *tc_main(void *ptr)
638
639
if(!sttime) stcpu = rrdset_find("netdata.plugin_tc_time");
640
if(!sttime) {
641
- sttime = rrdset_create("netdata", "plugin_tc_time", NULL, "netdata", "NetData TC script execution", "milliseconds/run", 10001, rrd_update_every, RRDSET_TYPE_AREA);
641
+ sttime = rrdset_create("netdata", "plugin_tc_time", NULL, "tc.helper", NULL, "NetData TC script execution", "milliseconds/run", 135001, rrd_update_every, RRDSET_TYPE_AREA);
642
rrddim_add(sttime, "run_time", "run time", 1, 1, RRDDIM_ABSOLUTE);
643
}
644
else rrdset_next(sttime);
src/plugins_d.c
+6
-8
@@ -244,7 +244,7 @@ void *pluginsd_worker_thread(void *arg)
244
char *title = words[3];
245
char *units = words[4];
246
char *family = words[5];
247
- char *category = words[6];
247
+ char *context = words[6];
248
char *chart = words[7];
249
char *priority_s = words[8];
250
char *update_every_s = words[9];
@@ -267,25 +267,23 @@ void *pluginsd_worker_thread(void *arg)
267
if(unlikely(chart)) chart_type = rrdset_type_id(chart);
268
269
if(unlikely(noname || !name || !*name || strcasecmp(name, "NULL") == 0 || strcasecmp(name, "(NULL)") == 0)) name = NULL;
270
- if(unlikely(!family || !*family)) family = id;
271
- if(unlikely(!category || !*category)) category = type;
270
+ if(unlikely(!family || !*family)) family = NULL;
271
+ if(unlikely(!context || !*context)) context = NULL;
272
273
st = rrdset_find_bytype(type, id);
274
if(unlikely(!st)) {
275
- debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', category='%s', chart='%s', priority=%d, update_every=%d"
275
+ debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', context='%s', chart='%s', priority=%d, update_every=%d"
276
, type, id
277
, name?name:""
278
, family?family:""
279
- , category?category:""
279
+ , context?context:""
280
, rrdset_type_name(chart_type)
281
, priority
282
, update_every
283
);
284
285
- st = rrdset_create(type, id, name, family, title, units, priority, update_every, chart_type);
285
+ st = rrdset_create(type, id, name, family, context, title, units, priority, update_every, chart_type);
286
cd->update_every = update_every;
287
-
288
- if(unlikely(strcmp(category, "none") == 0)) st->isdetail = 1;
287
}
288
else debug(D_PLUGINSD, "PLUGINSD: Chart '%s' already exists. Not adding it again.", st->id);
289
}
src/proc_diskstats.c
+10
-10
@@ -299,7 +299,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
299
}
300
else error("Cannot read sector size for device %s from %s. Assuming 512.", disk, ssfilename);
301
302
- st = rrdset_create(RRD_TYPE_DISK, disk, NULL, disk, "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA);
302
+ st = rrdset_create(RRD_TYPE_DISK, disk, NULL, disk, "disk.io", "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA);
303
304
rrddim_add(st, "reads", NULL, sector_size, 1024, RRDDIM_INCREMENTAL);
305
rrddim_add(st, "writes", NULL, sector_size * -1, 1024, RRDDIM_INCREMENTAL);
@@ -316,7 +316,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
316
if(ddo_ops) {
317
st = rrdset_find_bytype("disk_ops", disk);
318
if(!st) {
319
- st = rrdset_create("disk_ops", disk, NULL, disk, "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE);
319
+ st = rrdset_create("disk_ops", disk, NULL, disk, "disk.ops", "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE);
320
st->isdetail = 1;
321
322
rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -334,7 +334,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
334
if(ddo_qops) {
335
st = rrdset_find_bytype("disk_qops", disk);
336
if(!st) {
337
- st = rrdset_create("disk_qops", disk, NULL, disk, "Disk Current I/O Operations", "operations", 2002, update_every, RRDSET_TYPE_LINE);
337
+ st = rrdset_create("disk_qops", disk, NULL, disk, "disk.qops", "Disk Current I/O Operations", "operations", 2002, update_every, RRDSET_TYPE_LINE);
338
st->isdetail = 1;
339
340
rrddim_add(st, "operations", NULL, 1, 1, RRDDIM_ABSOLUTE);
@@ -350,7 +350,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
350
if(ddo_backlog) {
351
st = rrdset_find_bytype("disk_backlog", disk);
352
if(!st) {
353
- st = rrdset_create("disk_backlog", disk, NULL, disk, "Disk Backlog", "backlog (ms)", 2003, update_every, RRDSET_TYPE_AREA);
353
+ st = rrdset_create("disk_backlog", disk, NULL, disk, "disk.backlog", "Disk Backlog", "backlog (ms)", 2003, update_every, RRDSET_TYPE_AREA);
354
st->isdetail = 1;
355
356
rrddim_add(st, "backlog", NULL, 1, 10, RRDDIM_INCREMENTAL);
@@ -366,7 +366,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
366
if(ddo_util) {
367
st = rrdset_find_bytype("disk_util", disk);
368
if(!st) {
369
- st = rrdset_create("disk_util", disk, NULL, disk, "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA);
369
+ st = rrdset_create("disk_util", disk, NULL, disk, "disk.util", "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA);
370
st->isdetail = 1;
371
372
rrddim_add(st, "utilization", NULL, 1, 10, RRDDIM_INCREMENTAL);
@@ -382,7 +382,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
382
if(ddo_mops) {
383
st = rrdset_find_bytype("disk_mops", disk);
384
if(!st) {
385
- st = rrdset_create("disk_mops", disk, NULL, disk, "Disk Merged Operations", "merged operations/s", 2021, update_every, RRDSET_TYPE_LINE);
385
+ st = rrdset_create("disk_mops", disk, NULL, disk, "disk.mops", "Disk Merged Operations", "merged operations/s", 2021, update_every, RRDSET_TYPE_LINE);
386
st->isdetail = 1;
387
388
rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -400,7 +400,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
400
if(ddo_iotime) {
401
st = rrdset_find_bytype("disk_iotime", disk);
402
if(!st) {
403
- st = rrdset_create("disk_iotime", disk, NULL, disk, "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE);
403
+ st = rrdset_create("disk_iotime", disk, NULL, disk, "disk.iotime", "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE);
404
st->isdetail = 1;
405
406
rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -421,7 +421,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
421
if(ddo_iotime && ddo_ops) {
422
st = rrdset_find_bytype("disk_await", disk);
423
if(!st) {
424
- st = rrdset_create("disk_await", disk, NULL, disk, "Average Completed I/O Operation Time", "ms per operation", 2005, update_every, RRDSET_TYPE_LINE);
424
+ st = rrdset_create("disk_await", disk, NULL, disk, "disk.await", "Average Completed I/O Operation Time", "ms per operation", 2005, update_every, RRDSET_TYPE_LINE);
425
st->isdetail = 1;
426
427
rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_ABSOLUTE);
@@ -437,7 +437,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
437
if(ddo_io && ddo_ops) {
438
st = rrdset_find_bytype("disk_avgsz", disk);
439
if(!st) {
440
- st = rrdset_create("disk_avgsz", disk, NULL, disk, "Average Completed I/O Operation Bandwidth", "kilobytes per operation", 2006, update_every, RRDSET_TYPE_AREA);
440
+ st = rrdset_create("disk_avgsz", disk, NULL, disk, "disk.avgsz", "Average Completed I/O Operation Bandwidth", "kilobytes per operation", 2006, update_every, RRDSET_TYPE_AREA);
441
st->isdetail = 1;
442
443
rrddim_add(st, "reads", NULL, sector_size, 1024, RRDDIM_ABSOLUTE);
@@ -453,7 +453,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
453
if(ddo_util && ddo_ops) {
454
st = rrdset_find_bytype("disk_svctm", disk);
455
if(!st) {
456
- st = rrdset_create("disk_svctm", disk, NULL, disk, "Average Service Time", "ms per operation", 2007, update_every, RRDSET_TYPE_LINE);
456
+ st = rrdset_create("disk_svctm", disk, NULL, disk, "disk.svctm", "Average Service Time", "ms per operation", 2007, update_every, RRDSET_TYPE_LINE);
457
st->isdetail = 1;
458
459
rrddim_add(st, "svctm", NULL, 1, 1, RRDDIM_ABSOLUTE);
src/proc_interrupts.c
+2
-5
@@ -116,7 +116,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
116
117
st = rrdset_find_bytype("system", "interrupts");
118
if(!st) {
119
- st = rrdset_create("system", "interrupts", NULL, "system", "System interrupts", "interrupts/s", 1000, update_every, RRDSET_TYPE_STACKED);
119
+ st = rrdset_create("system", "interrupts", NULL, "interrupts", NULL, "System interrupts", "interrupts/s", 1000, update_every, RRDSET_TYPE_STACKED);
120
121
for(l = 0; l < lines ;l++) {
122
if(!irrs[l].used) continue;
@@ -135,9 +135,6 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
135
int c;
136
137
for(c = 0; c < cpus ; c++) {
138
- char family[256];
139
- snprintf(family, 256, "cpu%d", c);
140
-
138
char id[256];
139
snprintf(id, 256, "cpu%d_interrupts", c);
140
@@ -146,7 +143,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
143
char name[256], title[256];
144
snprintf(name, 256, "cpu%d_interrupts", c);
145
snprintf(title, 256, "CPU%d Interrupts", c);
149
- st = rrdset_create("cpu", id, name, family, title, "interrupts/s", 2000 + c, update_every, RRDSET_TYPE_STACKED);
146
+ st = rrdset_create("cpu", id, name, "interrupts", "cpu.interrupts", title, "interrupts/s", 2000 + c, update_every, RRDSET_TYPE_STACKED);
147
148
for(l = 0; l < lines ;l++) {
149
if(!irrs[l].used) continue;
src/proc_meminfo.c
+11
-9
@@ -22,7 +22,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
22
23
if(do_ram == -1) do_ram = config_get_boolean("plugin:proc:/proc/meminfo", "system ram", 1);
24
if(do_swap == -1) do_swap = config_get_boolean("plugin:proc:/proc/meminfo", "system swap", 1);
25
- if(do_hwcorrupt == -1) do_hwcorrupt = config_get_boolean("plugin:proc:/proc/meminfo", "hardware corrupted ECC", 1);
25
+ if(do_hwcorrupt == -1) do_hwcorrupt = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "hardware corrupted ECC", CONFIG_ONDEMAND_ONDEMAND);
26
if(do_committed == -1) do_committed = config_get_boolean("plugin:proc:/proc/meminfo", "committed memory", 1);
27
if(do_writeback == -1) do_writeback = config_get_boolean("plugin:proc:/proc/meminfo", "writeback memory", 1);
28
if(do_kernel == -1) do_kernel = config_get_boolean("plugin:proc:/proc/meminfo", "kernel memory", 1);
@@ -115,7 +115,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
115
if(do_ram) {
116
st = rrdset_find("system.ram");
117
if(!st) {
118
- st = rrdset_create("system", "ram", NULL, "mem", "System RAM", "MB", 200, update_every, RRDSET_TYPE_STACKED);
118
+ st = rrdset_create("system", "ram", NULL, "ram", NULL, "System RAM", "MB", 200, update_every, RRDSET_TYPE_STACKED);
119
120
rrddim_add(st, "buffers", NULL, 1, 1024, RRDDIM_ABSOLUTE);
121
rrddim_add(st, "used", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -138,7 +138,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
138
if(do_swap) {
139
st = rrdset_find("system.swap");
140
if(!st) {
141
- st = rrdset_create("system", "swap", NULL, "mem", "System Swap", "MB", 201, update_every, RRDSET_TYPE_STACKED);
141
+ st = rrdset_create("system", "swap", NULL, "swap", NULL, "System Swap", "MB", 201, update_every, RRDSET_TYPE_STACKED);
142
st->isdetail = 1;
143
144
rrddim_add(st, "free", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -153,10 +153,12 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
153
154
// --------------------------------------------------------------------
155
156
- if(hwcorrupted && do_hwcorrupt) {
156
+ if(hwcorrupted && do_hwcorrupt && HardwareCorrupted > 0) {
157
+ do_hwcorrupt = CONFIG_ONDEMAND_YES;
158
+
159
st = rrdset_find("mem.hwcorrupt");
160
if(!st) {
159
- st = rrdset_create("mem", "hwcorrupt", NULL, "mem", "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
161
+ st = rrdset_create("mem", "hwcorrupt", NULL, "errors", NULL, "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
162
st->isdetail = 1;
163
164
rrddim_add(st, "HardwareCorrupted", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -172,7 +174,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
174
if(do_committed) {
175
st = rrdset_find("mem.committed");
176
if(!st) {
175
- st = rrdset_create("mem", "committed", NULL, "mem", "Committed (Allocated) Memory", "MB", 5000, update_every, RRDSET_TYPE_AREA);
177
+ st = rrdset_create("mem", "committed", NULL, "system", NULL, "Committed (Allocated) Memory", "MB", 5000, update_every, RRDSET_TYPE_AREA);
178
st->isdetail = 1;
179
180
rrddim_add(st, "Committed_AS", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -188,7 +190,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
190
if(do_writeback) {
191
st = rrdset_find("mem.writeback");
192
if(!st) {
191
- st = rrdset_create("mem", "writeback", NULL, "mem", "Writeback Memory", "MB", 4000, update_every, RRDSET_TYPE_LINE);
193
+ st = rrdset_create("mem", "writeback", NULL, "kernel", NULL, "Writeback Memory", "MB", 4000, update_every, RRDSET_TYPE_LINE);
194
st->isdetail = 1;
195
196
rrddim_add(st, "Dirty", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -212,7 +214,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
214
if(do_kernel) {
215
st = rrdset_find("mem.kernel");
216
if(!st) {
215
- st = rrdset_create("mem", "kernel", NULL, "mem", "Memory Used by Kernel", "MB", 6000, update_every, RRDSET_TYPE_STACKED);
217
+ st = rrdset_create("mem", "kernel", NULL, "kernel", NULL, "Memory Used by Kernel", "MB", 6000, update_every, RRDSET_TYPE_STACKED);
218
st->isdetail = 1;
219
220
rrddim_add(st, "Slab", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -234,7 +236,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
236
if(do_slab) {
237
st = rrdset_find("mem.slab");
238
if(!st) {
237
- st = rrdset_create("mem", "slab", NULL, "mem", "Reclaimable Kernel Memory", "MB", 6500, update_every, RRDSET_TYPE_STACKED);
239
+ st = rrdset_create("mem", "slab", NULL, "slab", NULL, "Reclaimable Kernel Memory", "MB", 6500, update_every, RRDSET_TYPE_STACKED);
240
st->isdetail = 1;
241
242
rrddim_add(st, "reclaimable", NULL, 1, 1024, RRDDIM_ABSOLUTE);
src/proc_net_dev.c
+7
-7
@@ -118,7 +118,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
118
if(ddo_bandwidth) {
119
st = rrdset_find_bytype("net", iface);
120
if(!st) {
121
- st = rrdset_create("net", iface, NULL, iface, "Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
121
+ st = rrdset_create("net", iface, NULL, iface, "net.net", "Bandwidth", "kilobits/s", 7000, update_every, RRDSET_TYPE_AREA);
122
123
rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
124
rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
@@ -135,7 +135,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
135
if(ddo_packets) {
136
st = rrdset_find_bytype("net_packets", iface);
137
if(!st) {
138
- st = rrdset_create("net_packets", iface, NULL, iface, "Packets", "packets/s", 1001, update_every, RRDSET_TYPE_LINE);
138
+ st = rrdset_create("net_packets", iface, NULL, iface, "net.packets", "Packets", "packets/s", 7001, update_every, RRDSET_TYPE_LINE);
139
st->isdetail = 1;
140
141
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -155,7 +155,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
155
if(ddo_errors) {
156
st = rrdset_find_bytype("net_errors", iface);
157
if(!st) {
158
- st = rrdset_create("net_errors", iface, NULL, iface, "Interface Errors", "errors/s", 1002, update_every, RRDSET_TYPE_LINE);
158
+ st = rrdset_create("net_errors", iface, NULL, iface, "net.errors", "Interface Errors", "errors/s", 7002, update_every, RRDSET_TYPE_LINE);
159
st->isdetail = 1;
160
161
rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -173,7 +173,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
173
if(ddo_drops) {
174
st = rrdset_find_bytype("net_drops", iface);
175
if(!st) {
176
- st = rrdset_create("net_drops", iface, NULL, iface, "Interface Drops", "drops/s", 1003, update_every, RRDSET_TYPE_LINE);
176
+ st = rrdset_create("net_drops", iface, NULL, iface, "net.drops", "Interface Drops", "drops/s", 7003, update_every, RRDSET_TYPE_LINE);
177
st->isdetail = 1;
178
179
rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -191,7 +191,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
191
if(ddo_fifo) {
192
st = rrdset_find_bytype("net_fifo", iface);
193
if(!st) {
194
- st = rrdset_create("net_fifo", iface, NULL, iface, "Interface FIFO Buffer Errors", "errors", 1100, update_every, RRDSET_TYPE_LINE);
194
+ st = rrdset_create("net_fifo", iface, NULL, iface, "net.fifo", "Interface FIFO Buffer Errors", "errors", 7004, update_every, RRDSET_TYPE_LINE);
195
st->isdetail = 1;
196
197
rrddim_add(st, "receive", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -209,7 +209,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
209
if(ddo_compressed) {
210
st = rrdset_find_bytype("net_compressed", iface);
211
if(!st) {
212
- st = rrdset_create("net_compressed", iface, NULL, iface, "Compressed Packets", "packets/s", 1200, update_every, RRDSET_TYPE_LINE);
212
+ st = rrdset_create("net_compressed", iface, NULL, iface, "net.compressed", "Compressed Packets", "packets/s", 7005, update_every, RRDSET_TYPE_LINE);
213
st->isdetail = 1;
214
215
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -227,7 +227,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
227
if(ddo_events) {
228
st = rrdset_find_bytype("net_events", iface);
229
if(!st) {
230
- st = rrdset_create("net_events", iface, NULL, iface, "Network Interface Events", "events/s", 1200, update_every, RRDSET_TYPE_LINE);
230
+ st = rrdset_create("net_events", iface, NULL, iface, "net.events", "Network Interface Events", "events/s", 7006, update_every, RRDSET_TYPE_LINE);
231
st->isdetail = 1;
232
233
rrddim_add(st, "frames", NULL, 1, 1, RRDDIM_INCREMENTAL);
src/proc_net_ip_vs_stats.c
+3
-3
@@ -54,7 +54,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) {
54
if(do_sockets) {
55
st = rrdset_find(RRD_TYPE_NET_IPVS ".sockets");
56
if(!st) {
57
- st = rrdset_create(RRD_TYPE_NET_IPVS, "sockets", NULL, RRD_TYPE_NET_IPVS, "IPVS New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE);
57
+ st = rrdset_create(RRD_TYPE_NET_IPVS, "sockets", NULL, RRD_TYPE_NET_IPVS, NULL, "IPVS New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE);
58
59
rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_INCREMENTAL);
60
}
@@ -69,7 +69,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) {
69
if(do_packets) {
70
st = rrdset_find(RRD_TYPE_NET_IPVS ".packets");
71
if(!st) {
72
- st = rrdset_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, "IPVS Packets", "packets/s", 1002, update_every, RRDSET_TYPE_LINE);
72
+ st = rrdset_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, NULL, "IPVS Packets", "packets/s", 1002, update_every, RRDSET_TYPE_LINE);
73
74
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
75
rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -86,7 +86,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) {
86
if(do_bandwidth) {
87
st = rrdset_find(RRD_TYPE_NET_IPVS ".net");
88
if(!st) {
89
- st = rrdset_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, "IPVS Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
89
+ st = rrdset_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, NULL, "IPVS Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
90
91
rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
92
rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
src/proc_net_netstat.c
+6
-6
@@ -77,7 +77,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
77
if(do_bandwidth) {
78
st = rrdset_find("system.ipv4");
79
if(!st) {
80
- st = rrdset_create("system", "ipv4", NULL, "ipv4", "IPv4 Bandwidth", "kilobits/s", 2000, update_every, RRDSET_TYPE_AREA);
80
+ st = rrdset_create("system", "ipv4", NULL, "network", NULL, "IPv4 Bandwidth", "kilobits/s", 500, update_every, RRDSET_TYPE_AREA);
81
82
rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
83
rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
@@ -94,7 +94,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
94
if(do_inerrors) {
95
st = rrdset_find("ipv4.inerrors");
96
if(!st) {
97
- st = rrdset_create("ipv4", "inerrors", NULL, "ipv4", "IPv4 Input Errors", "packets/s", 4000, update_every, RRDSET_TYPE_LINE);
97
+ st = rrdset_create("ipv4", "inerrors", NULL, "errors", NULL, "IPv4 Input Errors", "packets/s", 4000, update_every, RRDSET_TYPE_LINE);
98
st->isdetail = 1;
99
100
rrddim_add(st, "noroutes", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -112,7 +112,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
112
if(do_mcast) {
113
st = rrdset_find("ipv4.mcast");
114
if(!st) {
115
- st = rrdset_create("ipv4", "mcast", NULL, "ipv4", "IPv4 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
115
+ st = rrdset_create("ipv4", "mcast", NULL, "multicast", NULL, "IPv4 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
116
st->isdetail = 1;
117
118
rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
@@ -130,7 +130,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
130
if(do_bcast) {
131
st = rrdset_find("ipv4.bcast");
132
if(!st) {
133
- st = rrdset_create("ipv4", "bcast", NULL, "ipv4", "IPv4 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
133
+ st = rrdset_create("ipv4", "bcast", NULL, "broadcast", NULL, "IPv4 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
134
st->isdetail = 1;
135
136
rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
@@ -148,7 +148,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
148
if(do_mcast_p) {
149
st = rrdset_find("ipv4.mcastpkts");
150
if(!st) {
151
- st = rrdset_create("ipv4", "mcastpkts", NULL, "ipv4", "IPv4 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
151
+ st = rrdset_create("ipv4", "mcastpkts", NULL, "multicast", NULL, "IPv4 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
152
st->isdetail = 1;
153
154
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -166,7 +166,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
166
if(do_bcast_p) {
167
st = rrdset_find("ipv4.bcastpkts");
168
if(!st) {
169
- st = rrdset_create("ipv4", "bcastpkts", NULL, "ipv4", "IPv4 Broadcast Packets", "packets/s", 8500, update_every, RRDSET_TYPE_LINE);
169
+ st = rrdset_create("ipv4", "bcastpkts", NULL, "broadcast", NULL, "IPv4 Broadcast Packets", "packets/s", 8500, update_every, RRDSET_TYPE_LINE);
170
st->isdetail = 1;
171
172
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
src/proc_net_rpc_nfsd.c
+13
-13
@@ -420,7 +420,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
420
if(do_rc == 2) {
421
st = rrdset_find_bytype("nfsd", "readcache");
422
if(!st) {
423
- st = rrdset_create("nfsd", "readcache", NULL, "nfsd", "Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED);
423
+ st = rrdset_create("nfsd", "readcache", NULL, "nfsd", NULL, "Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED);
424
425
rrddim_add(st, "hits", NULL, 1, 1, RRDDIM_INCREMENTAL);
426
rrddim_add(st, "misses", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -439,7 +439,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
439
if(do_fh == 2) {
440
st = rrdset_find_bytype("nfsd", "filehandles");
441
if(!st) {
442
- st = rrdset_create("nfsd", "filehandles", NULL, "nfsd", "File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE);
442
+ st = rrdset_create("nfsd", "filehandles", NULL, "nfsd", NULL, "File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE);
443
st->isdetail = 1;
444
445
rrddim_add(st, "stale", NULL, 1, 1, RRDDIM_ABSOLUTE);
@@ -463,7 +463,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
463
if(do_io == 2) {
464
st = rrdset_find_bytype("nfsd", "io");
465
if(!st) {
466
- st = rrdset_create("nfsd", "io", NULL, "nfsd", "I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA);
466
+ st = rrdset_create("nfsd", "io", NULL, "nfsd", NULL, "I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA);
467
468
rrddim_add(st, "read", NULL, 1, 1000, RRDDIM_INCREMENTAL);
469
rrddim_add(st, "write", NULL, -1, 1000, RRDDIM_INCREMENTAL);
@@ -480,7 +480,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
480
if(do_th == 2) {
481
st = rrdset_find_bytype("nfsd", "threads");
482
if(!st) {
483
- st = rrdset_create("nfsd", "threads", NULL, "nfsd", "Threads", "threads", 5003, update_every, RRDSET_TYPE_LINE);
483
+ st = rrdset_create("nfsd", "threads", NULL, "nfsd", NULL, "Threads", "threads", 5003, update_every, RRDSET_TYPE_LINE);
484
485
rrddim_add(st, "threads", NULL, 1, 1, RRDDIM_ABSOLUTE);
486
}
@@ -491,7 +491,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
491
492
st = rrdset_find_bytype("nfsd", "threads_fullcnt");
493
if(!st) {
494
- st = rrdset_create("nfsd", "threads_fullcnt", NULL, "nfsd", "Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE);
494
+ st = rrdset_create("nfsd", "threads_fullcnt", NULL, "nfsd", NULL, "Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE);
495
496
rrddim_add(st, "full_count", NULL, 1, 1, RRDDIM_INCREMENTAL);
497
}
@@ -502,7 +502,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
502
503
st = rrdset_find_bytype("nfsd", "threads_histogram");
504
if(!st) {
505
- st = rrdset_create("nfsd", "threads_histogram", NULL, "nfsd", "Threads Usage Histogram", "percentage", 5005, update_every, RRDSET_TYPE_LINE);
505
+ st = rrdset_create("nfsd", "threads_histogram", NULL, "nfsd", NULL, "Threads Usage Histogram", "percentage", 5005, update_every, RRDSET_TYPE_LINE);
506
507
rrddim_add(st, "0%-10%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
508
rrddim_add(st, "10%-20%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
@@ -535,7 +535,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
535
if(do_ra == 2) {
536
st = rrdset_find_bytype("nfsd", "readahead");
537
if(!st) {
538
- st = rrdset_create("nfsd", "readahead", NULL, "nfsd", "Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED);
538
+ st = rrdset_create("nfsd", "readahead", NULL, "nfsd", NULL, "Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED);
539
540
rrddim_add(st, "10%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
541
rrddim_add(st, "20%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
@@ -573,7 +573,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
573
if(do_net == 2) {
574
st = rrdset_find_bytype("nfsd", "net");
575
if(!st) {
576
- st = rrdset_create("nfsd", "net", NULL, "nfsd", "Network Reads", "reads/s", 5007, update_every, RRDSET_TYPE_STACKED);
576
+ st = rrdset_create("nfsd", "net", NULL, "nfsd", NULL, "Network Reads", "reads/s", 5007, update_every, RRDSET_TYPE_STACKED);
577
st->isdetail = 1;
578
579
rrddim_add(st, "udp", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -595,7 +595,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
595
if(do_rpc == 2) {
596
st = rrdset_find_bytype("nfsd", "rpc");
597
if(!st) {
598
- st = rrdset_create("nfsd", "rpc", NULL, "nfsd", "Remote Procedure Calls", "calls/s", 5008, update_every, RRDSET_TYPE_LINE);
598
+ st = rrdset_create("nfsd", "rpc", NULL, "nfsd", NULL, "Remote Procedure Calls", "calls/s", 5008, update_every, RRDSET_TYPE_LINE);
599
st->isdetail = 1;
600
601
rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -619,7 +619,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
619
unsigned int i;
620
st = rrdset_find_bytype("nfsd", "proc2");
621
if(!st) {
622
- st = rrdset_create("nfsd", "proc2", NULL, "nfsd", "NFS v2 Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED);
622
+ st = rrdset_create("nfsd", "proc2", NULL, "nfsd", NULL, "NFS v2 Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED);
623
624
for(i = 0; nfsd_proc_values[i].present2 ; i++)
625
rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -638,7 +638,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
638
unsigned int i;
639
st = rrdset_find_bytype("nfsd", "proc3");
640
if(!st) {
641
- st = rrdset_create("nfsd", "proc3", NULL, "nfsd", "NFS v3 Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED);
641
+ st = rrdset_create("nfsd", "proc3", NULL, "nfsd", NULL, "NFS v3 Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED);
642
643
for(i = 0; nfsd_proc_values[i].present3 ; i++)
644
rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -657,7 +657,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
657
unsigned int i;
658
st = rrdset_find_bytype("nfsd", "proc4");
659
if(!st) {
660
- st = rrdset_create("nfsd", "proc4", NULL, "nfsd", "NFS v4 Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED);
660
+ st = rrdset_create("nfsd", "proc4", NULL, "nfsd", NULL, "NFS v4 Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED);
661
662
for(i = 0; nfsd_proc_values[i].present4 ; i++)
663
rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -676,7 +676,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
676
unsigned int i;
677
st = rrdset_find_bytype("nfsd", "proc4ops");
678
if(!st) {
679
- st = rrdset_create("nfsd", "proc4ops", NULL, "nfsd", "NFS v4 Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED);
679
+ st = rrdset_create("nfsd", "proc4ops", NULL, "nfsd", NULL, "NFS v4 Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED);
680
681
for(i = 0; nfsd4_ops_values[i].present ; i++)
682
rrddim_add(st, nfsd4_ops_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
src/proc_net_snmp.c
+10
-10
@@ -101,7 +101,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
101
if(do_ip_packets) {
102
st = rrdset_find(RRD_TYPE_NET_SNMP ".packets");
103
if(!st) {
104
- st = rrdset_create(RRD_TYPE_NET_SNMP, "packets", NULL, RRD_TYPE_NET_SNMP, "IPv4 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
104
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "packets", NULL, "packets", NULL, "IPv4 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
105
106
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
107
rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -120,7 +120,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
120
if(do_ip_fragsout) {
121
st = rrdset_find(RRD_TYPE_NET_SNMP ".fragsout");
122
if(!st) {
123
- st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
123
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, "fragments", NULL, "IPv4 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
124
st->isdetail = 1;
125
126
rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -140,7 +140,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
140
if(do_ip_fragsin) {
141
st = rrdset_find(RRD_TYPE_NET_SNMP ".fragsin");
142
if(!st) {
143
- st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
143
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, "fragments", NULL, "IPv4 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
144
st->isdetail = 1;
145
146
rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -160,7 +160,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
160
if(do_ip_errors) {
161
st = rrdset_find(RRD_TYPE_NET_SNMP ".errors");
162
if(!st) {
163
- st = rrdset_create(RRD_TYPE_NET_SNMP, "errors", NULL, RRD_TYPE_NET_SNMP, "IPv4 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
163
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "errors", NULL, "errors", NULL, "IPv4 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
164
st->isdetail = 1;
165
166
rrddim_add(st, "InDiscards", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -227,7 +227,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
227
if(do_tcp_sockets) {
228
st = rrdset_find(RRD_TYPE_NET_SNMP ".tcpsock");
229
if(!st) {
230
- st = rrdset_create(RRD_TYPE_NET_SNMP, "tcpsock", NULL, "tcp", "IPv4 TCP Connections", "active connections", 2500, update_every, RRDSET_TYPE_LINE);
230
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "tcpsock", NULL, "tcp", NULL, "IPv4 TCP Connections", "active connections", 2500, update_every, RRDSET_TYPE_LINE);
231
232
rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_ABSOLUTE);
233
}
@@ -242,7 +242,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
242
if(do_tcp_packets) {
243
st = rrdset_find(RRD_TYPE_NET_SNMP ".tcppackets");
244
if(!st) {
245
- st = rrdset_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", "IPv4 TCP Packets", "packets/s", 2600, update_every, RRDSET_TYPE_LINE);
245
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", NULL, "IPv4 TCP Packets", "packets/s", 2600, update_every, RRDSET_TYPE_LINE);
246
247
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
248
rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -259,7 +259,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
259
if(do_tcp_errors) {
260
st = rrdset_find(RRD_TYPE_NET_SNMP ".tcperrors");
261
if(!st) {
262
- st = rrdset_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", "IPv4 TCP Errors", "packets/s", 2700, update_every, RRDSET_TYPE_LINE);
262
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", NULL, "IPv4 TCP Errors", "packets/s", 2700, update_every, RRDSET_TYPE_LINE);
263
st->isdetail = 1;
264
265
rrddim_add(st, "InErrs", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -277,7 +277,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
277
if(do_tcp_handshake) {
278
st = rrdset_find(RRD_TYPE_NET_SNMP ".tcphandshake");
279
if(!st) {
280
- st = rrdset_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", "IPv4 TCP Handshake Issues", "events/s", 2900, update_every, RRDSET_TYPE_LINE);
280
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", NULL, "IPv4 TCP Handshake Issues", "events/s", 2900, update_every, RRDSET_TYPE_LINE);
281
st->isdetail = 1;
282
283
rrddim_add(st, "EstabResets", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -325,7 +325,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
325
if(do_udp_packets) {
326
st = rrdset_find(RRD_TYPE_NET_SNMP ".udppackets");
327
if(!st) {
328
- st = rrdset_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", "IPv4 UDP Packets", "packets/s", 2601, update_every, RRDSET_TYPE_LINE);
328
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", NULL, "IPv4 UDP Packets", "packets/s", 2601, update_every, RRDSET_TYPE_LINE);
329
330
rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
331
rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -342,7 +342,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
342
if(do_udp_errors) {
343
st = rrdset_find(RRD_TYPE_NET_SNMP ".udperrors");
344
if(!st) {
345
- st = rrdset_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", "IPv4 UDP Errors", "events/s", 2701, update_every, RRDSET_TYPE_LINE);
345
+ st = rrdset_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", NULL, "IPv4 UDP Errors", "events/s", 2701, update_every, RRDSET_TYPE_LINE);
346
st->isdetail = 1;
347
348
rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
src/proc_net_stat_conntrack.c
+6
-6
@@ -99,7 +99,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
99
if(do_sockets) {
100
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".sockets");
101
if(!st) {
102
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "sockets", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connections", "active connections", 1000, update_every, RRDSET_TYPE_LINE);
102
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "sockets", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter Connections", "active connections", 1000, update_every, RRDSET_TYPE_LINE);
103
104
rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_ABSOLUTE);
105
}
@@ -114,7 +114,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
114
if(do_new) {
115
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".new");
116
if(!st) {
117
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "new", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE);
117
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "new", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE);
118
119
rrddim_add(st, "new", NULL, 1, 1, RRDDIM_INCREMENTAL);
120
rrddim_add(st, "ignore", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -133,7 +133,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
133
if(do_changes) {
134
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".changes");
135
if(!st) {
136
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "changes", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Changes", "changes/s", 1002, update_every, RRDSET_TYPE_LINE);
136
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "changes", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter Connection Changes", "changes/s", 1002, update_every, RRDSET_TYPE_LINE);
137
st->isdetail = 1;
138
139
rrddim_add(st, "inserted", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -153,7 +153,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
153
if(do_expect) {
154
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".expect");
155
if(!st) {
156
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "expect", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Expectations", "expectations/s", 1003, update_every, RRDSET_TYPE_LINE);
156
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "expect", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter Connection Expectations", "expectations/s", 1003, update_every, RRDSET_TYPE_LINE);
157
st->isdetail = 1;
158
159
rrddim_add(st, "created", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -173,7 +173,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
173
if(do_search) {
174
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".search");
175
if(!st) {
176
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "search", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Searches", "searches/s", 1010, update_every, RRDSET_TYPE_LINE);
176
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "search", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter Connection Searches", "searches/s", 1010, update_every, RRDSET_TYPE_LINE);
177
st->isdetail = 1;
178
179
rrddim_add(st, "searched", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -193,7 +193,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
193
if(do_errors) {
194
st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".errors");
195
if(!st) {
196
- st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "errors", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Errors", "events/s", 1005, update_every, RRDSET_TYPE_LINE);
196
+ st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "errors", NULL, RRD_TYPE_NET_STAT_CONNTRACK, NULL, "Netfilter Errors", "events/s", 1005, update_every, RRDSET_TYPE_LINE);
197
st->isdetail = 1;
198
199
rrddim_add(st, "icmp_error", NULL, 1, 1, RRDDIM_INCREMENTAL);
src/proc_softirqs.c
+2
-5
@@ -104,7 +104,7 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
104
105
st = rrdset_find_bytype("system", "softirqs");
106
if(!st) {
107
- st = rrdset_create("system", "softirqs", NULL, "system", "System softirqs", "softirqs/s", 1001, update_every, RRDSET_TYPE_STACKED);
107
+ st = rrdset_create("system", "softirqs", NULL, "softirqs", NULL, "System softirqs", "softirqs/s", 950, update_every, RRDSET_TYPE_STACKED);
108
109
for(l = 0; l < lines ;l++) {
110
if(!irrs[l].used) continue;
@@ -123,9 +123,6 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
123
int c;
124
125
for(c = 0; c < cpus ; c++) {
126
- char family[256];
127
- snprintf(family, 256, "cpu%d", c);
128
-
126
char id[256];
127
snprintf(id, 256, "cpu%d_softirqs", c);
128
@@ -142,7 +139,7 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
139
char name[256], title[256];
140
snprintf(name, 256, "cpu%d_softirqs", c);
141
snprintf(title, 256, "CPU%d softirqs", c);
145
- st = rrdset_create("cpu", id, name, family, title, "softirqs/s", 3000 + c, update_every, RRDSET_TYPE_STACKED);
142
+ st = rrdset_create("cpu", id, name, "softirqs", "cpu.softirqs", title, "softirqs/s", 3000 + c, update_every, RRDSET_TYPE_STACKED);
143
144
for(l = 0; l < lines ;l++) {
145
if(!irrs[l].used) continue;
src/proc_stat.c
+10
-6
@@ -69,20 +69,24 @@ int do_proc_stat(int update_every, unsigned long long dt) {
69
70
char *title = "Core utilization";
71
char *type = RRD_TYPE_STAT;
72
+ char *context = "cpu.cpu";
73
+ char *family = "utilization";
74
long priority = 1000;
75
int isthistotal = 0;
76
77
if(strcmp(id, "cpu") == 0) {
78
isthistotal = 1;
77
- title = "Total CPU utilization";
79
type = "system";
80
+ title = "Total CPU utilization";
81
+ context = "system.cpu";
82
+ family = id;
83
priority = 100;
84
}
85
86
if((isthistotal && do_cpu) || (!isthistotal && do_cpu_cores)) {
87
st = rrdset_find_bytype(type, id);
88
if(!st) {
85
- st = rrdset_create(type, id, NULL, id, title, "percentage", priority, update_every, RRDSET_TYPE_STACKED);
89
+ st = rrdset_create(type, id, NULL, family, context, title, "percentage", priority, update_every, RRDSET_TYPE_STACKED);
90
91
long multiplier = 1;
92
long divisor = 1; // sysconf(_SC_CLK_TCK);
@@ -123,7 +127,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
127
if(do_interrupts) {
128
st = rrdset_find_bytype("system", "intr");
129
if(!st) {
126
- st = rrdset_create("system", "intr", NULL, "cpu", "CPU Interrupts", "interrupts/s", 900, update_every, RRDSET_TYPE_LINE);
130
+ st = rrdset_create("system", "intr", NULL, "interrupts", NULL, "CPU Interrupts", "interrupts/s", 900, update_every, RRDSET_TYPE_LINE);
131
st->isdetail = 1;
132
133
rrddim_add(st, "interrupts", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -142,7 +146,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
146
if(do_context) {
147
st = rrdset_find_bytype("system", "ctxt");
148
if(!st) {
145
- st = rrdset_create("system", "ctxt", NULL, "cpu", "CPU Context Switches", "context switches/s", 800, update_every, RRDSET_TYPE_LINE);
149
+ st = rrdset_create("system", "ctxt", NULL, "processes", NULL, "CPU Context Switches", "context switches/s", 800, update_every, RRDSET_TYPE_LINE);
150
151
rrddim_add(st, "switches", NULL, 1, 1, RRDDIM_INCREMENTAL);
152
}
@@ -168,7 +172,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
172
if(do_forks) {
173
st = rrdset_find_bytype("system", "forks");
174
if(!st) {
171
- st = rrdset_create("system", "forks", NULL, "cpu", "New Processes", "processes/s", 700, update_every, RRDSET_TYPE_LINE);
175
+ st = rrdset_create("system", "forks", NULL, "processes", NULL, "New Processes", "processes/s", 700, update_every, RRDSET_TYPE_LINE);
176
st->isdetail = 1;
177
178
rrddim_add(st, "started", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -184,7 +188,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
188
if(do_processes) {
189
st = rrdset_find_bytype("system", "processes");
190
if(!st) {
187
- st = rrdset_create("system", "processes", NULL, "cpu", "Processes", "processes", 600, update_every, RRDSET_TYPE_LINE);
191
+ st = rrdset_create("system", "processes", NULL, "processes", NULL, "Processes", "processes", 600, update_every, RRDSET_TYPE_LINE);
192
193
rrddim_add(st, "running", NULL, 1, 1, RRDDIM_ABSOLUTE);
194
rrddim_add(st, "blocked", NULL, -1, 1, RRDDIM_ABSOLUTE);
src/proc_sys_kernel_random_entropy_avail.c
+1
-1
@@ -29,7 +29,7 @@ int do_proc_sys_kernel_random_entropy_avail(int update_every, unsigned long long
29
30
RRDSET *st = rrdset_find_bytype("system", "entropy");
31
if(!st) {
32
- st = rrdset_create("system", "entropy", NULL, "system", "Available Entropy", "entropy", 1000, update_every, RRDSET_TYPE_LINE);
32
+ st = rrdset_create("system", "entropy", NULL, "cryptography", NULL, "Available Entropy", "entropy", 1000, update_every, RRDSET_TYPE_LINE);
33
rrddim_add(st, "entropy", NULL, 1, 1, RRDDIM_ABSOLUTE);
34
}
35
else rrdset_next(st);
src/proc_vmstat.c
+4
-4
@@ -164,7 +164,7 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
164
if(do_swapio) {
165
st = rrdset_find("system.swapio");
166
if(!st) {
167
- st = rrdset_create("system", "swapio", NULL, "mem", "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA);
167
+ st = rrdset_create("system", "swapio", NULL, "swap", NULL, "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA);
168
169
rrddim_add(st, "in", NULL, sysconf(_SC_PAGESIZE), 1024, RRDDIM_INCREMENTAL);
170
rrddim_add(st, "out", NULL, -sysconf(_SC_PAGESIZE), 1024, RRDDIM_INCREMENTAL);
@@ -181,7 +181,7 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
181
if(do_io) {
182
st = rrdset_find("system.io");
183
if(!st) {
184
- st = rrdset_create("system", "io", NULL, "disk", "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA);
184
+ st = rrdset_create("system", "io", NULL, "disk", NULL, "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA);
185
186
rrddim_add(st, "in", NULL, 1, 1, RRDDIM_INCREMENTAL);
187
rrddim_add(st, "out", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -196,9 +196,9 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
196
// --------------------------------------------------------------------
197
198
if(do_pgfaults) {
199
- st = rrdset_find("system.pgfaults");
199
+ st = rrdset_find("mem.pgfaults");
200
if(!st) {
201
- st = rrdset_create("system", "pgfaults", NULL, "mem", "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE);
201
+ st = rrdset_create("mem", "pgfaults", NULL, "system", NULL, "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE);
202
st->isdetail = 1;
203
204
rrddim_add(st, "minor", NULL, 1, 1, RRDDIM_INCREMENTAL);
src/rrd.c
+17
-4
@@ -335,8 +335,13 @@ void rrdset_reset(RRDSET *st)
335
}
336
}
337
338
-RRDSET *rrdset_create(const char *type, const char *id, const char *name, const char *family, const char *title, const char *units, long priority, int update_every, int chart_type)
338
+RRDSET *rrdset_create(const char *type, const char *id, const char *name, const char *family, const char *context, const char *title, const char *units, long priority, int update_every, int chart_type)
339
{
340
+ if(!type || !type[0]) {
341
+ fatal("Cannot create rrd stats without a type.");
342
+ return NULL;
343
+ }
344
+
345
if(!id || !id[0]) {
346
fatal("Cannot create rrd stats without an id.");
347
return NULL;
@@ -348,6 +353,12 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
353
354
snprintf(fullid, RRD_ID_LENGTH_MAX, "%s.%s", type, id);
355
356
+ st = rrdset_find(fullid);
357
+ if(st) {
358
+ error("Cannot create rrd stats for '%s', it already exists.", fullid);
359
+ return st;
360
+ }
361
+
362
long entries = config_get_number(fullid, "history", rrd_default_history_entries);
363
if(entries < 5) entries = config_set_number(fullid, "history", 5);
364
if(entries > RRD_HISTORY_ENTRIES_MAX) entries = config_set_number(fullid, "history", RRD_HISTORY_ENTRIES_MAX);
@@ -396,6 +407,7 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
407
st->name = NULL;
408
st->type = NULL;
409
st->family = NULL;
410
+ st->context = NULL;
411
st->title = NULL;
412
st->units = NULL;
413
st->dimensions = NULL;
@@ -422,10 +434,11 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
434
435
st->cache_dir = cache_dir;
436
425
- st->family = config_get(st->id, "family", family?family:st->id);
426
- st->units = config_get(st->id, "units", units?units:"");
427
- st->type = config_get(st->id, "type", type);
437
st->chart_type = rrdset_type_id(config_get(st->id, "chart type", rrdset_type_name(chart_type)));
438
+ st->type = config_get(st->id, "type", type);
439
+ st->family = config_get(st->id, "family", family?family:st->type);
440
+ st->context = config_get(st->id, "context", context?context:st->id);
441
+ st->units = config_get(st->id, "units", units?units:"");
442
443
st->priority = config_get_number(st->id, "priority", priority);
444
st->enabled = enabled;
src/rrd.h
+14
-4
@@ -22,8 +22,8 @@ extern int rrd_delete_unupdated_dimensions;
22
23
#define RRD_ID_LENGTH_MAX 1024
24
25
-#define RRDSET_MAGIC "NETDATA RRD SET FILE V016"
26
-#define RRDDIMENSION_MAGIC "NETDATA RRD DIMENSION FILE V016"
25
+#define RRDSET_MAGIC "NETDATA RRD SET FILE V017"
26
+#define RRDDIMENSION_MAGIC "NETDATA RRD DIMENSION FILE V017"
27
28
typedef long long total_number;
29
#define TOTAL_NUMBER_FORMAT "%lld"
@@ -182,7 +182,8 @@ struct rrdset {
182
// (the user overwrites the name of the charts)
183
184
char *type; // the type of graph RRD_TYPE_* (a category, for determining graphing options)
185
- char *family; // the family of this data set (for grouping them together)
185
+ char *family; // grouping sets under the same family
186
+ char *context; // the template of this data set
187
char *title; // title shown to user
188
char *units; // units of measurement
189
@@ -263,7 +264,16 @@ extern char *rrdset_cache_dir(const char *id);
264
265
extern void rrdset_reset(RRDSET *st);
266
266
-extern RRDSET *rrdset_create(const char *type, const char *id, const char *name, const char *family, const char *title, const char *units, long priority, int update_every, int chart_type);
267
+extern RRDSET *rrdset_create(const char *type
268
+ , const char *id
269
+ , const char *name
270
+ , const char *family
271
+ , const char *context
272
+ , const char *title
273
+ , const char *units
274
+ , long priority
275
+ , int update_every
276
+ , int chart_type);
277
278
extern void rrdset_free_all(void);
279
extern void rrdset_save_all(void);
src/rrd2json.c
+4
@@ -23,6 +23,7 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
23
"\t\t\t\"name\": \"%s\",\n"
24
"\t\t\t\"type\": \"%s\",\n"
25
"\t\t\t\"family\": \"%s\",\n"
26
+ "\t\t\t\"context\": \"%s\",\n"
27
"\t\t\t\"title\": \"%s\",\n"
28
"\t\t\t\"priority\": %ld,\n"
29
"\t\t\t\"enabled\": %s,\n"
@@ -38,6 +39,7 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
39
, st->name
40
, st->type
41
, st->family
42
+ , st->context
43
, st->title
44
, st->priority
45
, st->enabled?"true":"false"
@@ -122,6 +124,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
124
"\t\t\t\"name\": \"%s\",\n"
125
"\t\t\t\"type\": \"%s\",\n"
126
"\t\t\t\"family\": \"%s\",\n"
127
+ "\t\t\t\"context\": \"%s\",\n"
128
"\t\t\t\"title\": \"%s\",\n"
129
"\t\t\t\"priority\": %ld,\n"
130
"\t\t\t\"enabled\": %d,\n"
@@ -144,6 +147,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
147
, st->name
148
, st->type
149
, st->family
150
+ , st->context
151
, st->title
152
, st->priority
153
, st->enabled
src/sys_kernel_mm_ksm.c
+3
-3
@@ -105,7 +105,7 @@ int do_sys_kernel_mm_ksm(int update_every, unsigned long long dt) {
105
106
st = rrdset_find("mem.ksm");
107
if(!st) {
108
- st = rrdset_create("mem", "ksm", NULL, "ksm", "Kernel Same Page Merging", "MB", 5000, update_every, RRDSET_TYPE_AREA);
108
+ st = rrdset_create("mem", "ksm", NULL, "ksm", NULL, "Kernel Same Page Merging", "MB", 5000, update_every, RRDSET_TYPE_AREA);
109
110
rrddim_add(st, "shared", NULL, 1, 1024 * 1024, RRDDIM_ABSOLUTE);
111
rrddim_add(st, "unshared", NULL, -1, 1024 * 1024, RRDDIM_ABSOLUTE);
@@ -124,7 +124,7 @@ int do_sys_kernel_mm_ksm(int update_every, unsigned long long dt) {
124
125
st = rrdset_find("mem.ksm_savings");
126
if(!st) {
127
- st = rrdset_create("mem", "ksm_savings", NULL, "ksm", "Kernel Same Page Merging Savings", "MB", 5001, update_every, RRDSET_TYPE_AREA);
127
+ st = rrdset_create("mem", "ksm_savings", NULL, "ksm", NULL, "Kernel Same Page Merging Savings", "MB", 5001, update_every, RRDSET_TYPE_AREA);
128
129
rrddim_add(st, "savings", NULL, -1, 1024 * 1024, RRDDIM_ABSOLUTE);
130
rrddim_add(st, "offered", NULL, 1, 1024 * 1024, RRDDIM_ABSOLUTE);
@@ -137,7 +137,7 @@ int do_sys_kernel_mm_ksm(int update_every, unsigned long long dt) {
137
138
st = rrdset_find("mem.ksm_ratios");
139
if(!st) {
140
- st = rrdset_create("mem", "ksm_ratios", NULL, "ksm", "Kernel Same Page Merging Effectiveness", "percentage", 5002, update_every, RRDSET_TYPE_LINE);
140
+ st = rrdset_create("mem", "ksm_ratios", NULL, "ksm", NULL, "Kernel Same Page Merging Effectiveness", "percentage", 5002, update_every, RRDSET_TYPE_LINE);
141
142
rrddim_add(st, "savings", NULL, 1, 10000, RRDDIM_ABSOLUTE);
143
}
src/unit_test.c
+2
-2
@@ -617,7 +617,7 @@ int run_test(struct test *test)
617
snprintf(name, 100, "unittest-%s", test->name);
618
619
// create the chart
620
- RRDSET *st = rrdset_create("netdata", name, name, "netdata", "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
620
+ RRDSET *st = rrdset_create("netdata", name, name, "netdata", NULL, "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
621
RRDDIM *rd = rrddim_add(st, "dimension", NULL, test->multiplier, test->divisor, test->algorithm);
622
st->debug = 1;
623
@@ -714,7 +714,7 @@ int unit_test(long delay, long shift)
714
int do_abst = 0;
715
int do_absi = 0;
716
717
- RRDSET *st = rrdset_create("netdata", name, name, "netdata", "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
717
+ RRDSET *st = rrdset_create("netdata", name, name, "netdata", NULL, "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
718
st->debug = 1;
719
720
RRDDIM *rdabs = NULL;
web/dashboard.js
+1
-1
@@ -1982,7 +1982,7 @@
1982
1983
var c = $(this.element).data('colors');
1984
// this.log('read colors: ' + c);
1985
- if(typeof c !== 'undefined' && c !== null) {
1985
+ if(typeof c !== 'undefined' && c !== null && c.length > 0) {
1986
if(typeof c !== 'string') {
1987
this.log('invalid color given: ' + c + ' (give a space separated list of colors)');
1988
}
web/index.html
+652
-901
@@ -726,40 +726,6 @@ function sparkline(chart, dimension, units) {
726
return h;
727
}
728
729
-// documentation for each category and chart
730
-var messages = {
731
-
732
- // categories / sections
733
- 'system': 'Overview of the key system metrics.',
734
- 'tc': 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).',
735
- 'net': 'Per network interface statistics collected from <code>/proc/net/dev</code>.',
736
- 'apps': 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internaly builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported).<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning childs continiously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited childs of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealisting utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
737
-
738
- // charts
739
- 'system.cpu': 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.',
740
- 'system.io': 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.',
741
- 'system.swapio': 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).',
742
- 'system.pgfaults': 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.',
743
- 'system.entropy': '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.',
744
- 'system.forks': 'The number of new processes created per second, read from <code>/proc/stat</code>.',
745
- 'system.intr': 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.',
746
- 'system.interrupts': 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.',
747
- 'system.softirqs': 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.',
748
- 'system.processes': 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.',
749
- 'system.ctxt': '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.',
750
- 'system.idlejitter': 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The different between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in realtime environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).',
751
- 'system.ipv4': 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.',
752
- 'system.ram': 'System memory, read from <code>/proc/meminfo</code>.',
753
- 'system.swap': 'System swap memory, read from <code>/proc/meminfo</code>.',
754
-
755
- // just a line to allow ending all entries above with comma
756
- 'end': 'end'
757
-};
758
-
759
-function screenWidth() {
760
- return (($(window).width() * 0.95) - 50);
761
-}
762
-
729
function chartsPerRow(total) {
730
if(options.chartsPerRow === 0) {
731
width = Math.floor(total / options.chartsMinWidth);
@@ -769,249 +735,559 @@ function chartsPerRow(total) {
735
else return options.chartsPerRow;
736
}
737
772
-function chartsPrioritySort(a, b) {
773
- if(a.priority === b.priority) {
774
- if(a.name < b.name) return -1;
775
- }
776
- else if(a.priority < b.priority) return -1;
738
+function prioritySort(a, b) {
739
+ if(a.priority < b.priority) return -1;
740
+ if(a.priority > b.priority) return 1;
741
+ if(a.name < b.name) return -1;
742
return 1;
743
}
744
780
-function uniq(array, find_key, get_result) {
781
- if(typeof get_result === 'undefined' || get_result === null)
782
- get_result = find_key;
783
-
745
+function sortObjectByPriority(object) {
746
var idx = {};
785
- var result = new Array();
747
+ var sorted = new Array();
748
787
- $.each(array, function(i, c) {
788
- key = find_key(c);
789
- if(typeof idx[key] === 'undefined') {
790
- idx[key] = true;
791
- result.push(get_result(c));
749
+ for(var i in object) {
750
+ if(typeof idx[i] === 'undefined') {
751
+ idx[i] = object[i];
752
+ sorted.push(i);
753
}
793
- });
794
- return result;
795
-}
796
-
797
-function uniq_with_list(array, find_key_function) {
798
- var idx = {};
799
- var result = new Array();
754
+ }
755
801
- $.each(array, function(i, c) {
802
- key = find_key_function(c);
803
- if(typeof idx[key] === 'undefined') {
804
- idx[key] = new Array();
805
- result.push( { name: key, values: idx[key] } );
806
- }
807
- idx[key].push(c);
808
- });
809
- result.sort(function(a, b) {
810
- if(a.name < b.name) return -1;
756
+ sorted.sort(function(a, b) {
757
+ if(idx[a].priority < idx[b].priority) return -1;
758
+ if(idx[a].priority > idx[b].priority) return 1;
759
+ if(a < b) return -1;
760
return 1;
761
});
813
- return result;
762
+
763
+ return sorted;
764
}
765
816
-function prepareScreen(data) {
817
- // console.log('NETDATA is paused - ready to prepare the screen');
818
- // console.log(data);
766
+// ----------------------------------------------------------------------------
767
820
- options.data = data;
821
- options.hostname = data.hostname;
822
- document.getElementById('hostname').innerHTML = options.hostname;
823
- document.getElementById('hostname').href = NETDATA.serverDefault;
824
- document.title = options.hostname + ' dashboard';
825
- var charts = data.charts;
768
+function gaugeChart(title, width, dimensions, colors) {
769
+ if(typeof colors === 'undefined')
770
+ colors = '';
771
+
772
+ if(typeof dimensions === 'undefined')
773
+ dimensions = '';
774
+
775
+ return '<div data-netdata="CHART_UNIQUE_ID"'
776
+ + ' data-dimensions="' + dimensions + '"'
777
+ + ' data-chart-library="gauge"'
778
+ + ' data-gauge-adjust="width"'
779
+ + ' data-title="' + title + '"'
780
+ + ' data-width="' + width + '"'
781
+ + ' data-before="0"'
782
+ + ' data-after="-CHART_DURATION"'
783
+ + ' data-points="CHART_DURATION"'
784
+ + ' data-colors="' + colors + '"'
785
+ + ' role="application"></div>';
786
+}
787
827
- function name2id(s) {
828
- return s
829
- .replace(' ', '_')
830
- .replace('(', '_')
831
- .replace(')', '_')
832
- .replace('/', '_');
833
- }
788
+// ----------------------------------------------------------------------------
789
+
790
+var menuData = {
791
+ 'system': {
792
+ title: 'System Overview',
793
+ info: 'Overview of the key system metrics.'
794
+ },
795
+
796
+ 'ap': {
797
+ title: 'Access Points',
798
+ info: undefined
799
+ },
800
+
801
+ 'tc': {
802
+ title: 'Quality of Service',
803
+ info: 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).'
804
+ },
805
+
806
+ 'net': {
807
+ title: 'Network Interfaces',
808
+ info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
809
+ },
810
+
811
+ 'ipv4': {
812
+ title: 'IPv4 Networking',
813
+ info: undefined
814
+ },
815
+
816
+ 'ipvs': {
817
+ title: 'IP Virtual Server',
818
+ info: undefined
819
+ },
820
+
821
+ 'netfilter': {
822
+ title: 'Firewall (netfilter)',
823
+ info: undefined
824
+ },
825
+
826
+ 'cpu': {
827
+ title: 'CPUs',
828
+ info: undefined
829
+ },
830
+
831
+ 'mem': {
832
+ title: 'Memory',
833
+ info: undefined
834
+ },
835
+
836
+ 'disk': {
837
+ title: 'Disks',
838
+ info: undefined
839
+ },
840
+
841
+ 'sensors': {
842
+ title: 'Sensors',
843
+ info: undefined
844
+ },
845
+
846
+ 'nfsd': {
847
+ title: 'File Server (nfsd)',
848
+ info: undefined
849
+ },
850
+
851
+ 'apps': {
852
+ title: 'Applications',
853
+ info: 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internaly builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported).<br/><b>IMPORTANT</b>: The values shown here are not 100% accurate. They only include values for the processes running. If an application is spawning childs continiously, which are terminated in just a few milliseconds (like shell scripts do), the values reported will be inaccurate. Linux does report the values for the exited childs of a process. However, these values are reported to the parent process <b>only when the child exits</b>. If these values, of the exited child processes, were also aggregated in the charts below, the charts would have been full of spikes, presenting unrealisting utilization for each process group. So, we decided to ignore these values and present only the utilization of <b>the currently running processes</b>.',
854
+ height: 1.5
855
+ },
856
+
857
+ 'netdata': {
858
+ title: 'Netdata Monitoring',
859
+ info: undefined
860
+ },
861
+
862
+ 'example': {
863
+ title: 'Example Charts',
864
+ info: undefined
865
+ },
866
+};
867
835
- $.each(charts, function(i, c) {
836
- if(c.enabled === true) {
837
-
838
- // find the category of the chart
839
- c.category = c.type.split('.')[0];
840
-
841
- var tmp = c.category.split('_')[0];
842
- if(tmp === 'net' || tmp === 'disk' || tmp === 'ap')
843
- c.category = tmp;
844
-
845
- switch(c.category) {
846
- case 'system':
847
- c.category_priority = 10;
848
- c.category_title = 'System Summary';
849
- c.glyphicon = "glyphicon-dashboard";
850
- break;
851
-
852
- case 'tc':
853
- c.category_priority = 20;
854
- c.category_title = 'Quality Of Service';
855
- c.glyphicon = "glyphicon-random";
856
-
857
- // find the name of the interface from the tc family
858
- if(typeof options.interfaces_registry[c.family] === 'undefined' || options.interfaces_registry[c.family] === c.family)
859
- options.interfaces_registry[c.family] = c.name.split('.')[1].split('_')[0];
860
-
861
- break;
862
-
863
- case 'net':
864
- c.category_priority = 30;
865
- c.category_title = 'Network Interfaces';
866
- c.glyphicon = "glyphicon-transfer";
867
- break;
868
-
869
- case 'ap':
870
- c.category_priority = 35;
871
- c.category_title = 'Access Points';
872
- c.glyphicon = "glyphicon-transfer";
873
- break;
874
-
875
- case 'apps':
876
- c.category_priority = 40;
877
- c.category_title = 'Applications Monitoring';
878
- c.glyphicon = "glyphicon-tasks";
879
- break;
880
-
881
- case 'ipvs':
882
- c.category_priority = 50;
883
- c.category_title = 'IP Virtual Server';
884
- c.glyphicon = "glyphicon-transfer";
885
- break;
886
-
887
- case 'netfilter':
888
- c.category_priority = 60;
889
- c.category_title = 'Netfilter / IPTables';
890
- c.glyphicon = "glyphicon-cloud";
891
- break;
892
-
893
- case 'ipv4':
894
- c.category_priority = 70;
895
- c.category_title = 'IPv4 Summary';
896
- c.glyphicon = "glyphicon-globe";
897
- break;
898
-
899
- case 'mem':
900
- c.category_priority = 80;
901
- c.category_title = 'Memory';
902
- c.glyphicon = "glyphicon-dashboard";
903
- break;
904
-
905
- case 'cpu':
906
- c.category_priority = 90;
907
- c.category_title = 'CPU Cores';
908
- c.glyphicon = "glyphicon-dashboard";
909
-
910
- if(c.id.match(/^cpu\.cpu[0-9]+$/)) {
911
- c.family = 'Utilization';
912
- }
913
- else if(c.id.match(/^cpu\.cpu[0-9]+_interrupts$/)) {
914
- c.family = 'Interrupts';
915
- }
916
- else if(c.id.match(/^cpu\.cpu[0-9]+_softirqs$/)) {
917
- c.family = 'SoftIRQs';
918
- }
919
-
920
- break;
921
-
922
- case 'disk':
923
- c.category_priority = 100;
924
- c.category_title = 'Disks';
925
- c.glyphicon = "glyphicon-hdd";
926
- break;
927
-
928
- case 'nfsd':
929
- c.category_priority = 110;
930
- c.category_title = 'NFS Server';
931
- c.glyphicon = "glyphicon-hdd";
932
- break;
933
-
934
- case 'squid':
935
- c.category_priority = 140;
936
- c.category_title = 'Proxy Server';
937
- c.glyphicon = "glyphicon-link";
938
- break;
939
-
940
- case 'netdata':
941
- c.category_priority = 150;
942
- c.category_title = 'Netdata Monitoring';
943
- c.glyphicon = "glyphicon-thumbs-up";
944
- break;
945
-
946
- case 'sensors':
947
- c.category_priority = 160;
948
- c.category_title = 'Hardware Sensors';
949
- c.glyphicon = "glyphicon-thumbs-up";
950
- break;
951
-
952
- case 'postfix':
953
- c.category_priority = 170;
954
- c.category_title = 'Mail Server';
955
- c.glyphicon = "glyphicon-thumbs-up";
956
- break;
957
-
958
- case 'example':
959
- c.category_priority = 100000;
960
- c.category_title = 'Example Plugins';
961
- c.glyphicon = "glyphicon-search";
962
- break;
963
-
964
- default:
965
- c.category_priority = 150;
966
- c.category_title = c.type;
967
- c.glyphicon = "glyphicon-dashboard";
968
- break;
969
- }
868
+var submenuData = {
869
+ 'mem.ksm': {
870
+ title: 'Memory Deduper',
871
+ info: 'Kernel Same-page Merging (KSM) is the kernel memory de-duper.'
872
+ }
873
+};
874
971
- // find the unique categories
972
- if(typeof options.categories_idx[c.category] === 'undefined') {
973
- options.categories_idx[c.category] = {
974
- charts: new Array()
975
- }
976
- options.categories.push({
977
- name: c.category,
978
- title: c.category_title,
979
- priority: c.category_priority,
980
- glyphicon: c.glyphicon,
981
- charts: options.categories_idx[c.category].charts
982
- });
875
+var chartData = {
876
+ 'system.cpu': {
877
+ info: 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.'
878
+ },
879
+
880
+ 'system.load': {
881
+ info: 'Current system load read from <code>/proc/loadavg</code>.',
882
+ height: 0.7
883
+ },
884
+
885
+ 'system.io': {
886
+ info: 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.'
887
+ },
888
+
889
+ 'system.swapio': {
890
+ info: 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).'
891
+ },
892
+
893
+ 'system.pgfaults': {
894
+ info: 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.'
895
+ },
896
+
897
+ 'system.entropy': {
898
+ colors: '#CC22AA',
899
+ info: '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.'
900
+ },
901
+
902
+ 'system.forks': {
903
+ colors: '#5555DD',
904
+ info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
905
+ },
906
+
907
+ 'system.intr': {
908
+ colors: '#DD5555',
909
+ info: 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
910
+ },
911
+
912
+ 'system.interrupts': {
913
+ info: 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
914
+ },
915
+
916
+ 'system.softirqs': {
917
+ info: 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
918
+ },
919
+
920
+ 'system.processes': {
921
+ info: 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.'
922
+ },
923
+
924
+ 'system.ctxt': {
925
+ info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.'
926
+ },
927
+
928
+ 'system.idlejitter': {
929
+ colors: '#5555AA',
930
+ info: 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The different between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in realtime environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).'
931
+ },
932
+
933
+ 'system.ipv4': {
934
+ info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.'
935
+ },
936
+
937
+ 'system.ram': {
938
+ info: 'System memory, read from <code>/proc/meminfo</code>.'
939
+ },
940
+
941
+ 'system.swap': {
942
+ info: 'System swap memory, read from <code>/proc/meminfo</code>.'
943
+ },
944
+
945
+ 'mem.committed': {
946
+ colors: NETDATA.colors[3]
947
+ },
948
+
949
+ 'apps.cpu': {
950
+ height: 2.0
951
+ },
952
+
953
+ 'apps.preads': {
954
+ height: 2.0
955
+ },
956
+
957
+ 'apps.pwrites': {
958
+ height: 2.0
959
+ },
960
+
961
+ 'tc.qos': {
962
+ heads: [
963
+ function(id) {
964
+ if(id.match(/.*-ifb$/))
965
+ return gaugeChart('Inbound', '12%', '', '#5555AA');
966
+ else
967
+ return gaugeChart('Outbound', '12%', '', '#AA9900');
968
}
984
- options.categories_idx[c.category].charts.push(c);
985
-
986
- // find the unique families
987
- if(typeof options.families_idx[c.family] === 'undefined') {
988
- options.families_idx[c.family] = {
989
- charts: new Array()
990
- };
991
- options.families.push({
992
- name: c.family,
993
- title: c.family,
994
- priority: c.category_priority,
995
- glyphicon: c.glyphicon,
996
- charts: options.categories_idx[c.category].charts
997
- });
969
+ ]
970
+ },
971
+
972
+ 'net.net': {
973
+ heads: [
974
+ gaugeChart('Received', '12%', 'received'),
975
+ gaugeChart('Sent', '12%', 'sent')
976
+ ]
977
+ },
978
+
979
+ 'disk.util': {
980
+ colors: '#FF5588',
981
+ heads: [
982
+ gaugeChart('Utilization', '12%', '', '#FF5588')
983
+ ]
984
+ },
985
+
986
+ 'disk.backlog': {
987
+ colors: '#CCCC00'
988
+ },
989
+
990
+ 'disk.io': {
991
+ heads: [
992
+ gaugeChart('Read', '12%', 'reads'),
993
+ gaugeChart('Write', '12%', 'writes')
994
+ ]
995
+ },
996
+
997
+ 'netfilter.sockets': {
998
+ colors: '#88AA00',
999
+ heads: [
1000
+ gaugeChart('Active Connections', '12%', '', '#88AA00')
1001
+ ]
1002
+ },
1003
+
1004
+ 'netfilter.new': {
1005
+ heads: [
1006
+ gaugeChart('New Connections', '12%', '', '#5555AA')
1007
+ ]
1008
+ },
1009
+
1010
+ 'disk.iotime': {
1011
+ height: 0.5
1012
+ },
1013
+ 'disk.mops': {
1014
+ height: 0.5
1015
+ },
1016
+ 'disk.svctm': {
1017
+ height: 0.5
1018
+ },
1019
+ 'disk.avgsz': {
1020
+ height: 0.5
1021
+ },
1022
+ 'disk.await': {
1023
+ height: 0.5
1024
+ },
1025
+
1026
+ 'apache.connections': {
1027
+ colors: NETDATA.colors[4],
1028
+ mainheads: [
1029
+ gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1030
+ ]
1031
+ },
1032
+
1033
+ 'apache.requests': {
1034
+ colors: NETDATA.colors[0],
1035
+ mainheads: [
1036
+ gaugeChart('Connections', '12%', '', NETDATA.colors[0])
1037
+ ]
1038
+ },
1039
+
1040
+ 'apache.net': {
1041
+ colors: NETDATA.colors[3],
1042
+ mainheads: [
1043
+ gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
1044
+ ]
1045
+ },
1046
+
1047
+ 'apache.workers': {
1048
+ mainheads: [
1049
+ function(id) {
1050
+ return '<div data-netdata="' + id + '"'
1051
+ + ' data-dimensions="busy"'
1052
+ + ' data-append-options="percentage"'
1053
+ + ' data-gauge-max-value="100"'
1054
+ + ' data-chart-library="gauge"'
1055
+ + ' data-title="Workers Utilization"'
1056
+ + ' data-units="percentage %"'
1057
+ + ' data-gauge-adjust="width"'
1058
+ + ' data-width="12%"'
1059
+ + ' data-before="0"'
1060
+ + ' data-after="-CHART_DURATION"'
1061
+ + ' data-points="CHART_DURATION"'
1062
+ + ' role="application"></div>';
1063
}
999
- options.families_idx[c.family].charts.push(c);
1000
- }
1001
- });
1064
+ ]
1065
+ },
1066
+
1067
+ 'apache.bytesperreq': {
1068
+ colors: NETDATA.colors[3],
1069
+ height: 0.5
1070
+ },
1071
+
1072
+ 'apache.reqpersec': {
1073
+ colors: NETDATA.colors[4],
1074
+ height: 0.5
1075
+ },
1076
+
1077
+ 'apache.bytespersec': {
1078
+ colors: NETDATA.colors[6],
1079
+ height: 0.5
1080
+ },
1081
+
1082
+ 'nginx.connections': {
1083
+ colors: NETDATA.colors[4],
1084
+ mainheads: [
1085
+ gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1086
+ ]
1087
+ },
1088
+
1089
+ 'nginx.requests': {
1090
+ colors: NETDATA.colors[0],
1091
+ mainheads: [
1092
+ gaugeChart('Requests', '12%', '', NETDATA.colors[0])
1093
+ ]
1094
+ }
1095
+};
1096
1003
- function prioritySort(a, b) {
1004
- if(a.priority < b.priority) return -1;
1005
- if(a.priority > b.priority) return 1;
1006
- if(a.name < b.name) return -1;
1007
- return 1;
1097
+function anyAttribute(obj, attr, key, def) {
1098
+ if(typeof obj[key] !== 'undefined') {
1099
+ if(typeof obj[key][attr] !== 'undefined')
1100
+ return obj[key][attr];
1101
+ }
1102
+ return def;
1103
+}
1104
+
1105
+function menuTitle(menu) {
1106
+ return anyAttribute(menuData, 'title', menu, menu);
1107
+}
1108
+
1109
+function menuInfo(menu) {
1110
+ return anyAttribute(menuData, 'title', menu, null);
1111
+}
1112
+
1113
+function menuHeight(menu, relative) {
1114
+ return anyAttribute(menuData, 'height', menu, 1.0) * relative;
1115
+}
1116
+
1117
+function submenuTitle(menu, submenu) {
1118
+ var key = menu + '.' + submenu;
1119
+ return anyAttribute(submenuData, 'title', key, submenu);
1120
+}
1121
+
1122
+function submenuInfo(menu, submenu) {
1123
+ var key = menu + '.' + submenu;
1124
+ return anyAttribute(submenuData, 'info', key, null);
1125
+}
1126
+
1127
+function submenuHeight(menu, submenu, relative) {
1128
+ var key = menu + '.' + submenu;
1129
+ return anyAttribute(submenuData, 'height', key, 1.0) * relative;
1130
+}
1131
+
1132
+
1133
+function chartInfo(id) {
1134
+ if(typeof chartData[id] !== 'undefined' && typeof chartData[id].info !== 'undefined')
1135
+ return '<div class="chart-message netdata-chart-alignment" role="document">' + chartData[id].info + '</div>';
1136
+ else
1137
+ return '';
1138
+}
1139
+
1140
+function chartHeight(id, def) {
1141
+ if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
1142
+ return def * chartData[id].height;
1143
+ else
1144
+ return def;
1145
+}
1146
+
1147
+
1148
+// ----------------------------------------------------------------------------
1149
+
1150
+// enrich the data structure returned by netdata
1151
+// to reflect our menu system and content
1152
+function enrichChartData(chart) {
1153
+ // net_* and disk_* have special grouping
1154
+ if(chart.type.match(/^net_/))
1155
+ chart.menu = 'net';
1156
+ else if(chart.type.match(/^disk_/))
1157
+ chart.menu = 'disk';
1158
+ else
1159
+ chart.menu = chart.type;
1160
+
1161
+ // increase the priority of IFB devices
1162
+ if(chart.type === 'tc' && chart.id.match(/.*-ifb$/))
1163
+ chart.priority--;
1164
+
1165
+ chart.submenu = chart.family;
1166
+}
1167
+
1168
+// ----------------------------------------------------------------------------
1169
+
1170
+function name2id(s) {
1171
+ return s
1172
+ .replace(' ', '_')
1173
+ .replace('(', '_')
1174
+ .replace(')', '_')
1175
+ .replace('.', '_')
1176
+ .replace('/', '_');
1177
+}
1178
+
1179
+function headMain(charts, duration) {
1180
+ var head = '';
1181
+
1182
+ if(typeof charts['system.swap'] !== 'undefined')
1183
+ head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
1184
+ + ' data-dimensions="free"'
1185
+ + ' data-append-options="percentage"'
1186
+ + ' data-chart-library="easypiechart"'
1187
+ + ' data-title="Free Swap"'
1188
+ + ' data-units="%"'
1189
+ + ' data-easypiechart-max-value="100"'
1190
+ + ' data-width="8%"'
1191
+ + ' data-before="0"'
1192
+ + ' data-after="-' + duration.toString() + '"'
1193
+ + ' data-points="' + duration.toString() + '"'
1194
+ + ' data-colors="#DD4400"'
1195
+ + ' role="application"></div>';
1196
+
1197
+ if(typeof charts['system.io'] !== 'undefined') {
1198
+ head += '<div style="margin-right: 10px;" data-netdata="system.io"'
1199
+ + ' data-dimensions="in"'
1200
+ + ' data-chart-library="easypiechart"'
1201
+ + ' data-title="Disk Read"'
1202
+ + ' data-units="KB / s"'
1203
+ + ' data-width="10%"'
1204
+ + ' data-before="0"'
1205
+ + ' data-after="-' + duration.toString() + '"'
1206
+ + ' data-points="' + duration.toString() + '"'
1207
+ + ' role="application"></div>';
1208
+
1209
+ head += '<div style="margin-right: 10px;" data-netdata="system.io"'
1210
+ + ' data-dimensions="out"'
1211
+ + ' data-chart-library="easypiechart"'
1212
+ + ' data-title="Disk Write"'
1213
+ + ' data-units="KB / s"'
1214
+ + ' data-width="10%"'
1215
+ + ' data-before="0"'
1216
+ + ' data-after="-' + duration.toString() + '"'
1217
+ + ' data-points="' + duration.toString() + '"'
1218
+ + ' role="application"></div>';
1219
}
1220
1010
- // sort all of them
1011
- options.categories.sort(prioritySort);
1012
- options.families.sort(prioritySort);
1013
- $.each(options.families, function(i, c) { c.charts.sort(prioritySort); });
1221
+ if(typeof charts['system.cpu'] !== 'undefined')
1222
+ head += '<div data-netdata="system.cpu"'
1223
+ + ' data-chart-library="gauge"'
1224
+ + ' data-title="CPU"'
1225
+ + ' data-units="%"'
1226
+ + ' data-gauge-max-value="100"'
1227
+ + ' data-width="18%"'
1228
+ + ' data-after="-' + duration.toString() + '"'
1229
+ + ' data-points="' + duration.toString() + '"'
1230
+ + ' data-colors="' + NETDATA.colors[12] + '"'
1231
+ + ' role="application"></div>';
1232
+
1233
+ if(typeof charts['system.ipv4'] !== 'undefined') {
1234
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
1235
+ + ' data-dimensions="received"'
1236
+ + ' data-chart-library="easypiechart"'
1237
+ + ' data-title="IPv4 Inbound"'
1238
+ + ' data-units="kbps"'
1239
+ + ' data-width="10%"'
1240
+ + ' data-before="0"'
1241
+ + ' data-after="-' + duration.toString() + '"'
1242
+ + ' data-points="' + duration.toString() + '"'
1243
+ + ' role="application"></div>';
1244
+
1245
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
1246
+ + ' data-dimensions="sent"'
1247
+ + ' data-chart-library="easypiechart"'
1248
+ + ' data-title="IPv4 Outbound"'
1249
+ + ' data-units="kbps"'
1250
+ + ' data-width="10%"'
1251
+ + ' data-before="0"'
1252
+ + ' data-after="-' + duration.toString() + '"'
1253
+ + ' data-points="' + duration.toString() + '"'
1254
+ + ' role="application"></div>';
1255
+ }
1256
1257
+ if(typeof charts['system.ram'] !== 'undefined')
1258
+ head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
1259
+ + ' data-dimensions="cached|free"'
1260
+ + ' data-append-options="percentage"'
1261
+ + ' data-chart-library="easypiechart"'
1262
+ + ' data-title="Available RAM"'
1263
+ + ' data-units="%"'
1264
+ + ' data-easypiechart-max-value="100"'
1265
+ + ' data-width="8%"'
1266
+ + ' data-after="-' + duration.toString() + '"'
1267
+ + ' data-points="' + duration.toString() + '"'
1268
+ + ' data-colors="' + NETDATA.colors[7] + '"'
1269
+ + ' role="application"></div>';
1270
+
1271
+ return head;
1272
+}
1273
+
1274
+function generateHeadCharts(type, chart, duration) {
1275
+ var head = '';
1276
+ var hcharts = anyAttribute(chartData, type, chart.context, []);
1277
+ if(hcharts.length > 0) {
1278
+ var hi = 0, hlen = hcharts.length;
1279
+ while(hi < hlen) {
1280
+ if(typeof hcharts[hi] === 'function')
1281
+ head += hcharts[hi](chart.id).replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
1282
+ else
1283
+ head += hcharts[hi].replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
1284
+ hi++;
1285
+ }
1286
+ }
1287
+ return head;
1288
+}
1289
+
1290
+function renderPage(menus, data) {
1291
var div = document.getElementById('charts_div');
1292
var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
1293
@@ -1019,661 +1295,155 @@ function prepareScreen(data) {
1295
var duration = Math.round(($(div).width() * pcent_width / 100 * data.update_every / 3) / 60) * 60;
1296
var html = '';
1297
var sidebar = '<ul class="nav dashboard-sidenav" data-spy="affix" id="sidebar_ul">';
1298
+ var mainhead = headMain(data.charts, duration);
1299
1023
- function getMessage(id) {
1024
- if(typeof messages[id] !== 'undefined')
1025
- return '<div class="chart-message" role="document">' + messages[id] + '</div>';
1026
- else
1027
- return '';
1028
- }
1300
+ // sort the menus
1301
+ var main = sortObjectByPriority(menus);
1302
+ var i = 0, len = main.length;
1303
+ while(i < len) {
1304
+ var menu = main[i++];
1305
1030
- // render the charts
1031
- $.each(options.categories, function(i, t) {
1032
- t.charts.sort(prioritySort);
1033
-
1034
- sidebar += '<li class="' + ((i === 0)?'active':'').toString() + '"><a href="#' + name2id(t.name) + '">' + t.title + '</a>';
1035
- html += '<div role="section"><div role="sectionhead"><h1 id="' + name2id(t.name) + '" role="heading">' + t.title + '</h1>' + getMessage(t.name) + '</div><div id="' + name2id(t.name) + '" role="document">';
1036
-
1037
- if(t.name === 'cpu') {
1038
- var families = uniq_with_list(t.charts, function(c) { return c.family; });
1039
-
1040
- sidebar += '<ul class="nav">';
1041
- $.each(families, function(j, c) {
1042
- sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + c.name + '</a></li>';
1043
- html += '<div class="netdata-group-container" id="family_' + name2id(t.name) + '_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(t.name) + '_' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + c.name + '</h2>';
1044
- $.each(c.values, function(x, f) {
1045
- var c = null;
1046
- var h = options.chartsHeight;
1047
-
1048
- html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1049
- + ' data-width="100%"'
1050
- + ' data-height="' + h.toString() + 'px"'
1051
- + ' data-before="0"'
1052
- + ' data-after="-' + duration.toString() + '"'
1053
- + ' data-colors="' + c + '"'
1054
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1055
- + ' role="application"></div>';
1056
- });
1057
- html += '</div>'; // netdata-group-container
1058
- });
1059
- sidebar += '</ul>';
1060
- }
1061
- else if(t.name === 'net' || t.name === 'tc' || t.name === 'ap') {
1062
- var interfaces = uniq_with_list(t.charts, function(c) { return c.family; });
1063
-
1064
- sidebar += '<ul class="nav">';
1065
- $.each(interfaces, function(j, c) {
1066
- var menuitem = c.name;
1067
- var name = options.interfaces_registry[menuitem];
1068
- if(typeof name !== 'undefined' && name !== menuitem)
1069
- menuitem = menuitem + ' (' + name + ')';
1070
-
1071
- sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + menuitem + '</a></li>';
1072
- html += '<div class="netdata-group-container" id="interface_' + name2id(t.name) + '_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(t.name) + '_' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + menuitem + '</h2>';
1073
-
1074
- var head = '<div style="width: 100%; text-align: center;">';
1075
- var all = '';
1076
-
1077
- $.each(c.values, function(x, f) {
1078
- var c = null;
1079
- var h = options.chartsHeight / 2;
1080
- switch(f.type) {
1081
- case 'net':
1082
- h = options.chartsHeight;
1083
-
1084
- head += '<div data-netdata="' + f.id + '"'
1085
- + ' data-dimensions="received"'
1086
- + ' data-chart-library="gauge"'
1087
- + ' data-gauge-adjust="width"'
1088
- + ' data-title="Receive"'
1089
- + ' data-width="12%"'
1090
- + ' data-before="0"'
1091
- + ' data-after="-' + duration.toString() + '"'
1092
- + ' data-points="' + duration.toString() + '"'
1093
- + ' role="application"></div>';
1306
+ // generate an entry at the main menu
1307
1095
- head += '<div data-netdata="' + f.id + '"'
1096
- + ' data-dimensions="sent"'
1097
- + ' data-chart-library="gauge"'
1098
- + ' data-gauge-adjust="width"'
1099
- + ' data-title="Sent"'
1100
- + ' data-width="12%"'
1101
- + ' data-before="0"'
1102
- + ' data-after="-' + duration.toString() + '"'
1103
- + ' data-points="' + duration.toString() + '"'
1104
- + ' role="application"></div>';
1105
- break;
1106
-
1107
- case 'tc':
1108
- h = options.chartsHeight;
1109
- if(f.id.match(/.*-ifb$/) !== null)
1110
- head += '<div data-netdata="' + f.id + '"'
1111
- + ' data-chart-library="gauge"'
1112
- + ' data-gauge-adjust="width"'
1113
- + ' data-title="Receive"'
1114
- + ' data-width="12%"'
1115
- + ' data-before="0"'
1116
- + ' data-after="-' + duration.toString() + '"'
1117
- + ' data-points="' + duration.toString() + '"'
1118
- + ' data-colors="' + NETDATA.colors[2] + '"'
1119
- + ' role="application"></div>';
1120
-
1121
- else
1122
- head += '<div data-netdata="' + f.id + '"'
1123
- + ' data-chart-library="gauge"'
1124
- + ' data-gauge-adjust="width"'
1125
- + ' data-title="Sent"'
1126
- + ' data-width="12%"'
1127
- + ' data-before="0"'
1128
- + ' data-after="-' + duration.toString() + '"'
1129
- + ' data-points="' + duration.toString() + '"'
1130
- + ' data-colors="' + NETDATA.colors[3] + '"'
1131
- + ' role="application"></div>';
1132
- break;
1133
- case 'ap_bandwidth': h = options.chartsHeight; break;
1134
- case 'ap_bitrate' : h = options.chartsHeight; break;
1135
- }
1136
-
1137
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1138
- + ' data-width="100%"'
1139
- + ' data-height="' + h.toString() + 'px"'
1140
- + ' data-before="0"'
1141
- + ' data-after="-' + duration.toString() + '"'
1142
- + ' data-colors="' + c + '"'
1143
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1144
- + ' role="application"></div>';
1145
- });
1146
-
1147
- head += '</div>';
1148
- html += head + all + '</div>'; // netdata-group-container
1149
- });
1150
- sidebar += '</ul>';
1151
- }
1152
- else if(t.name === 'disk') {
1153
- var disks = uniq_with_list(t.charts, function(c) { return c.family; });
1154
-
1155
- sidebar += '<ul class="nav">';
1156
- $.each(disks, function(j, c) {
1157
- sidebar += '<li class><a href="#' + name2id(c.name) + '">' + c.name + '</a></li>';
1158
- html += '<div class="netdata-group-container" id="disk_' + name2id(c.name) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(c.name) + '" class="netdata-chart-alignment" role="heading">' + c.name + '</h2>';
1159
- var head = '<div style="width: 100%; text-align: center;">';
1160
- var all = '';
1161
- $.each(c.values, function(x, f) {
1162
- var c = null;
1163
- var h = options.chartsHeight / 2;
1164
- switch(f.type) {
1165
- case 'disk' : h = options.chartsHeight;
1166
- head += '<div data-netdata="' + f.id + '"'
1167
- + ' data-dimensions="reads"'
1168
- + ' data-chart-library="gauge"'
1169
- + ' data-gauge-adjust="width"'
1170
- + ' data-title="Read"'
1171
- + ' data-width="12%"'
1172
- + ' data-before="0"'
1173
- + ' data-after="-' + duration.toString() + '"'
1174
- + ' data-points="' + duration.toString() + '"'
1175
- + ' role="application"></div>';
1176
-
1177
- head += '<div data-netdata="' + f.id + '"'
1178
- + ' data-dimensions="writes"'
1179
- + ' data-chart-library="gauge"'
1180
- + ' data-gauge-adjust="width"'
1181
- + ' data-title="Write"'
1182
- + ' data-width="12%"'
1183
- + ' data-before="0"'
1184
- + ' data-after="-' + duration.toString() + '"'
1185
- + ' data-points="' + duration.toString() + '"'
1186
- + ' role="application"></div>';
1187
- break;
1188
- case 'disk_backlog': c = '#CCCC00'; break;
1189
- case 'disk_util' : c = '#FF5588';
1190
- head += '<div data-netdata="' + f.id + '"'
1191
- + ' data-chart-library="gauge"'
1192
- + ' data-title="Utilization"'
1193
- + ' data-gauge-max-value="100"'
1194
- + ' data-gauge-adjust="width"'
1195
- + ' data-width="12%"'
1196
- + ' data-before="0"'
1197
- + ' data-after="-' + duration.toString() + '"'
1198
- + ' data-points="' + duration.toString() + '"'
1199
- + ' data-colors="' + c + '"'
1200
- + ' role="application"></div>';
1201
- break;
1202
- case 'disk_qops' : c = '#5555FF'; break;
1203
- }
1204
-
1205
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1206
- + ' data-width="100%"'
1207
- + ' data-height="' + h.toString() + 'px"'
1208
- + ' data-before="0"'
1209
- + ' data-after="-' + duration.toString() + '"'
1210
- + ' data-colors="' + c + '"'
1211
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1212
- + ' role="application"></div>';
1213
- });
1214
- head += '</div>';
1215
- html += head + all + '</div>'; // netdata-group-container
1216
- });
1217
- sidebar += '</ul>';
1218
- }
1219
- else if(t.name === 'apps') {
1220
- $.each(t.charts, function(x, f) {
1221
- var c = null;
1222
- var h = Math.round(options.chartsHeight * 1.5);
1223
- switch(f.id) {
1224
- case 'apps.cpu' : h = Math.round(options.chartsHeight * 2); break;
1225
- case 'apps.preads' : h = Math.round(options.chartsHeight * 2); break;
1226
- case 'apps.pwrites' : h = Math.round(options.chartsHeight * 2); break;
1227
- case 'apps.mem' : h = Math.round(options.chartsHeight * 2); break;
1228
- case 'apps.major_faults': h = Math.round(options.chartsHeight * 2); break;
1229
- }
1230
-
1231
- html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1232
- + ' data-width="100%"'
1233
- + ' data-height="' + h.toString() + 'px"'
1234
- + ' data-before="0"'
1235
- + ' data-after="-' + duration.toString() + '"'
1236
- + ' data-colors="' + c + '"'
1237
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1238
- + ' role="application"></div>';
1239
- });
1240
- }
1241
- else if(t.name === 'system') {
1242
- var head = '<div style="text-align: center; vertical-align: bottom; width: 100%;">';
1243
-
1244
- if(typeof charts['system.swap'] !== 'undefined')
1245
- head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
1246
- + ' data-dimensions="free"'
1247
- + ' data-append-options="percentage"'
1248
- + ' data-chart-library="easypiechart"'
1249
- + ' data-title="Free Swap"'
1250
- + ' data-units="%"'
1251
- + ' data-easypiechart-max-value="100"'
1252
- + ' data-width="8%"'
1253
- + ' data-before="0"'
1254
- + ' data-after="-' + duration.toString() + '"'
1255
- + ' data-points="' + duration.toString() + '"'
1256
- + ' data-colors="' + NETDATA.colors[1] + '"'
1257
- + ' role="application"></div>';
1258
-
1259
- if(typeof charts['system.io'] !== 'undefined') {
1260
- head += '<div style="margin-right: 10px;" data-netdata="system.io"'
1261
- + ' data-dimensions="in"'
1262
- + ' data-chart-library="easypiechart"'
1263
- + ' data-title="Disk Read"'
1264
- + ' data-units="KB / s"'
1265
- + ' data-width="10%"'
1266
- + ' data-before="0"'
1267
- + ' data-after="-' + duration.toString() + '"'
1268
- + ' data-points="' + duration.toString() + '"'
1269
- + ' role="application"></div>';
1270
-
1271
- head += '<div style="margin-right: 10px;" data-netdata="system.io"'
1272
- + ' data-dimensions="out"'
1273
- + ' data-chart-library="easypiechart"'
1274
- + ' data-title="Disk Write"'
1275
- + ' data-units="KB / s"'
1276
- + ' data-width="10%"'
1277
- + ' data-before="0"'
1278
- + ' data-after="-' + duration.toString() + '"'
1279
- + ' data-points="' + duration.toString() + '"'
1280
- + ' role="application"></div>';
1281
- }
1308
+ sidebar += '<li class=""><a href="#' + menu + '">' + menus[menu].title + '</a><ul class="nav">';
1309
+ html += '<div role="section"><div role="sectionhead"><h1 id="' + menu + '" role="heading">' + menus[menu].title + '</h1></div><div id="' + menu + '" role="document">';
1310
1283
- if(typeof charts['system.cpu'] !== 'undefined')
1284
- head += '<div data-netdata="system.cpu"'
1285
- + ' data-chart-library="gauge"'
1286
- + ' data-title="CPU"'
1287
- + ' data-units="%"'
1288
- + ' data-gauge-max-value="100"'
1289
- + ' data-width="18%"'
1290
- + ' data-after="-' + duration.toString() + '"'
1291
- + ' data-points="' + duration.toString() + '"'
1292
- + ' data-colors="' + NETDATA.colors[12] + '"'
1293
- + ' role="application"></div>';
1294
-
1295
- if(typeof charts['system.ipv4'] !== 'undefined') {
1296
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
1297
- + ' data-dimensions="received"'
1298
- + ' data-chart-library="easypiechart"'
1299
- + ' data-title="IPv4 Inbound"'
1300
- + ' data-units="kbps"'
1301
- + ' data-width="10%"'
1302
- + ' data-before="0"'
1303
- + ' data-after="-' + duration.toString() + '"'
1304
- + ' data-points="' + duration.toString() + '"'
1305
- + ' role="application"></div>';
1306
-
1307
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
1308
- + ' data-dimensions="sent"'
1309
- + ' data-chart-library="easypiechart"'
1310
- + ' data-title="IPv4 Outbound"'
1311
- + ' data-units="kbps"'
1312
- + ' data-width="10%"'
1313
- + ' data-before="0"'
1314
- + ' data-after="-' + duration.toString() + '"'
1315
- + ' data-points="' + duration.toString() + '"'
1316
- + ' role="application"></div>';
1317
- }
1311
+ if(menus[menu].info !== null)
1312
+ html += menus[menu].info;
1313
1319
- if(typeof charts['system.ram'] !== 'undefined')
1320
- head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
1321
- + ' data-dimensions="cached|free"'
1322
- + ' data-append-options="percentage"'
1323
- + ' data-chart-library="easypiechart"'
1324
- + ' data-title="Available RAM"'
1325
- + ' data-units="%"'
1326
- + ' data-easypiechart-max-value="100"'
1327
- + ' data-width="8%"'
1328
- + ' data-after="-' + duration.toString() + '"'
1329
- + ' data-points="' + duration.toString() + '"'
1330
- + ' data-colors="' + NETDATA.colors[7] + '"'
1331
- + ' role="application"></div>';
1332
-
1333
-/* if(typeof charts['system.swapio'] !== 'undefined') {
1334
- head += "<div style=\"display: inline-block\">";
1335
-
1336
- head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
1337
- + ' data-dimensions="in"'
1338
- + ' data-chart-library="easypiechart"'
1339
- + ' data-title="Swap Read"'
1340
- + ' data-width="100px"'
1341
- + ' data-before="0"'
1342
- + ' data-after="-' + duration.toString() + '"'
1343
- + ' data-points="' + duration.toString() + '"'
1344
- + ' data-colors="' + NETDATA.colors[2] + '"'
1345
- + ' role="application"></div>';
1346
-
1347
- head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
1348
- + ' data-dimensions="out"'
1349
- + ' data-chart-library="easypiechart"'
1350
- + ' data-title="Swap Write"'
1351
- + ' data-width="100px"'
1352
- + ' data-before="0"'
1353
- + ' data-after="-' + duration.toString() + '"'
1354
- + ' data-points="' + duration.toString() + '"'
1355
- + ' data-colors="' + NETDATA.colors[1] + '"'
1356
- + ' role="application"></div>';
1357
-
1358
- head += "</div>";
1359
- }
1314
+ // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
1315
1361
- if(typeof charts['system.ctxt'] !== 'undefined')
1362
- head += '<div style="margin-right: 10px;" data-netdata="system.ctxt"'
1363
- + ' data-chart-library="easypiechart"'
1364
- + ' data-title="Switches"'
1365
- + ' data-width="100px"'
1366
- + ' data-before="0"'
1367
- + ' data-after="-' + duration.toString() + '"'
1368
- + ' data-points="' + duration.toString() + '"'
1369
- + ' data-colors="' + NETDATA.colors[3] + '"'
1370
- + ' role="application"></div>';
1371
-
1372
- if(typeof charts['system.intr'] !== 'undefined')
1373
- head += '<div style="margin-right: 10px;" data-netdata="system.intr"'
1374
- + ' data-chart-library="easypiechart"'
1375
- + ' data-title="Interrupts"'
1376
- + ' data-width="100px"'
1377
- + ' data-before="0"'
1378
- + ' data-after="-' + duration.toString() + '"'
1379
- + ' data-points="' + duration.toString() + '"'
1380
- + ' data-colors="' + NETDATA.colors[7] + '"'
1381
- + ' role="application"></div>';
1382
-*/
1383
- head += "</div>";
1384
- var all = '';
1385
- $.each(t.charts, function(x, f) {
1386
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1387
- + ' data-width="' + pcent_width.toString() + '%"'
1388
- + ' data-height="' + options.chartsHeight.toString() + 'px"'
1389
- + ' data-before="0"'
1390
- + ' data-after="-' + duration.toString() + '"'
1391
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1392
- + ' role="application"></div>';
1393
- });
1394
- html += head + all;
1395
- }
1396
- else if(t.name === 'netdata') {
1397
- var head = '<div style="width: 100%; text-align: center;">';
1398
- var all = '';
1316
+ var shtml = '';
1317
+ var mhead = '<div style="width: 100%; text-align: center;">' + mainhead;
1318
+ mainhead = '';
1319
1400
- $.each(t.charts, function(x, f) {
1401
- switch(f.id) {
1402
- case 'netdata.net' :
1403
- head += '<div data-netdata="' + f.id + '"'
1404
- + ' data-dimensions="in"'
1405
- + ' data-chart-library="gauge"'
1406
- + ' data-title="Received"'
1407
- + ' data-gauge-adjust="width"'
1408
- + ' data-width="12%"'
1409
- + ' data-before="0"'
1410
- + ' data-after="-' + duration.toString() + '"'
1411
- + ' data-points="' + duration.toString() + '"'
1412
- + ' data-colors="' + NETDATA.colors[0] + '"'
1413
- + ' role="application"></div>';
1320
+ // sort the submenus of this menu
1321
+ var sub = sortObjectByPriority(menus[menu].submenus);
1322
+ var si = 0, slen = sub.length;
1323
+ while(si < slen) {
1324
+ var submenu = sub[si++];
1325
1415
- head += '<div data-netdata="' + f.id + '"'
1416
- + ' data-dimensions="out"'
1417
- + ' data-chart-library="gauge"'
1418
- + ' data-title="Sent"'
1419
- + ' data-gauge-adjust="width"'
1420
- + ' data-width="12%"'
1421
- + ' data-before="0"'
1422
- + ' data-after="-' + duration.toString() + '"'
1423
- + ' data-points="' + duration.toString() + '"'
1424
- + ' data-colors="' + NETDATA.colors[1] + '"'
1425
- + ' role="application"></div>';
1426
- break;
1326
+ // generate an entry at the submenu
1327
+ sidebar += '<li class><a href="#' + name2id(menu + '_' + submenu) + '">' + menus[menu].submenus[submenu].title + '</a></li>';
1328
+ shtml += '<div class="netdata-group-container" id="submenu_' + name2id(menu + '_' + submenu) + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + name2id(menu + '_' + submenu) + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
1329
1428
- case 'netdata.requests' : c = NETDATA.colors[2];
1429
- head += '<div data-netdata="' + f.id + '"'
1430
- + ' data-chart-library="gauge"'
1431
- + ' data-title="Requests / second"'
1432
- + ' data-gauge-adjust="width"'
1433
- + ' data-width="12%"'
1434
- + ' data-before="0"'
1435
- + ' data-after="-' + duration.toString() + '"'
1436
- + ' data-points="' + duration.toString() + '"'
1437
- + ' data-colors="' + c + '"'
1438
- + ' role="application"></div>';
1439
- break;
1440
-
1441
- case 'netdata.clients' : c = NETDATA.colors[3];
1442
- head += '<div data-netdata="' + f.id + '"'
1443
- + ' data-chart-library="gauge"'
1444
- + ' data-title="Connections"'
1445
- + ' data-gauge-adjust="width"'
1446
- + ' data-width="12%"'
1447
- + ' data-before="0"'
1448
- + ' data-after="-' + duration.toString() + '"'
1449
- + ' data-points="' + duration.toString() + '"'
1450
- + ' data-colors="' + c + '"'
1451
- + ' role="application"></div>';
1452
- break;
1453
- }
1330
+ if(menus[menu].submenus[submenu].info !== null)
1331
+ shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
1332
1455
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1456
- + ' data-width="' + pcent_width.toString() + '%"'
1457
- + ' data-height="' + options.chartsHeight.toString() + 'px"'
1458
- + ' data-before="0"'
1459
- + ' data-after="-' + duration.toString() + '"'
1460
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1461
- + ' role="application"></div>';
1462
- });
1463
- head += '</div>';
1464
- html += head + all;
1465
- }
1466
- else if(t.name === 'netfilter') {
1333
var head = '<div style="width: 100%; text-align: center;">';
1468
- var all = '';
1334
+ var chtml = '';
1335
1470
- $.each(t.charts, function(x, f) {
1471
- switch(f.id) {
1472
- case 'netfilter.sockets' :
1473
- head += '<div data-netdata="' + f.id + '"'
1474
- + ' data-chart-library="gauge"'
1475
- + ' data-title="Active Connections"'
1476
- + ' data-units="connections"'
1477
- + ' data-gauge-adjust="width"'
1478
- + ' data-width="12%"'
1479
- + ' data-before="0"'
1480
- + ' data-after="-' + duration.toString() + '"'
1481
- + ' data-points="' + duration.toString() + '"'
1482
- + ' data-colors="' + NETDATA.colors[0] + '"'
1483
- + ' role="application"></div>';
1484
- break;
1336
+ // console.log(' \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
1337
1486
- case 'netfilter.new':
1487
- head += '<div data-netdata="' + f.id + '"'
1488
- + ' data-dimensions="new"'
1489
- + ' data-chart-library="gauge"'
1490
- + ' data-title="New Connections"'
1491
- + ' data-gauge-adjust="width"'
1492
- + ' data-width="12%"'
1493
- + ' data-before="0"'
1494
- + ' data-after="-' + duration.toString() + '"'
1495
- + ' data-points="' + duration.toString() + '"'
1496
- + ' data-colors="' + NETDATA.colors[2] + '"'
1497
- + ' role="application"></div>';
1498
- break;
1499
- }
1338
+ // sort the charts in this submenu of this menu
1339
+ menus[menu].submenus[submenu].charts.sort(prioritySort);
1340
+ var ci = 0, clen = menus[menu].submenus[submenu].charts.length;
1341
+ while(ci < clen) {
1342
+ var chart = menus[menu].submenus[submenu].charts[ci++];
1343
+
1344
+ // generate the submenu heading charts
1345
+ mhead += generateHeadCharts('mainheads', chart, duration);
1346
+ head += generateHeadCharts('heads', chart, duration);
1347
1501
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1348
+ // generate the chart
1349
+ chtml += chartInfo(chart.context) + '<div data-netdata="' + chart.id + '"'
1350
+ ' data-width="' + pcent_width.toString() + '%"'
1503
- + ' data-height="' + options.chartsHeight.toString() + 'px"'
1351
+ + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
1352
+ ' data-before="0"'
1353
+ ' data-after="-' + duration.toString() + '"'
1506
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1354
+ + ' data-id="' + name2id(options.hostname + '/' + chart.id) + '"'
1355
+ + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
1356
+ ' role="application"></div>';
1508
- });
1357
+
1358
+ // console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
1359
+ }
1360
+
1361
head += '</div>';
1510
- html += head + all;
1362
+ shtml += head + chtml + '</div>';
1363
}
1512
- else if(t.name === 'apache') {
1513
- var head = '<div style="width: 100%; text-align: center;">';
1514
- var all = '';
1515
-
1516
- $.each(t.charts, function(x, f) {
1517
- var c = 'null';
1518
- var h = options.chartsHeight;
1519
- switch(f.id) {
1520
- case 'apache.connections':
1521
- c = NETDATA.colors[4];
1522
- head += '<div data-netdata="' + f.id + '"'
1523
- + ' data-chart-library="gauge"'
1524
- + ' data-title="Connections"'
1525
- + ' data-gauge-adjust="width"'
1526
- + ' data-width="12%"'
1527
- + ' data-before="0"'
1528
- + ' data-after="-' + duration.toString() + '"'
1529
- + ' data-points="' + duration.toString() + '"'
1530
- + ' data-colors="' + c + '"'
1531
- + ' role="application"></div>';
1532
- break;
1364
1534
- case 'apache.requests':
1535
- head += '<div data-netdata="' + f.id + '"'
1536
- + ' data-chart-library="gauge"'
1537
- + ' data-title="Requests"'
1538
- + ' data-gauge-adjust="width"'
1539
- + ' data-width="12%"'
1540
- + ' data-before="0"'
1541
- + ' data-after="-' + duration.toString() + '"'
1542
- + ' data-points="' + duration.toString() + '"'
1543
- + ' data-colors="' + NETDATA.colors[0] + '"'
1544
- + ' role="application"></div>';
1545
- break;
1365
+ mhead += '</div>';
1366
+ sidebar += '</ul></li>';
1367
+ html += mhead + shtml + '</div></div><hr role="separator"/>';
1368
+ }
1369
1547
- case 'apache.net':
1548
- c = NETDATA.colors[1];
1549
- head += '<div data-netdata="' + f.id + '"'
1550
- + ' data-chart-library="gauge"'
1551
- + ' data-title="Bandwidth"'
1552
- + ' data-gauge-adjust="width"'
1553
- + ' data-width="12%"'
1554
- + ' data-before="0"'
1555
- + ' data-after="-' + duration.toString() + '"'
1556
- + ' data-points="' + duration.toString() + '"'
1557
- + ' data-colors="' + c + '"'
1558
- + ' role="application"></div>';
1559
- break;
1370
+ sidebar += '</ul>';
1371
+ div.innerHTML = html;
1372
+ document.getElementById('sidebar').innerHTML = sidebar;
1373
+ finalizePage();
1374
+}
1375
1561
- case 'apache.workers':
1562
- head += '<div data-netdata="' + f.id + '"'
1563
- + ' data-dimensions="busy"'
1564
- + ' data-append-options="percentage"'
1565
- + ' data-gauge-max-value="100"'
1566
- + ' data-chart-library="gauge"'
1567
- + ' data-title="Workers Utilization"'
1568
- + ' data-units="percentage %"'
1569
- + ' data-gauge-adjust="width"'
1570
- + ' data-width="12%"'
1571
- + ' data-before="0"'
1572
- + ' data-after="-' + duration.toString() + '"'
1573
- + ' data-points="' + duration.toString() + '"'
1574
- + ' data-colors="' + NETDATA.colors[2] + '"'
1575
- + ' role="application"></div>';
1576
- break;
1376
+function renderChartsAndMenu(data) {
1377
+ var menus = {};
1378
+ var charts = data.charts;
1379
1578
- case 'apache.bytesperreq':
1579
- c = NETDATA.colors[3];
1580
- h = Math.round(h / 2);
1581
- break;
1380
+ for(var c in charts) {
1381
+ enrichChartData(charts[c]);
1382
+
1383
+ // create the menu
1384
+ if(typeof menus[charts[c].menu] === 'undefined') {
1385
+ menus[charts[c].menu] = {
1386
+ priority: charts[c].priority,
1387
+ submenus: {},
1388
+ title: menuTitle(charts[c].menu),
1389
+ info: menuInfo(charts[c].menu),
1390
+ height: menuHeight(charts[c].menu, options.chartsHeight)
1391
+ };
1392
+ }
1393
+
1394
+ if(charts[c].priority < menus[charts[c].menu].priority)
1395
+ menus[charts[c].menu].priority = charts[c].priority;
1396
+
1397
+ // create the submenu
1398
+ if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
1399
+ menus[charts[c].menu].submenus[charts[c].submenu] = {
1400
+ priority: charts[c].priority,
1401
+ charts: new Array(),
1402
+ title: submenuTitle(charts[c].menu, charts[c].submenu),
1403
+ info: submenuInfo(charts[c].menu, charts[c].submenu),
1404
+ height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
1405
+ };
1406
+ }
1407
+
1408
+ if(charts[c].priority < menus[charts[c].menu].submenus[charts[c].submenu].priority)
1409
+ menus[charts[c].menu].submenus[charts[c].submenu].priority = charts[c].priority;
1410
1583
- default:
1584
- h = Math.round(h / 2);
1585
- break;
1586
- }
1411
+ // index the chart in the menu/submenu
1412
+ menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
1413
+ }
1414
1588
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1589
- + ' data-width="' + pcent_width.toString() + '%"'
1590
- + ' data-height="' + h.toString() + 'px"'
1591
- + ' data-before="0"'
1592
- + ' data-after="-' + duration.toString() + '"'
1593
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1594
- + ' data-colors="' + c + '"'
1595
- + ' role="application"></div>';
1596
- });
1597
- head += '</div>';
1598
- html += head + all;
1599
- }
1600
- else if(t.name === 'nginx') {
1601
- var head = '<div style="width: 100%; text-align: center;">';
1602
- var all = '';
1603
- $.each(t.charts, function(x, f) {
1604
- var c = 'null';
1605
- var h = options.chartsHeight;
1606
-
1607
- switch(f.id) {
1608
- case 'nginx.connections':
1609
- c = NETDATA.colors[4];
1610
- head += '<div data-netdata="' + f.id + '"'
1611
- + ' data-chart-library="gauge"'
1612
- + ' data-title="Connections"'
1613
- + ' data-gauge-adjust="width"'
1614
- + ' data-width="12%"'
1615
- + ' data-before="0"'
1616
- + ' data-after="-' + duration.toString() + '"'
1617
- + ' data-points="' + duration.toString() + '"'
1618
- + ' data-colors="' + c + '"'
1619
- + ' role="application"></div>';
1620
- break;
1415
+ renderPage(menus, data);
1416
+}
1417
1622
- case 'nginx.requests':
1623
- head += '<div data-netdata="' + f.id + '"'
1624
- + ' data-chart-library="gauge"'
1625
- + ' data-title="Requests"'
1626
- + ' data-gauge-adjust="width"'
1627
- + ' data-width="12%"'
1628
- + ' data-before="0"'
1629
- + ' data-after="-' + duration.toString() + '"'
1630
- + ' data-points="' + duration.toString() + '"'
1631
- + ' data-colors="' + NETDATA.colors[0] + '"'
1632
- + ' role="application"></div>';
1633
- break;
1634
- }
1418
+function downloadAllCharts(netdata_url) {
1419
+ if(typeof netdata_url === 'undefined' || netdata_url === null)
1420
+ netdata_url = NETDATA.serverDefault;
1421
1636
- all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1637
- + ' data-width="' + pcent_width.toString() + '%"'
1638
- + ' data-height="' + h.toString() + 'px"'
1639
- + ' data-before="0"'
1640
- + ' data-after="-' + duration.toString() + '"'
1641
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1642
- + ' data-colors="' + c + '"'
1643
- + ' role="application"></div>';
1644
- });
1645
- head += '</div>';
1646
- html += head + all;
1647
- }
1648
- else {
1649
- $.each(t.charts, function(x, f) {
1650
- html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
1651
- + ' data-width="' + pcent_width.toString() + '%"'
1652
- + ' data-height="' + options.chartsHeight.toString() + 'px"'
1653
- + ' data-before="0"'
1654
- + ' data-after="-' + duration.toString() + '"'
1655
- + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
1656
- + ' role="application"></div>';
1657
- });
1658
- }
1422
+ NETDATA.pause(function() {
1423
1660
- sidebar += '</li>';
1661
- html += '</div>'; // document
1662
- html += '</div>'; // section
1663
- html += '<hr role="separator"/>';
1664
- });
1665
- sidebar += '</ul>';
1666
-/*
1667
- // show the colors
1668
- html += '<br/><div class="row">'
1669
- $.each(NETDATA.colors, function(i, c){
1670
- html += '<div style="display: inline-block;"><div style="display: inline-block; width: 100px; height: 100px; background: ' + c + ';"></div><br/>' + c + '</div>';
1424
+ // download all the charts the server knows
1425
+ NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
1426
+
1427
+ options.data = data;
1428
+ options.hostname = data.hostname;
1429
+ document.getElementById('hostname').innerHTML = options.hostname;
1430
+ document.getElementById('hostname').href = NETDATA.serverDefault;
1431
+ document.title = options.hostname + ' dashboard';
1432
+
1433
+ renderChartsAndMenu(data);
1434
+
1435
+ // prepare our DOM
1436
+// prepareScreen(data);
1437
+
1438
+ // due to affix issues, prepareScreen() will unpause
1439
+ // netdata as needed
1440
+ });
1441
});
1672
- html += '</div>'
1673
-*/
1674
- div.innerHTML = html;
1675
- document.getElementById('sidebar').innerHTML = sidebar;
1676
-
1442
+}
1443
+
1444
+// ----------------------------------------------------------------------------
1445
+
1446
+function finalizePage() {
1447
// resize all charts - without starting the background thread
1448
// this has to be done while NETDATA is paused
1449
// if we ommit this, the affix menu will be wrong, since all
@@ -1765,25 +1535,6 @@ function prepareScreen(data) {
1535
}, 1000);
1536
}
1537
1768
-NETDATA.pause(function() {
1769
-
1770
-// $('#welcomeModal').on('hidden.bs.modal', function (e) {
1771
-// NETDATA.updatedDom();
1772
-// });
1773
-// $('#welcomeModal').on('shown.bs.modal', function (e) {
1774
-// NETDATA.updatedDom();
1775
-// });
1776
-
1777
- // download all the charts the server knows
1778
- NETDATA.chartRegistry.downloadAll(NETDATA.serverDefault, function(data) {
1779
-
1780
- // prepare our DOM
1781
- // this will be called when NETDATA is paused
1782
- prepareScreen(data);
1783
-
1784
- // due to affix issues, prepareScreen() will unpause
1785
- // netdata as needed
1786
- });
1787
-});
1538
+downloadAllCharts();
1539
1540
</script>