]> arthur.barton.de Git - netdata.git/commitdiff
added a new element on all charts: context, which is the template upon the chart...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 7 Feb 2016 23:22:58 +0000 (01:22 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 7 Feb 2016 23:22:58 +0000 (01:22 +0200)
46 files changed:
charts.d/ap.chart.sh
charts.d/apache.chart.sh
charts.d/cpu_apps.chart.sh
charts.d/cpufreq.chart.sh
charts.d/example.chart.sh
charts.d/load_average.chart.sh
charts.d/mem_apps.chart.sh
charts.d/mysql.chart.sh
charts.d/nginx.chart.sh
charts.d/nut.chart.sh
charts.d/opensips.chart.sh
charts.d/postfix.chart.sh
charts.d/sensors.chart.sh
charts.d/squid.chart.sh
node.d/named.node.js
node.d/node_modules/netdata.js
node.d/sma_webbox.node.js
node.d/snmp.node.js
plugins.d/charts.d.plugin
src/apps_plugin.c
src/main.c
src/plugin_checks.c
src/plugin_idlejitter.c
src/plugin_proc.c
src/plugin_tc.c
src/plugins_d.c
src/proc_diskstats.c
src/proc_interrupts.c
src/proc_meminfo.c
src/proc_net_dev.c
src/proc_net_ip_vs_stats.c
src/proc_net_netstat.c
src/proc_net_rpc_nfsd.c
src/proc_net_snmp.c
src/proc_net_stat_conntrack.c
src/proc_softirqs.c
src/proc_stat.c
src/proc_sys_kernel_random_entropy_avail.c
src/proc_vmstat.c
src/rrd.c
src/rrd.h
src/rrd2json.c
src/sys_kernel_mm_ksm.c
src/unit_test.c
web/dashboard.js
web/index.html

index 0a9a884a901d49dbbf616d58848bc0b3b001ba94..4704b89de3bc11af8190da820a757dae3b9fef62 100755 (executable)
@@ -3,6 +3,7 @@
 # _update_every is a special variable - it holds the number of seconds
 # between the calls of the _update() function
 ap_update_every=
+ap_priority=6900
 
 declare -A ap_devs=()
 
@@ -53,25 +54,25 @@ ap_create() {
 
                # create the chart with 3 dimensions
                cat <<EOF
-CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ${dev} line 15000 $ap_update_every
+CHART ap_clients.${dev} '' "Connected clients to ${ssid} on ${dev}" "clients" ${dev} ap.clients line $[ap_priority + 1] $ap_update_every
 DIMENSION clients '' absolute 1 1
 
-CHART ap_bandwidth.${dev} '' "Bandwidth for ${ssid} on ${dev}" "kilobits/s" ${dev} ${dev} area 15001 $ap_update_every
+CHART ap_bandwidth.${dev} '' "Bandwidth for ${ssid} on ${dev}" "kilobits/s" ${dev} ap.net area $[ap_priority + 2] $ap_update_every
 DIMENSION received '' incremental 8 1024
 DIMENSION sent '' incremental -8 1024
 
-CHART ap_packets.${dev} '' "Packets for ${ssid} on ${dev}" "packets/s" ${dev} ${dev} line 15002 $ap_update_every
+CHART ap_packets.${dev} '' "Packets for ${ssid} on ${dev}" "packets/s" ${dev} ap.packets line $[ap_priority + 3] $ap_update_every
 DIMENSION received '' incremental 1 1
 DIMENSION sent '' incremental -1 1
 
-CHART ap_issues.${dev} '' "Transmit Issues for ${ssid} on ${dev}" "issues/s" ${dev} ${dev} line 15003 $ap_update_every
+CHART ap_issues.${dev} '' "Transmit Issues for ${ssid} on ${dev}" "issues/s" ${dev} ap.issues line $[ap_priority + 4] $ap_update_every
 DIMENSION retries 'tx retries' incremental 1 1
 DIMENSION failures 'tx failures' incremental -1 1
 
-CHART ap_signal.${dev} '' "Average Signal for ${ssid} on ${dev}" "dBm" ${dev} ${dev} line 15004 $ap_update_every
+CHART ap_signal.${dev} '' "Average Signal for ${ssid} on ${dev}" "dBm" ${dev} ap.signal line $[ap_priority + 5] $ap_update_every
 DIMENSION signal 'average signal' absolute 1 1
 
-CHART ap_bitrate.${dev} '' "Bitrate for ${ssid} on ${dev}" "Mbps" ${dev} ${dev} line 15005 $ap_update_every
+CHART ap_bitrate.${dev} '' "Bitrate for ${ssid} on ${dev}" "Mbps" ${dev} ap.bitrate line $[ap_priority + 6] $ap_update_every
 DIMENSION receive '' absolute 1 1000
 DIMENSION transmit '' absolute -1 1000
 DIMENSION expected 'expected throughput' absolute 1 1000
index 20c59afabb152a4a74094385c9445f437b8f46f4..efa559ddbc952d4ead96321a899d55b6a755ebd8 100755 (executable)
@@ -7,6 +7,8 @@ apache_url="http://127.0.0.1:80/server-status?auto"
 # between the calls of the _update() function
 apache_update_every=
 
+apache_priority=60000
+
 # convert apache floating point values
 # to integer using this multiplier
 # this only affects precision - the values
@@ -165,27 +167,27 @@ apache_check() {
 # _create is called once, to create the charts
 apache_create() {
        cat <<EOF
-CHART apache.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" apache apache area 16008 $apache_update_every
+CHART apache.bytesperreq '' "apache Lifetime Avg. Response Size" "bytes/request" statistics apache.bytesperreq area $[apache_priority + 8] $apache_update_every
 DIMENSION size '' absolute 1 ${apache_decimal_detail}
-CHART apache.workers '' "apache Workers" "workers" apache apache stacked 16005 $apache_update_every
+CHART apache.workers '' "apache Workers" "workers" workers apache.workers stacked $[apache_priority + 5] $apache_update_every
 DIMENSION idle '' absolute 1 1
 DIMENSION busy '' absolute 1 1
-CHART apache.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" apache apache line 16006 $apache_update_every
+CHART apache.reqpersec '' "apache Lifetime Avg. Requests/s" "requests/s" statistics apache.reqpersec line $[apache_priority + 6] $apache_update_every
 DIMENSION requests '' absolute 1 ${apache_decimal_detail}
-CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" apache apache area 16007 $apache_update_every
+CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" statistics apache.bytespersec area $[apache_priority + 7] $apache_update_every
 DIMENSION sent '' absolute 8 $[apache_decimal_detail * 1000]
-CHART apache.requests '' "apache Requests" "requests/s" apache apache line 16001 $apache_update_every
+CHART apache.requests '' "apache Requests" "requests/s" requests apache.requests line $[apache_priority + 1] $apache_update_every
 DIMENSION requests '' incremental 1 1
-CHART apache.net '' "apache Bandwidth" "kilobits/s" apache apache area 16003 $apache_update_every
+CHART apache.net '' "apache Bandwidth" "kilobits/s" bandwidth apache.net area $[apache_priority + 3] $apache_update_every
 DIMENSION sent '' incremental 8 1
 EOF
 
        if [ ${apache_has_conns} -eq 1 ]
                then
                cat <<EOF2
-CHART apache.connections '' "apache Connections" "connections" apache apache line 16002 $apache_update_every
+CHART apache.connections '' "apache Connections" "connections" connections apache.connections line $[apache_priority + 2] $apache_update_every
 DIMENSION connections '' absolute 1 1
-CHART apache.conns_async '' "apache Async Connections" "connections" apache apache stacked 16004 $apache_update_every
+CHART apache.conns_async '' "apache Async Connections" "connections" connections apache.conns_async stacked $[apache_priority + 4] $apache_update_every
 DIMENSION keepalive '' absolute 1 1
 DIMENSION closing '' absolute 1 1
 DIMENSION writing '' absolute 1 1
index 879cbbddd32c58a1d5c4ebdadf1f51154897ef8e..5a25163e1398ee4dda91c26bb1b3405f7a15229f 100755 (executable)
@@ -29,7 +29,7 @@ cpu_apps_bc_finalze=
 
 cpu_apps_create() {
 
-       echo "CHART apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
+       echo "CHART chartsd_apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
 
        local x=
        for x in $cpu_apps_apps
@@ -48,7 +48,7 @@ cpu_apps_update() {
        # for each dimension
        # remember: KEEP IT SIMPLE AND SHORT
 
-       echo "BEGIN apps.cpu"
+       echo "BEGIN chartsd_apps.cpu"
        ps -o pid,comm -C "$cpu_apps_apps" |\
                grep -v "COMMAND" |\
                (
index 1fce11e3f9bba0285e869a6cdf4b24233a5232ec..6a968237de75983fe5c924a6a99e32adfff22e61 100755 (executable)
@@ -10,6 +10,7 @@ cpufreq_source_update=1
 # _update_every is a special variable - it holds the number of seconds
 # between the calls of the _update() function
 cpufreq_update_every=
+cpufreq_priority=10000
 
 cpufreq_find_all_files() {
        find $1 -maxdepth $cpufreq_sys_depth -name scaling_cur_freq 2>/dev/null
@@ -35,8 +36,8 @@ cpufreq_create() {
        # - the highest speed we can achieve -
        [ $cpufreq_source_update -eq 1 ] && echo >$TMP_DIR/cpufreq.sh "cpufreq_update() {"
 
-       echo "CHART sensors.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line 7000 $cpufreq_update_every"
-       echo >>$TMP_DIR/cpufreq.sh "echo \"BEGIN sensors.cpufreq \$1\""
+       echo "CHART cpu.cpufreq '' 'CPU Clock' 'MHz' 'cpufreq' '' line $[cpufreq_priority + 1] $cpufreq_update_every"
+       echo >>$TMP_DIR/cpufreq.sh "echo \"BEGIN cpu.cpufreq \$1\""
 
        i=0
        for file in $( cpufreq_find_all_files $cpufreq_sys_dir | sort -u )
index 7e07ccf47f16f81ea9bec32bc316b99c9c6d5c1e..641d03e5de3f889125e0280880dd4f5bd6066ad1 100755 (executable)
@@ -7,6 +7,8 @@
 # between the calls of the _update() function
 example_update_every=
 
+example_priority=150000
+
 # _check is called once, to find out if this chart should be enabled or not
 example_check() {
        # this should return:
@@ -20,11 +22,11 @@ example_check() {
 example_create() {
        # create the chart with 3 dimensions
        cat <<EOF
-CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked 5000 $example_update_every
+CHART example.random '' "Random Numbers Stacked Chart" "% of random numbers" random random stacked $[example_priority] $example_update_every
 DIMENSION random1 '' percentage-of-absolute-row 1 1
 DIMENSION random2 '' percentage-of-absolute-row 1 1
 DIMENSION random3 '' percentage-of-absolute-row 1 1
-CHART example.random2 '' "A random number" "random number" random random area 5001 $example_update_every
+CHART example.random2 '' "A random number" "random number" random random area $[example_priority + 1] $example_update_every
 DIMENSION random '' absolute 1 1
 EOF
 
index 6e5d5e05728aceabe6c68125645354d60dc8d78f..8cc5af6ec6c98895e69a4ffe851d362b5d034f77 100755 (executable)
@@ -1,19 +1,27 @@
 #!/bin/sh
 
-load_average_update_every=
+load_average_update_every=5
+load_priority=100
 
 load_average_check() {
        # this should return:
        #  - 0 to enable the chart
        #  - 1 to disable the chart
 
+       if [ ${load_average_update_every} -lt 5 ]
+               then
+               # there is no meaning for shorter than 5 seconds
+               # the kernel changes this value every 5 seconds
+               load_average_update_every=5
+       fi
+
        return 0
 }
 
 load_average_create() {
        # create a chart with 3 dimensions
 cat <<EOF
-CHART example.load '' "System Load Average" "load" load load line 500 $load_average_update_every
+CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
 DIMENSION load1 '1 min' absolute 1 100
 DIMENSION load5 '5 mins' absolute 1 100
 DIMENSION load15 '15 mins' absolute 1 100
@@ -37,7 +45,7 @@ load_average_update() {
 
        # write the result of the work.
        cat <<VALUESEOF
-BEGIN example.load
+BEGIN system.load
 SET load1 = $load1
 SET load5 = $load5
 SET load15 = $load15
index d3a786e9355812eab08bad85008c8f1e4615eaf1..f537ada488f183690b88e88d5413cf2b9bad7276 100755 (executable)
@@ -25,7 +25,7 @@ mem_apps_bc_finalze=
 
 mem_apps_create() {
 
-       echo "CHART apps.mem '' 'Apps Memory' MB apps apps stacked 20000 $mem_apps_update_every"
+       echo "CHART chartsd_apps.mem '' 'Apps Memory' MB apps apps.mem stacked 20000 $mem_apps_update_every"
 
        local x=
        for x in $mem_apps_apps
@@ -44,7 +44,7 @@ mem_apps_update() {
        # for each dimension
        # remember: KEEP IT SIMPLE AND SHORT
 
-       echo "BEGIN apps.mem"
+       echo "BEGIN chartsd_apps.mem"
        ps -o comm,rss -C "$mem_apps_apps" |\
                grep -v "^COMMAND" |\
                (       sed -e "s/ \+/ /g" -e "s/ /+=/g";
index 8d0ac228fc3aa7a2f9dc08535a4bcfd72b147c11..2839052898c4defc2ae32171b156641a0ebd8673 100755 (executable)
@@ -8,6 +8,7 @@
 # It requires only the ability to connect to the server.
 
 mysql_update_every=5
+mysql_priority=60000
 
 declare -A mysql_cmds=() mysql_opts=() mysql_ids=()
 
@@ -163,16 +164,16 @@ mysql_create() {
        for m in "${mysql_ids[@]}"
        do
                cat <<EOF
-CHART mysql_$m.bandwidth '' "mysql Bandwidth" "kilobits/s" mysql_$m mysql area 20001 $mysql_update_every
+CHART mysql_$m.net '' "mysql Bandwidth" "kilobits/s" bandwidth mysql.net area $[mysql_priority + 1] $mysql_update_every
 DIMENSION Bytes_received in incremental 8 1024
 DIMENSION Bytes_sent out incremental -8 1024
 
-CHART mysql_$m.queries '' "mysql Queries" "queries/s" mysql_$m mysql line 20002 $mysql_update_every
+CHART mysql_$m.queries '' "mysql Queries" "queries/s" queries mysql.queries line $[mysql_priority + 2] $mysql_update_every
 DIMENSION Queries queries incremental 1 1
 DIMENSION Questions questions incremental 1 1
 DIMENSION Slow_queries slow_queries incremental -1 1
 
-CHART mysql_$m.handlers '' "mysql Handlers" "handlers/s" mysql_$m mysql line 20003 $mysql_update_every
+CHART mysql_$m.handlers '' "mysql Handlers" "handlers/s" handlers mysql.handlers line $[mysql_priority + 3] $mysql_update_every
 DIMENSION Handler_commit commit incremental 1 1
 DIMENSION Handler_delete delete incremental 1 1
 DIMENSION Handler_prepare prepare incremental 1 1
@@ -188,75 +189,75 @@ DIMENSION Handler_savepoint_rollback savepoint_rollback incremental 1 1
 DIMENSION Handler_update update incremental 1 1
 DIMENSION Handler_write write incremental 1 1
 
-CHART mysql_$m.table_locks '' "mysql Tables Locks" "locks/s" mysql_$m mysql line 20004 $mysql_update_every
+CHART mysql_$m.table_locks '' "mysql Tables Locks" "locks/s" locks mysql.table_locks line $[mysql_priority + 4] $mysql_update_every
 DIMENSION Table_locks_immediate immediate incremental 1 1
 DIMENSION Table_locks_waited waited incremental -1 1
 
-CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins/s" mysql_$m mysql line 20005 $mysql_update_every
+CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins/s" issues mysql.join_issues line $[mysql_priority + 5] $mysql_update_every
 DIMENSION Select_full_join full_join incremental 1 1
 DIMENSION Select_full_range_join full_range_join incremental 1 1
 DIMENSION Select_range range incremental 1 1
 DIMENSION Select_range_check range_check incremental 1 1
 DIMENSION Select_scan scan incremental 1 1
 
-CHART mysql_$m.sort_issues '' "mysql Sort Issues" "issues/s" mysql_$m mysql line 20006 $mysql_update_every
+CHART mysql_$m.sort_issues '' "mysql Sort Issues" "issues/s" issues mysql.sort.issues line $[mysql_priority + 6] $mysql_update_every
 DIMENSION Sort_merge_passes merge_passes incremental 1 1
 DIMENSION Sort_range range incremental 1 1
 DIMENSION Sort_scan scan incremental 1 1
 
-CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" mysql_$m mysql line 20007 $mysql_update_every
+CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" temporaries mysql.tmp line $[mysql_priority + 7] $mysql_update_every
 DIMENSION Created_tmp_disk_tables disk_tables incremental 1 1
 DIMENSION Created_tmp_files files incremental 1 1
 DIMENSION Created_tmp_tables tables incremental 1 1
 
-CHART mysql_$m.connections '' "mysql Connections" "connections/s" mysql_$m mysql line 20009 $mysql_update_every
+CHART mysql_$m.connections '' "mysql Connections" "connections/s" connections mysql.connections line $[mysql_priority + 8] $mysql_update_every
 DIMENSION Connections all incremental 1 1
 DIMENSION Aborted_connects aborded incremental 1 1
 
-CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" mysql_$m mysql line 20010 $mysql_update_every
+CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" binlog mysql.binlog_cache line $[mysql_priority + 9] $mysql_update_every
 DIMENSION Binlog_cache_disk_use disk incremental 1 1
 DIMENSION Binlog_cache_use all incremental 1 1
 
-CHART mysql_$m.threads '' "mysql Threads" "threads" mysql_$m mysql line 20012 $mysql_update_every
+CHART mysql_$m.threads '' "mysql Threads" "threads" threads mysql.threads line $[mysql_priority + 10] $mysql_update_every
 DIMENSION Threads_connected connected absolute 1 1
 DIMENSION Threads_created created incremental 1 1
 DIMENSION Threads_cached cached absolute -1 1
 DIMENSION Threads_running running absolute 1 1
 
-CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" mysql_$m mysql area 20013 $mysql_update_every
+CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" threads mysql.thread_cache_misses area $[mysql_priority + 11] $mysql_update_every
 DIMENSION misses misses absolute 1 100
 
-CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" mysql_$m mysql area 20014 $mysql_update_every
+CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kilobytes/s" innodb mysql.innodb_io area $[mysql_priority + 12] $mysql_update_every
 DIMENSION Innodb_data_read read incremental 1 1024
 DIMENSION Innodb_data_written write incremental -1 1024
 
-CHART mysql_$m.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" mysql_$m mysql line 20015 $mysql_update_every
+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
 DIMENSION Innodb_data_reads reads incremental 1 1
 DIMENSION Innodb_data_writes writes incremental -1 1
 DIMENSION Innodb_data_fsyncs fsyncs incremental 1 1
 
-CHART mysql_$m.innodb_io_pending_ops '' "mysql InnoDB Pending I/O Operations" "operations" mysql_$m mysql line 20015 $mysql_update_every
+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
 DIMENSION Innodb_data_pending_reads reads absolute 1 1
 DIMENSION Innodb_data_pending_writes writes absolute -1 1
 DIMENSION Innodb_data_pending_fsyncs fsyncs absolute 1 1
 
-CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" mysql_$m mysql line 20016 $mysql_update_every
+CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" innodb mysql.innodb_log line $[mysql_priority + 15] $mysql_update_every
 DIMENSION Innodb_log_waits waits incremental 1 1
 DIMENSION Innodb_log_write_requests write_requests incremental -1 1
 DIMENSION Innodb_log_writes writes incremental -1 1
 
-CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" mysql_$m mysql line 20017 $mysql_update_every
+CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations" innodb mysql.innodb_os_log line $[mysql_priority + 16] $mysql_update_every
 DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 1
 DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs absolute 1 1
 DIMENSION Innodb_os_log_pending_writes pending_writes absolute -1 1
 
-CHART mysql_$m.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kilobytes/s" mysql_$m mysql area 20018 $mysql_update_every
+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
 DIMENSION Innodb_os_log_written write incremental -1 1024
 
-CHART mysql_$m.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" mysql_$m mysql area 20019 $mysql_update_every
+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
 DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 1
 
-CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" mysql_$m mysql area 20020 $mysql_update_every
+CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" innodb mysql.innodb_rows area $[mysql_priority + 19] $mysql_update_every
 DIMENSION Innodb_rows_read read incremental 1 1
 DIMENSION Innodb_rows_deleted deleted incremental -1 1
 DIMENSION Innodb_rows_inserted inserted incremental 1 1
@@ -267,7 +268,7 @@ EOF
        if [ ! -z "$mysql_Binlog_stmt_cache_disk_use" ]
                then
                cat <<EOF
-CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" mysql_$m mysql line 20011 $mysql_update_every
+CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" binlog mysql.binlog_stmt_cache line $[mysql_priority + 20] $mysql_update_every
 DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 1
 DIMENSION Binlog_stmt_cache_use all incremental 1 1
 EOF
@@ -276,7 +277,7 @@ EOF
        if [ ! -z "$mysql_Connection_errors_accept" ]
                then
                cat <<EOF
-CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" mysql_$m mysql line 20008 $mysql_update_every
+CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" connections mysql.connection_errors line $[mysql_priority + 21] $mysql_update_every
 DIMENSION Connection_errors_accept accept incremental 1 1
 DIMENSION Connection_errors_internal internal incremental 1 1
 DIMENSION Connection_errors_max_connections max incremental 1 1
@@ -327,7 +328,7 @@ mysql_update() {
 
                # write the result of the work.
                cat <<VALUESEOF
-BEGIN mysql_$x.bandwidth $1
+BEGIN mysql_$x.net $1
 SET Bytes_received = $mysql_Bytes_received
 SET Bytes_sent = $mysql_Bytes_sent
 END
index d180aab5e1853355d40760e6028f86a16710bfb1..bc8293c5dfa4c0387166d167d9b7f35323db7d04 100755 (executable)
@@ -8,6 +8,7 @@ nginx_url="http://127.0.0.1:80/stub_status"
 # _update_every is a special variable - it holds the number of seconds
 # between the calls of the _update() function
 nginx_update_every=
+nginx_priority=60000
 
 declare -a nginx_response=()
 nginx_active_connections=0
@@ -80,18 +81,18 @@ nginx_check() {
 # _create is called once, to create the charts
 nginx_create() {
        cat <<EOF
-CHART nginx.connections '' "nginx Active Connections" "connections" nginx nginx line 16000 $nginx_update_every
+CHART nginx.connections '' "nginx Active Connections" "connections" nginx nginx.connections line $[nginx_priority + 1] $nginx_update_every
 DIMENSION active '' absolute 1 1
 
-CHART nginx.requests '' "nginx Requests" "requests/s" nginx nginx line 16001 $nginx_update_every
+CHART nginx.requests '' "nginx Requests" "requests/s" nginx nginx.requests line $[nginx_priority + 2] $nginx_update_every
 DIMENSION requests '' incremental 1 1
 
-CHART nginx.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx line 16002 $nginx_update_every
+CHART nginx.connections_status '' "nginx Active Connections by Status" "connections" nginx nginx.connections.status line $[nginx_priority + 3] $nginx_update_every
 DIMENSION reading '' absolute 1 1
 DIMENSION writing '' absolute 1 1
 DIMENSION waiting idle absolute 1 1
 
-CHART nginx.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx line 16003 $nginx_update_every
+CHART nginx.connect_rate '' "nginx Connections Rate" "connections/s" nginx nginx.connections.rate line $[nginx_priority + 4] $nginx_update_every
 DIMENSION accepts accepted incremental 1 1
 DIMENSION handled '' incremental 1 1
 EOF
index 1a60524115cbcf55025057672f39555a2ef48a9d..343c6d9cd176f1f440072bfd9210e32d382595ac 100755 (executable)
@@ -9,6 +9,9 @@ nut_update_every=2
 
 nut_timeout=2
 
+# the priority of nut related to other charts
+nut_priority=90000
+
 declare -A nut_ids=()
 
 nut_get_all() {
@@ -58,34 +61,34 @@ nut_create() {
        for x in "${nut_ids[@]}"
        do
                cat <<EOF
-CHART nut_$x.charge '' "UPS Charge" "percentage" ups_$x nut area 21001 $nut_update_every
+CHART nut_$x.charge '' "UPS Charge" "percentage" ups nut.charge area $[nut_priority + 1] $nut_update_every
 DIMENSION battery_charge charge absolute 1 100
 
-CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups_$x nut line 21002 $nut_update_every
+CHART nut_$x.battery_voltage '' "UPS Battery Voltage" "Volts" ups nut.battery.voltage line $[nut_priority + 2] $nut_update_every
 DIMENSION battery_voltage voltage absolute 1 100
 DIMENSION battery_voltage_high high absolute 1 100
 DIMENSION battery_voltage_low low absolute 1 100
 DIMENSION battery_voltage_nominal nominal absolute 1 100
 
-CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" ups_$x nut line 21003 $nut_update_every
+CHART nut_$x.input_voltage '' "UPS Input Voltage" "Volts" input nut.input.voltage line $[nut_priority + 3] $nut_update_every
 DIMENSION input_voltage voltage absolute 1 100
 DIMENSION input_voltage_fault fault absolute 1 100
 DIMENSION input_voltage_nominal nominal absolute 1 100
 
-CHART nut_$x.input_current '' "UPS Input Current" "Ampere" ups_$x nut line 21004 $nut_update_every
+CHART nut_$x.input_current '' "UPS Input Current" "Ampere" input nut.input.current line $[nut_priority + 4] $nut_update_every
 DIMENSION input_current_nominal nominal absolute 1 100
 
-CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" ups_$x nut line 21005 $nut_update_every
+CHART nut_$x.input_frequency '' "UPS Input Frequency" "Hz" input nut.input.frequency line $[nut_priority + 5] $nut_update_every
 DIMENSION input_frequency frequency absolute 1 100
 DIMENSION input_frequency_nominal nominal absolute 1 100
 
-CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" ups_$x nut line 21006 $nut_update_every
+CHART nut_$x.output_voltage '' "UPS Output Voltage" "Volts" output nut.output.voltage line $[nut_priority + 6] $nut_update_every
 DIMENSION output_voltage voltage absolute 1 100
 
-CHART nut_$x.load '' "UPS Load" "percentage" ups_$x nut area 21000 $nut_update_every
+CHART nut_$x.load '' "UPS Load" "percentage" ups nut.load area $[nut_priority] $nut_update_every
 DIMENSION load load absolute 1 100
 
-CHART nut_$x.temp '' "UPS Temperature" "temperature" ups_$x nut line 21007 $nut_update_every
+CHART nut_$x.temp '' "UPS Temperature" "temperature" ups nut.temperature line $[nut_priority + 7] $nut_update_every
 DIMENSION temp temp absolute 1 100
 EOF
        done
index 2e4e59b3a9a8efe8e124e6fa531815c4a11d9057..4b60c811df79cec1a990116c6cbc1a8129f4d9c0 100755 (executable)
@@ -4,6 +4,7 @@ opensips_opts="fifo get_statistics all"
 opensips_cmd=
 opensips_update_every=5
 opensips_timeout=2
+opensips_priority=80000
 
 opensips_get_stats() {
        timeout $opensips_timeout "$opensips_cmd" $opensips_opts |\
@@ -44,61 +45,61 @@ opensips_check() {
 opensips_create() {
        # create the charts
        cat <<EOF
-CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" opensips '' area 20001 $opensips_update_every
+CHART opensips.dialogs_active '' "OpenSIPS Active Dialogs" "dialogs" dialogs '' area $[opensips_priority + 1] $opensips_update_every
 DIMENSION dialog_active_dialogs active absolute 1 1
 DIMENSION dialog_early_dialogs early absolute -1 1
 
-CHART opensips.users '' "OpenSIPS Users" "users" opensips '' line 20002 $opensips_update_every
+CHART opensips.users '' "OpenSIPS Users" "users" users '' line $[opensips_priority + 2] $opensips_update_every
 DIMENSION usrloc_registered_users registered absolute 1 1
 DIMENSION usrloc_location_users location absolute 1 1
 DIMENSION usrloc_location_contacts contacts absolute 1 1
 DIMENSION usrloc_location_expires expires incremental -1 1
 
-CHART opensips.registrar '' "OpenSIPS Registrar" "registrations/s" opensips '' line 20003 $opensips_update_every
+CHART opensips.registrar '' "OpenSIPS Registrar" "registrations/s" registrar '' line $[opensips_priority + 3] $opensips_update_every
 DIMENSION registrar_accepted_regs accepted incremental 1 1
 DIMENSION registrar_rejected_regs rejected incremental -1 1
 
-CHART opensips.transactions '' "OpenSIPS Transactions" "transactions/s" opensips '' line 20004 $opensips_update_every
+CHART opensips.transactions '' "OpenSIPS Transactions" "transactions/s" transactions '' line $[opensips_priority + 4] $opensips_update_every
 DIMENSION tm_UAS_transactions UAS incremental 1 1
 DIMENSION tm_UAC_transactions UAC incremental -1 1
 
-CHART opensips.core_rcv '' "OpenSIPS Core Receives" "queries/s" opensips '' line 20005 $opensips_update_every
+CHART opensips.core_rcv '' "OpenSIPS Core Receives" "queries/s" core '' line $[opensips_priority + 5] $opensips_update_every
 DIMENSION core_rcv_requests requests incremental 1 1
 DIMENSION core_rcv_replies replies incremental -1 1
 
-CHART opensips.core_fwd '' "OpenSIPS Core Forwards" "queries/s" opensips '' line 20006 $opensips_update_every
+CHART opensips.core_fwd '' "OpenSIPS Core Forwards" "queries/s" core '' line $[opensips_priority + 6] $opensips_update_every
 DIMENSION core_fwd_requests requests incremental 1 1
 DIMENSION core_fwd_replies replies incremental -1 1
 
-CHART opensips.core_drop '' "OpenSIPS Core Drops" "queries/s" opensips '' line 20007 $opensips_update_every
+CHART opensips.core_drop '' "OpenSIPS Core Drops" "queries/s" core '' line $[opensips_priority + 7] $opensips_update_every
 DIMENSION core_drop_requests requests incremental 1 1
 DIMENSION core_drop_replies replies incremental -1 1
 
-CHART opensips.core_err '' "OpenSIPS Core Errors" "queries/s" opensips '' line 20008 $opensips_update_every
+CHART opensips.core_err '' "OpenSIPS Core Errors" "queries/s" core '' line $[opensips_priority + 8] $opensips_update_every
 DIMENSION core_err_requests requests incremental 1 1
 DIMENSION core_err_replies replies incremental -1 1
 
-CHART opensips.core_bad '' "OpenSIPS Core Bad" "queries/s" opensips '' line 20009 $opensips_update_every
+CHART opensips.core_bad '' "OpenSIPS Core Bad" "queries/s" core '' line $[opensips_priority + 9] $opensips_update_every
 DIMENSION core_bad_URIs_rcvd bad_URIs_rcvd incremental 1 1
 DIMENSION core_unsupported_methods unsupported_methods incremental 1 1
 DIMENSION core_bad_msg_hdr bad_msg_hdr incremental 1 1
 
-CHART opensips.tm_replies '' "OpenSIPS TM Replies" "replies/s" opensips '' line 20010 $opensips_update_every
+CHART opensips.tm_replies '' "OpenSIPS TM Replies" "replies/s" transactions '' line $[opensips_priority + 10] $opensips_update_every
 DIMENSION tm_received_replies received incremental 1 1
 DIMENSION tm_relayed_replies relayed incremental 1 1
 DIMENSION tm_local_replies local incremental 1 1
 
-CHART opensips.transactions_status '' "OpenSIPS Transactions Status" "transactions/s" opensips '' line 20011 $opensips_update_every
+CHART opensips.transactions_status '' "OpenSIPS Transactions Status" "transactions/s" transactions '' line $[opensips_priority + 11] $opensips_update_every
 DIMENSION tm_2xx_transactions 2xx incremental 1 1
 DIMENSION tm_3xx_transactions 3xx incremental 1 1
 DIMENSION tm_4xx_transactions 4xx incremental 1 1
 DIMENSION tm_5xx_transactions 5xx incremental 1 1
 DIMENSION tm_6xx_transactions 6xx incremental 1 1
 
-CHART opensips.transactions_inuse '' "OpenSIPS InUse Transactions" "transactions" opensips '' line 20012 $opensips_update_every
+CHART opensips.transactions_inuse '' "OpenSIPS InUse Transactions" "transactions" transactions '' line $[opensips_priority + 12] $opensips_update_every
 DIMENSION tm_inuse_transactions inuse absolute 1 1
 
-CHART opensips.sl_replies '' "OpenSIPS SL Replies" "replies/s" opensips '' line 20013 $opensips_update_every
+CHART opensips.sl_replies '' "OpenSIPS SL Replies" "replies/s" core '' line $[opensips_priority + 13] $opensips_update_every
 DIMENSION sl_1xx_replies 1xx incremental 1 1
 DIMENSION sl_2xx_replies 2xx incremental 1 1
 DIMENSION sl_3xx_replies 3xx incremental 1 1
@@ -109,31 +110,31 @@ DIMENSION sl_sent_replies sent incremental 1 1
 DIMENSION sl_sent_err_replies error incremental 1 1
 DIMENSION sl_received_ACKs ACKed incremental 1 1
 
-CHART opensips.dialogs '' "OpenSIPS Dialogs" "dialogs/s" opensips '' line 20014 $opensips_update_every
+CHART opensips.dialogs '' "OpenSIPS Dialogs" "dialogs/s" dialogs '' line $[opensips_priority + 14] $opensips_update_every
 DIMENSION dialog_processed_dialogs processed incremental 1 1
 DIMENSION dialog_expired_dialogs expired incremental 1 1
 DIMENSION dialog_failed_dialogs failed incremental -1 1
 
-CHART opensips.net_waiting '' "OpenSIPS Network Waiting" "kilobytes" opensips '' line 20015 $opensips_update_every
+CHART opensips.net_waiting '' "OpenSIPS Network Waiting" "kilobytes" net '' line $[opensips_priority + 15] $opensips_update_every
 DIMENSION net_waiting_udp UDP absolute 1 1024
 DIMENSION net_waiting_tcp TCP absolute 1 1024
 
-CHART opensips.uri_checks '' "OpenSIPS URI Checks" "checks / sec" opensips '' line 20016 $opensips_update_every
+CHART opensips.uri_checks '' "OpenSIPS URI Checks" "checks / sec" uri '' line $[opensips_priority + 16] $opensips_update_every
 DIMENSION uri_positive_checks positive incremental 1 1
 DIMENSION uri_negative_checks negative incremental -1 1
 
-CHART opensips.traces '' "OpenSIPS Traces" "traces / sec" opensips '' line 20017 $opensips_update_every
+CHART opensips.traces '' "OpenSIPS Traces" "traces / sec" traces '' line $[opensips_priority + 17] $opensips_update_every
 DIMENSION siptrace_traced_requests requests incremental 1 1
 DIMENSION siptrace_traced_replies replies incremental -1 1
 
-CHART opensips.shmem '' "OpenSIPS Shared Memory" "kilobytes" opensips '' line 20018 $opensips_update_every
+CHART opensips.shmem '' "OpenSIPS Shared Memory" "kilobytes" mem '' line $[opensips_priority + 18] $opensips_update_every
 DIMENSION shmem_total_size total absolute 1 1024
 DIMENSION shmem_used_size used absolute 1 1024
 DIMENSION shmem_real_used_size real_used absolute 1 1024
 DIMENSION shmem_max_used_size max_used absolute 1 1024
 DIMENSION shmem_free_size free absolute 1 1024
 
-CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragments" opensips '' line 20019 $opensips_update_every
+CHART opensips.shmem_fragments '' "OpenSIPS Shared Memory Fragmentation" "fragments" mem '' line $[opensips_priority + 19] $opensips_update_every
 DIMENSION shmem_fragments fragments absolute 1 1
 EOF
 
index 6df54ac5277a0307a2bbe7e84b75ee9097c06a5c..d286f99f2064f37d8b0d366987e03c6c3e02a99c 100755 (executable)
@@ -7,6 +7,8 @@ postfix_postqueue=
 # how frequently to collect queue size
 postfix_update_every=15
 
+postfix_priority=60000
+
 postfix_check() {
        # this should return:
        #  - 0 to enable the chart
@@ -41,9 +43,9 @@ postfix_check() {
 
 postfix_create() {
 cat <<EOF
-CHART postfix.qemails '' "Postfix Queue Emails" "emails" postfix postfix line 5000 $postfix_update_every
+CHART postfix.qemails '' "Postfix Queue Emails" "emails" queue postfix.queued.emails line $[postfix_priority + 1] $postfix_update_every
 DIMENSION emails '' absolute 1 1
-CHART postfix.qsize '' "Postfix Queue Emails Size" "emails size in KB" postfix postfix area 5001 $postfix_update_every
+CHART postfix.qsize '' "Postfix Queue Emails Size" "emails size in KB" queue postfix.queued.size area $[postfix_priority + 2] $postfix_update_every
 DIMENSION size '' absolute 1 1
 EOF
 
index 83783215073a3486c7eb2080079edf4fbb63fbf4..d14ddf0def57af49b216e575dbb86dbf85a3be67 100755 (executable)
@@ -21,6 +21,8 @@ sensors_source_update=1
 # the default is to collect it at every iteration of charts.d
 sensors_update_every=
 
+sensors_priority=90000
+
 sensors_find_all_files() {
        find $1 -maxdepth $sensors_sys_depth -name \*_input -o -name temp 2>/dev/null
 }
@@ -127,7 +129,7 @@ sensors_create() {
                                        files="$( sensors_check_files $files )"
                                        files="$( sensors_check_temp_type $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.temp_$id '' '$name Temperature' 'Celcius' '$device' '' line 6000 $sensors_update_every"
+                                       echo "CHART sensors.temp_$id '' '$name Temperature' 'Celcius' 'temperature' 'sensors.temp' line $[sensors_priority + 1] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.temp_$id \$1\""
                                        divisor=1000
                                        ;;
@@ -136,7 +138,7 @@ sensors_create() {
                                        files="$( ls $path/in*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' '$device' '' line 6001 $sensors_update_every"
+                                       echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $[sensors_priority + 2] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.volt_$id \$1\""
                                        divisor=1000
                                        ;;
@@ -145,7 +147,7 @@ sensors_create() {
                                        files="$( ls $path/curr*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' '$device' '' line 6002 $sensors_update_every"
+                                       echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $[sensors_priority + 3] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.curr_$id \$1\""
                                        divisor=1000
                                        ;;
@@ -154,7 +156,7 @@ sensors_create() {
                                        files="$( ls $path/power*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.power_$id '' '$name Power' 'Watt' '$device' '' line 6003 $sensors_update_every"
+                                       echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $[sensors_priority + 4] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.power_$id \$1\""
                                        divisor=1000000
                                        ;;
@@ -163,7 +165,7 @@ sensors_create() {
                                        files="$( ls $path/fan*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' '$device' '' line 6004 $sensors_update_every"
+                                       echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $[sensors_priority + 5] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.fan_$id \$1\""
                                        ;;
 
@@ -171,7 +173,7 @@ sensors_create() {
                                        files="$( ls $path/energy*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' '$device' '' areastack 6005 $sensors_update_every"
+                                       echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $[sensors_priority + 6] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.energy_$id \$1\""
                                        algorithm="incremental"
                                        divisor=1000000
@@ -181,7 +183,7 @@ sensors_create() {
                                        files="$( ls $path/humidity*_input 2>/dev/null )"
                                        files="$( sensors_check_files $files )"
                                        [ -z "$files" ] && continue
-                                       echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' '$device' '' line 6006 $sensors_update_every"
+                                       echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $[sensors_priority + 7] $sensors_update_every"
                                        echo >>$TMP_DIR/sensors.sh "echo \"BEGIN sensors.humidity_$id \$1\""
                                        divisor=1000
                                        ;;
index 9df57613efffc7fe43e151ed1918b10b3766ae0a..6260ce97f71a9ba5a7c4f943b06bcd04493372c9 100755 (executable)
@@ -5,6 +5,7 @@ squid_port=
 squid_url=
 squid_timeout=2
 squid_update_every=5
+squid_priority=60000
 
 squid_get_stats_internal() {
        local host="$1" port="$2" url="$3"
@@ -69,21 +70,21 @@ squid_check() {
 squid_create() {
        # create the charts
        cat <<EOF
-CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" squid '' area 20001 $squid_update_every
+CHART squid.clients_net '' "Squid Client Bandwidth" "kilobits / sec" clients squid.clients.net area $[squid_priority + 1] $squid_update_every
 DIMENSION client_http_kbytes_in in incremental 8 1
 DIMENSION client_http_kbytes_out out incremental -8 1
 DIMENSION client_http_hit_kbytes_out hits incremental -8 1
 
-CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" squid '' line 20003 $squid_update_every
+CHART squid.clients_requests '' "Squid Client Requests" "requests / sec" clients squid.clients.requests line $[squid_priority + 3] $squid_update_every
 DIMENSION client_http_requests requests incremental 1 1
 DIMENSION client_http_hits hits incremental 1 1
 DIMENSION client_http_errors errors incremental -1 1
 
-CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" squid '' area 20002 $squid_update_every
+CHART squid.servers_net '' "Squid Server Bandwidth" "kilobits / sec" servers squid.servers.net area $[squid_priority + 2] $squid_update_every
 DIMENSION server_all_kbytes_in in incremental 8 1
 DIMENSION server_all_kbytes_out out incremental -8 1
 
-CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" squid '' line 20004 $squid_update_every
+CHART squid.servers_requests '' "Squid Server Requests" "requests / sec" servers squid.servers.requests line $[squid_priority + 4] $squid_update_every
 DIMENSION server_all_requests requests incremental 1 1
 DIMENSION server_all_errors errors incremental -1 1
 EOF
index 4348fbaa6fc57b332aba7290254d6219cbce6a62..c2b15eae72a1aec2ca84351db280b234d9ace8df 100755 (executable)
@@ -47,19 +47,19 @@ var named = {
        name: __filename,
        enable_autodetect: true,
        update_every: 1,
-
+       base_priority: 60000,
        charts: {},
 
-       chartFromMembersCreate: function(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor) {
+       chartFromMembersCreate: function(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor) {
                var chart = {
                        id: id,                                                                                 // the unique id of the chart
                        name: '',                                                                               // the unique name of the chart
                        title: service.name + ' ' + title_suffix,               // the title of the chart
                        units: units,                                                                   // the units of the chart dimensions
-                       family: family_prefix + '_' + service.name,             // the family of the chart
-                       category: category_prefix + '_' + service.name, // the category of the chart
+                       family: family,                                                                 // the family of the chart
+                       context: context,                                                               // the context of the chart
                        type: type,                                                                             // the type of the chart
-                       priority: priority,                                                             // the priority relative to others in the same family and category
+                       priority: priority,                                                             // the priority relative to others in the same family
                        update_every: service.update_every,                     // the expected update frequency of the chart
                        dimensions: {}
                }
@@ -87,19 +87,19 @@ var named = {
                return chart;
        },
 
-       chartFromMembers: function(service, obj, id_suffix, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor) {
+       chartFromMembers: function(service, obj, id_suffix, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor) {
                var id = 'named_' + service.name + '.' + id_suffix;
                var chart = this.charts[id];
 
                if(typeof chart === 'undefined') {
-                       chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor);
+                       chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor);
                        if(chart === null) return false;
                }
                else {
                        // check if we need to re-generate the chart
                        for(var x in obj) {
                                if(typeof(chart.dimensions[x]) === 'undefined') {
-                                       chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family_prefix, category_prefix, type, priority, algorithm, multiplier, divisor);
+                                       chart = this.chartFromMembersCreate(service, obj, id, title_suffix, units, family, context, type, priority, algorithm, multiplier, divisor);
                                        if(chart === null) return false;
                                        break;
                                }
@@ -300,28 +300,28 @@ var named = {
                                }
 
                                if(global_requests_enable == true)
-                                       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);
+                                       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);
 
                                if(global_queries_success_enable == true)
-                                       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);
+                                       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);
 
                                if(protocol_queries_enable == true)
-                                       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);
+                                       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);
 
                                if(global_queries_enable == true)
-                                       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);
+                                       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);
 
                                if(global_updates_enable == true)
-                                       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);
+                                       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);
 
                                if(global_failures_enable == true)
-                                       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);
+                                       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);
 
                                if(global_failures_detail_enable == true)
-                                       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);
+                                       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);
 
                                if(default_enable === true)
-                                       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);
+                                       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);
 
                                // RecursClients chart
                                {
@@ -334,10 +334,10 @@ var named = {
                                                        name: '',                                                                               // the unique name of the chart
                                                        title: service.name + ' Bind, Current Recursive Clients',               // the title of the chart
                                                        units: 'clients',                                                               // the units of the chart dimensions
-                                                       family: 'named',                                                                // the family of the chart
-                                                       category: 'named',                                                              // the category of the chart
+                                                       family: 'clients',                                                              // the family of the chart
+                                                       context: 'named.recursive.clients',                             // the context of the chart
                                                        type: netdata.chartTypes.line,                                  // the type of the chart
-                                                       priority: 150,                                                                  // the priority relative to others in the same family and category
+                                                       priority: named.base_priority + 1,                              // the priority relative to others in the same family
                                                        update_every: service.update_every,                             // the expected update frequency of the chart
                                                        dimensions: {
                                                                'clients': {
@@ -362,13 +362,13 @@ var named = {
                        }
 
                        if(typeof r.opcodes !== 'undefined')
-                               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);
+                               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);
 
                        if(typeof r.qtypes !== 'undefined')
-                               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);
+                               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);
 
                        if(typeof r.sockstats !== 'undefined')
-                               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);
+                               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);
 
                        if(typeof r.views !== 'undefined') {
                                for( var x in r.views ) {
@@ -422,10 +422,10 @@ var named = {
                                                        }
 
                                                        if(rtt_enable)
-                                                               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);
+                                                               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);
 
                                                        if(default_enable)
-                                                               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);
+                                                               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);
 
                                                        // NumFetch chart
                                                        if(typeof named.lookups.numfetch[key] !== 'undefined') {
@@ -438,10 +438,10 @@ var named = {
                                                                                name: '',                                                                               // the unique name of the chart
                                                                                title: service.name + ' Bind, ' + x + ' View, Resolver Active Queries',         // the title of the chart
                                                                                units: 'queries',                                                               // the units of the chart dimensions
-                                                                               family: 'named',                                                                // the family of the chart
-                                                                               category: 'named',                                                              // the category of the chart
+                                                                               family: 'view_' + x,                                                    // the family of the chart
+                                                                               context: 'named.resolver.active.queries',               // the context of the chart
                                                                                type: netdata.chartTypes.line,                                  // the type of the chart
-                                                                               priority: 5000,                                                                 // the priority relative to others in the same family and category
+                                                                               priority: named.base_priority + 1001,                   // the priority relative to others in the same family
                                                                                update_every: service.update_every,                             // the expected update frequency of the chart
                                                                                dimensions: {
                                                                                        'queries': {
@@ -467,10 +467,10 @@ var named = {
                                        }
 
                                        if(typeof resolver.qtypes !== 'undefined')
-                                               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);
+                                               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);
 
                                        //if(typeof resolver.cache !== 'undefined')
-                                       //      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);
+                                       //      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);
 
                                        if(typeof resolver.cachestats['CacheHits'] !== 'undefined' && resolver.cachestats['CacheHits'] > 0) {
                                                var id = 'named_' + service.name + '.view_resolver_cachehits_' + x;
@@ -481,11 +481,11 @@ var named = {
                                                                id: id,                                                                                 // the unique id of the chart
                                                                name: '',                                                                               // the unique name of the chart
                                                                title: service.name + ' Bind, ' + x + ' View, Resolver Cache Hits',             // the title of the chart
-                                                               units: 'operations/s',                                                          // the units of the chart dimensions
-                                                               family: 'named',                                                                // the family of the chart
-                                                               category: 'named',                                                              // the category of the chart
+                                                               units: 'operations/s',                                                  // the units of the chart dimensions
+                                                               family: 'view_' + x,                                                    // the family of the chart
+                                                               context: 'named.resolver.cache.hits',                   // the context of the chart
                                                                type: netdata.chartTypes.area,                                  // the type of the chart
-                                                               priority: 8000,                                                                 // the priority relative to others in the same family and category
+                                                               priority: named.base_priority + 1100,                   // the priority relative to others in the same family
                                                                update_every: service.update_every,                             // the expected update frequency of the chart
                                                                dimensions: {
                                                                        'CacheHits': {
@@ -525,10 +525,10 @@ var named = {
                                        // 5. TreeMemTotal, TreeMemInUse - absolute
                                        // 6. HeapMemMax, HeapMemTotal, HeapMemInUse - absolute
                                        //if(typeof resolver.cachestats !== 'undefined')
-                                       //      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);
+                                       //      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);
 
                                        //if(typeof resolver.adb !== 'undefined')
-                                       //      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);
+                                       //      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);
                                }
                        }
                }
index 5fa7752185e39c9a8e13f7bc1f3889b2261b17b0..9834534eef4d4759ba2728c07da7d061719b39ac 100755 (executable)
@@ -13,9 +13,9 @@ var example_chart = {
        title: 'title',                                 // the title of the chart
        units: 'units',                                 // the units of the chart dimensions
        family: 'family',                               // the family of the chart
-       category: 'category',                   // the category of the chart
+       context: 'context',                             // the context of the chart
        type: netdata.chartTypes.line,  // the type of the chart
-       priority: 0,                                    // the priority relative to others in the same family and category
+       priority: 0,                                    // the priority relative to others in the same family
        update_every: 1,                                // the expected update frequency of the chart
        dimensions: {
                'dim1': {
@@ -150,6 +150,8 @@ var netdata = {
                if(typeof service === 'undefined')
                        service = {};
 
+               var now = new Date().getTime();
+
                service._current_chart = null;  // the current chart we work on
                service._queue = '';                    // data to be sent to netdata
 
@@ -161,7 +163,6 @@ var netdata = {
                service.running = false;
                service.started = 0;
                service.ended = 0;
-               service.next_run = new Date().getTime();
 
                if(typeof service.module === 'undefined') {
                        service.module = { name: 'not-defined-module' };
@@ -169,8 +170,12 @@ var netdata = {
                        service.enabled = false;
                }
 
-               if(typeof service.name === 'undefined')
-                       service.name = 'unnamed@' + service.module.name + '/' + service.next_run;
+               if(typeof service.name === 'undefined') {
+                       service.name = 'unnamed@' + service.module.name + '/' + now;
+               }
+
+               if(typeof service.processor === 'undefined')
+                       service.processor = netdata.processors.http;
 
                if(typeof service.update_every === 'undefined')
                        service.update_every = service.module.update_every;
@@ -178,12 +183,12 @@ var netdata = {
                if(typeof service.update_every === 'undefined')
                        service.update_every = netdata.options.update_every;
 
-               if(typeof service.processor === 'undefined')
-                       service.processor = netdata.processors.http;
-
                if(service.update_every < netdata.options.update_every)
                        service.update_every = netdata.options.update_every;
 
+               // align the runs
+               service.next_run = now - (now % (service.update_every * 1000));
+
                service.commit = function() {
                        if(this.added !== true) {
                                this.added = true;
@@ -272,7 +277,7 @@ var netdata = {
 
                service._send_chart_to_netdata = function(chart) {
                        // internal function to send a chart to netdata
-                       this.queue('CHART "' + chart.id + '" "' + chart.name + '" "' + chart.title + '" "' + chart.units + '" "' + chart.family + '" "' + chart.category + '" "' + chart.type + '" ' + chart.priority.toString() + ' ' + chart.update_every.toString());
+                       this.queue('CHART "' + chart.id + '" "' + chart.name + '" "' + chart.title + '" "' + chart.units + '" "' + chart.family + '" "' + chart.context + '" "' + chart.type + '" ' + chart.priority.toString() + ' ' + chart.update_every.toString());
                        
                        for(var dim in chart.dimensions) {
                                var d = chart.dimensions[dim];
@@ -387,9 +392,9 @@ var netdata = {
                                        title: 'untitled chart',
                                        units: 'a unit',
                                        family: '',
-                                       category: '',
+                                       context: '',
                                        type: netdata.chartTypes.line,
-                                       priority: 0,
+                                       priority: 50000,
                                        update_every: netdata.options.update_every,
                                        dimensions: {}
                                };
@@ -421,9 +426,9 @@ var netdata = {
                                c._updated = true;
                        }
 
-                       if(typeof(chart.category) !== 'undefined' && chart.category !== c.category) {
-                               if(netdata.options.DEBUG === true) netdata.debug('chart ' + id + ' updated its category');
-                               c.category = chart.category;
+                       if(typeof(chart.context) !== 'undefined' && chart.context !== c.context) {
+                               if(netdata.options.DEBUG === true) netdata.debug('chart ' + id + ' updated its context');
+                               c.context = chart.context;
                                c._updated = true;
                        }
 
index 66d45472bcf35381286475f9d66ef55f33d380dc..5ed1c55a7c8e1e37dc29362bc5a30d2d37c1310e 100755 (executable)
@@ -33,7 +33,7 @@ var webbox = {
        name: __filename,
        enable_autodetect: true,
        update_every: 1,
-
+       base_priority: 60000,
        charts: {},
 
        processResponse: function(service, data) {
@@ -83,10 +83,10 @@ var webbox = {
                                                name: '',                                                                               // the unique name of the chart
                                                title: service.name + ' Current Grid Power',    // the title of the chart
                                                units: d['GriPwr'].unit,                                                // the units of the chart dimensions
-                                               family: 'sma_webbox_' + service.name,                   // the family of the chart
-                                               category: 'sma_webbox_' + service.name,                 // the category of the chart
+                                               family: 'now',                                                                  // the family of the chart
+                                               context: 'sma_webbox.grid.power',                               // the context of the chart
                                                type: netdata.chartTypes.area,                                  // the type of the chart
-                                               priority: 1000,                                                                 // the priority relative to others in the same family and category
+                                               priority: webbox.base_priority + 1,                             // the priority relative to others in the same family
                                                update_every: service.update_every,                             // the expected update frequency of the chart
                                                dimensions: {
                                                        'GriPwr': {
@@ -119,10 +119,10 @@ var webbox = {
                                                name: '',                                                                               // the unique name of the chart
                                                title: service.name + ' Today Grid Power',              // the title of the chart
                                                units: d['GriEgyTdy'].unit,                                             // the units of the chart dimensions
-                                               family: 'sma_webbox_' + service.name,                   // the family of the chart
-                                               category: 'sma_webbox_' + service.name,                 // the category of the chart
+                                               family: 'today',                                                                // the family of the chart
+                                               context: 'sma_webbox.grid.power.today',                 // the context of the chart
                                                type: netdata.chartTypes.area,                                  // the type of the chart
-                                               priority: 1000,                                                                 // the priority relative to others in the same family and category
+                                               priority: webbox.base_priority + 2,                             // the priority relative to others in the same family
                                                update_every: service.update_every,                             // the expected update frequency of the chart
                                                dimensions: {
                                                        'GriEgyTdy': {
@@ -155,10 +155,10 @@ var webbox = {
                                                name: '',                                                                               // the unique name of the chart
                                                title: service.name + ' Total Grid Power',              // the title of the chart
                                                units: d['GriEgyTot'].unit,                                             // the units of the chart dimensions
-                                               family: 'sma_webbox_' + service.name,                   // the family of the chart
-                                               category: 'sma_webbox_' + service.name,                 // the category of the chart
+                                               family: 'total',                                                                // the family of the chart
+                                               context: 'sma_webbox.grid.power.total',                 // the context of the chart
                                                type: netdata.chartTypes.area,                                  // the type of the chart
-                                               priority: 1000,                                                                 // the priority relative to others in the same family and category
+                                               priority: webbox.base_priority + 3,                             // the priority relative to others in the same family
                                                update_every: service.update_every,                             // the expected update frequency of the chart
                                                dimensions: {
                                                        'GriEgyTot': {
index e7ba4b75228a3eaa949818d5e96f9560ea4bb8bd..76e9e5a664f788be0ebec3e75cdef79d2199ae75 100755 (executable)
@@ -185,6 +185,11 @@ netdata.processors.snmp = {
 
                        if(error) {
                                service.error('Received error = ' + netdata.stringify(error) + ' varbinds = ' + netdata.stringify(varbinds));
+
+                               // make all values null
+                               var len = service.snmp_oids.length;
+                               while(len--)
+                                       service.snmp_oids_index[service.snmp_oids[len]].value = null;
                        }
                        else {
                                if(netdata.options.DEBUG === true)
@@ -221,6 +226,7 @@ var snmp = {
        name: __filename,
        enable_autodetect: true,
        update_every: 1,
+       base_priority: 50000,
 
        charts: {},
 
@@ -277,6 +283,8 @@ var snmp = {
                                var to = service.request.charts[c].multiply_range[1];
                                var prio = service.request.charts[c].priority || 1;
 
+                               if(prio < snmp.base_priority) prio += snmp.base_priority;
+
                                while(from <= to) {
                                        var id = c + from.toString();
                                        var chart = extend(true, {}, service.request.charts[c]);
index 0210cfb4a75666af871d480d016d05585b5f518f..40c0356c8f3699bc2bc33dab307fdb82aaf35f4d 100755 (executable)
@@ -509,7 +509,7 @@ global_update() {
                charts_next_update[$chart]=$(( charts_last_update[$chart] + (charts_update_every[$chart] * 1000) ))
                charts_run_counter[$chart]=0
 
-               echo "CHART netdata.plugin_chartsd_$chart '' 'Execution time for $chart plugin' 'milliseconds / run' netdata netdata area 90000 ${charts_update_every[$chart]}"
+               echo "CHART netdata.plugin_chartsd_$chart '' 'Execution time for $chart plugin' 'milliseconds / run' charts.d netdata.plugin_charts area 145000 ${charts_update_every[$chart]}"
                echo "DIMENSION run_time 'run time' absolute 1 1"
        done
 
index b572bb2927cabe65525cfd2241311cd1d2fb9734..39adaba2f0515b3794a2010eb491934700c74760 100755 (executable)
@@ -1751,116 +1751,116 @@ void show_charts(void)
 
        // we have something new to show
        // update the charts
-       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);
+       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);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 100 %llu %s\n", w->name, Hertz, w->hidden ? "hidden,noreset" : "noreset");
        }
 
-       fprintf(stdout, "CHART apps.mem '' 'Apps Dedicated Memory (w/o shared)' 'MB' apps apps stacked 20003 %d\n", update_every);
+       fprintf(stdout, "CHART apps.mem '' 'Apps Dedicated Memory (w/o shared)' 'MB' mem apps.mem stacked 20003 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute %ld %ld noreset\n", w->name, sysconf(_SC_PAGESIZE), 1024L*1024L);
        }
 
-       fprintf(stdout, "CHART apps.threads '' 'Apps Threads' 'threads' apps apps stacked 20005 %d\n", update_every);
+       fprintf(stdout, "CHART apps.threads '' 'Apps Threads' 'threads' processes apps.threads stacked 20005 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART apps.processes '' 'Apps Processes' 'processes' apps apps stacked 20004 %d\n", update_every);
+       fprintf(stdout, "CHART apps.processes '' 'Apps Processes' 'processes' processes apps.processes stacked 20004 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
        }
 
-       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);
+       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);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
        }
 
-       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);
+       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);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
        }
 
-       fprintf(stdout, "CHART apps.major_faults '' 'Apps Major Page Faults (swaps in)' 'page faults/s' apps apps stacked 20010 %d\n", update_every);
+       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);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART apps.minor_faults '' 'Apps Minor Page Faults' 'page faults/s' apps none stacked 20011 %d\n", update_every);
+       fprintf(stdout, "CHART apps.minor_faults '' 'Apps Minor Page Faults' 'page faults/s' mem apps.minor_faults stacked 20011 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART apps.lreads '' 'Apps Disk Logical Reads' 'kilobytes/s' apps none stacked 20042 %d\n", update_every);
+       fprintf(stdout, "CHART apps.lreads '' 'Apps Disk Logical Reads' 'kilobytes/s' disk apps.lreads stacked 20042 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
        }
 
-       fprintf(stdout, "CHART apps.lwrites '' 'Apps I/O Logical Writes' 'kilobytes/s' apps none stacked 20042 %d\n", update_every);
+       fprintf(stdout, "CHART apps.lwrites '' 'Apps I/O Logical Writes' 'kilobytes/s' disk apps.lwrites stacked 20042 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
        }
 
-       fprintf(stdout, "CHART apps.preads '' 'Apps Disk Reads' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every);
+       fprintf(stdout, "CHART apps.preads '' 'Apps Disk Reads' 'kilobytes/s' disk apps.preads stacked 20002 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
        }
 
-       fprintf(stdout, "CHART apps.pwrites '' 'Apps Disk Writes' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every);
+       fprintf(stdout, "CHART apps.pwrites '' 'Apps Disk Writes' 'kilobytes/s' disk apps.pwrites stacked 20002 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024);
        }
 
-       fprintf(stdout, "CHART apps.files '' 'Apps Open Files' 'open files' apps apps stacked 20050 %d\n", update_every);
+       fprintf(stdout, "CHART apps.files '' 'Apps Open Files' 'open files' disk apps.files stacked 20050 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART apps.sockets '' 'Apps Open Sockets' 'open sockets' apps apps stacked 20051 %d\n", update_every);
+       fprintf(stdout, "CHART apps.sockets '' 'Apps Open Sockets' 'open sockets' net apps.sockets stacked 20051 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART apps.pipes '' 'Apps Pipes' 'open pipes' apps none stacked 20053 %d\n", update_every);
+       fprintf(stdout, "CHART apps.pipes '' 'Apps Pipes' 'open pipes' processes apps.pipes stacked 20053 %d\n", update_every);
        for (w = target_root; w ; w = w->next) {
                if(w->target || (!w->processes && !w->exposed)) continue;
 
                fprintf(stdout, "DIMENSION %s '' absolute 1 1 noreset\n", w->name);
        }
 
-       fprintf(stdout, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' netdata netdata stacked 10000 %d\n", update_every);
+       fprintf(stdout, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' apps.plugin netdata.apps_cpu stacked 140000 %d\n", update_every);
        fprintf(stdout, "DIMENSION user '' incremental 1 %d\n", 1000);
        fprintf(stdout, "DIMENSION system '' incremental 1 %d\n", 1000);
 
-       fprintf(stdout, "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' netdata netdata line 10001 %d\n", update_every);
+       fprintf(stdout, "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' apps.plugin netdata.apps_files line 140001 %d\n", update_every);
        fprintf(stdout, "DIMENSION files '' incremental 1 1\n");
        fprintf(stdout, "DIMENSION pids '' absolute 1 1\n");
        fprintf(stdout, "DIMENSION fds '' absolute 1 1\n");
index 38d84db0f04b0af6e3c42da668d3e85e9f8700fd..a29757358aefd060fb9b47ee091776919051ff74 100755 (executable)
@@ -41,8 +41,8 @@ int netdata_exit = 0;
 void netdata_cleanup_and_exit(int ret)
 {
        netdata_exit = 1;
-       rrdset_free_all();
-       kill_childs();
+       rrdset_save_all();
+       // kill_childs();
        unlink("/var/run/netdata.pid");
        info("NetData exiting. Bye bye...");
        exit(ret);
index 62cc31da4b0524efceb04f740a6fcb20cd3ae2c2..379fb9a84616aefa04794ccbae238808526c707a 100755 (executable)
@@ -30,15 +30,15 @@ void *checks_main(void *ptr)
 
        RRDSET *check1, *check2, *check3, *apps_cpu = NULL;
 
-       check1 = rrdset_create("netdata", "check1", NULL, "netdata", "Caller gives microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
+       check1 = rrdset_create("netdata", "check1", NULL, "netdata", NULL, "Caller gives microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
        rrddim_add(check1, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE);
        rrddim_add(check1, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL);
 
-       check2 = rrdset_create("netdata", "check2", NULL, "netdata", "Netdata calcs microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
+       check2 = rrdset_create("netdata", "check2", NULL, "netdata", NULL, "Netdata calcs microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE);
        rrddim_add(check2, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE);
        rrddim_add(check2, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL);
 
-       check3 = rrdset_create("netdata", "checkdt", NULL, "netdata", "Clock difference", "microseconds diff", 99999, rrd_update_every, RRDSET_TYPE_LINE);
+       check3 = rrdset_create("netdata", "checkdt", NULL, "netdata", NULL, "Clock difference", "microseconds diff", 99999, rrd_update_every, RRDSET_TYPE_LINE);
        rrddim_add(check3, "caller", NULL, 1, 1, RRDDIM_ABSOLUTE);
        rrddim_add(check3, "netdata", NULL, 1, 1, RRDDIM_ABSOLUTE);
        rrddim_add(check3, "apps.plugin", NULL, 1, 1, RRDDIM_ABSOLUTE);
index a7197330c162d6b54f78c5d543da60e93d777b32..56c22a160187b129115c252221b2a230c8748ab7 100755 (executable)
@@ -36,7 +36,7 @@ void *cpuidlejitter_main(void *ptr)
 
        RRDSET *st = rrdset_find("system.idlejitter");
        if(!st) {
-               st = rrdset_create("system", "idlejitter", NULL, "cpu", "CPU Idle Jitter", "microseconds lost/s", 9999, rrd_update_every, RRDSET_TYPE_LINE);
+               st = rrdset_create("system", "idlejitter", NULL, "processes", NULL, "CPU Idle Jitter", "microseconds lost/s", 9999, rrd_update_every, RRDSET_TYPE_LINE);
                rrddim_add(st, "jitter", NULL, 1, 1, RRDDIM_ABSOLUTE);
        }
 
index ac96cb50b27bc4dffd8ee60bd63f3a0eeca64e2b..21aeecfb99bd42c90bd279200eed97159f90bc92 100755 (executable)
@@ -149,7 +149,7 @@ void *proc_main(void *ptr)
 
                        if(!stcpu_thread) stcpu_thread = rrdset_find("netdata.plugin_proc_cpu");
                        if(!stcpu_thread) {
-                               stcpu_thread = rrdset_create("netdata", "plugin_proc_cpu", NULL, "netdata", "NetData Proc Plugin CPU usage", "milliseconds/s", 9999, rrd_update_every, RRDSET_TYPE_STACKED);
+                               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);
 
                                rrddim_add(stcpu_thread, "user",  NULL,  1, 1000, RRDDIM_INCREMENTAL);
                                rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
@@ -164,7 +164,7 @@ void *proc_main(void *ptr)
 
                        if(!stcpu) stcpu = rrdset_find("netdata.server_cpu");
                        if(!stcpu) {
-                               stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", "NetData CPU usage", "milliseconds/s", 2000, rrd_update_every, RRDSET_TYPE_STACKED);
+                               stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", NULL, "NetData CPU usage", "milliseconds/s", 130000, rrd_update_every, RRDSET_TYPE_STACKED);
 
                                rrddim_add(stcpu, "user",  NULL,  1, 1000, RRDDIM_INCREMENTAL);
                                rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
@@ -179,7 +179,7 @@ void *proc_main(void *ptr)
 
                        if(!stclients) stclients = rrdset_find("netdata.clients");
                        if(!stclients) {
-                               stclients = rrdset_create("netdata", "clients", NULL, "netdata", "NetData Web Clients", "connected clients", 3000, rrd_update_every, RRDSET_TYPE_LINE);
+                               stclients = rrdset_create("netdata", "clients", NULL, "netdata", NULL, "NetData Web Clients", "connected clients", 131000, rrd_update_every, RRDSET_TYPE_LINE);
 
                                rrddim_add(stclients, "clients",  NULL,  1, 1, RRDDIM_ABSOLUTE);
                        }
@@ -192,7 +192,7 @@ void *proc_main(void *ptr)
 
                        if(!streqs) streqs = rrdset_find("netdata.requests");
                        if(!streqs) {
-                               streqs = rrdset_create("netdata", "requests", NULL, "netdata", "NetData Web Requests", "requests/s", 3001, rrd_update_every, RRDSET_TYPE_LINE);
+                               streqs = rrdset_create("netdata", "requests", NULL, "netdata", NULL, "NetData Web Requests", "requests/s", 131100, rrd_update_every, RRDSET_TYPE_LINE);
 
                                rrddim_add(streqs, "requests",  NULL,  1, 1, RRDDIM_INCREMENTAL);
                        }
@@ -205,7 +205,7 @@ void *proc_main(void *ptr)
 
                        if(!stbytes) stbytes = rrdset_find("netdata.net");
                        if(!stbytes) {
-                               stbytes = rrdset_create("netdata", "net", NULL, "netdata", "NetData Network Traffic", "kilobits/s", 3002, rrd_update_every, RRDSET_TYPE_AREA);
+                               stbytes = rrdset_create("netdata", "net", NULL, "netdata", NULL, "NetData Network Traffic", "kilobits/s", 131200, rrd_update_every, RRDSET_TYPE_AREA);
 
                                rrddim_add(stbytes, "in",  NULL,  8, 1024, RRDDIM_INCREMENTAL);
                                rrddim_add(stbytes, "out",  NULL,  -8, 1024, RRDDIM_INCREMENTAL);
index 5ed9140505c8fa4031f28db8133b1e7bb9ef7dc2..32c6dc115863accd4c0d3ebfbcb2334b0d398e65 100755 (executable)
@@ -235,7 +235,7 @@ static void tc_device_commit(struct tc_device *d)
                if(!st) {
                        debug(D_TC_LOOP, "TC: Creating new chart for device '%s'", d->name?d->name:d->id);
 
-                       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);
+                       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);
 
                        for(c = d->classes ; c ; c = c->next) {
                                if(!c->updated) continue;
@@ -626,7 +626,7 @@ void *tc_main(void *ptr)
 
                                if(!stcpu) stcpu = rrdset_find("netdata.plugin_tc_cpu");
                                if(!stcpu) {
-                                       stcpu = rrdset_create("netdata", "plugin_tc_cpu", NULL, "netdata", "NetData TC CPU usage", "milliseconds/s", 10000, rrd_update_every, RRDSET_TYPE_STACKED);
+                                       stcpu = rrdset_create("netdata", "plugin_tc_cpu", NULL, "tc.helper", NULL, "NetData TC CPU usage", "milliseconds/s", 135000, rrd_update_every, RRDSET_TYPE_STACKED);
                                        rrddim_add(stcpu, "user",  NULL,  1, 1000, RRDDIM_INCREMENTAL);
                                        rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL);
                                }
@@ -638,7 +638,7 @@ void *tc_main(void *ptr)
 
                                if(!sttime) stcpu = rrdset_find("netdata.plugin_tc_time");
                                if(!sttime) {
-                                       sttime = rrdset_create("netdata", "plugin_tc_time", NULL, "netdata", "NetData TC script execution", "milliseconds/run", 10001, rrd_update_every, RRDSET_TYPE_AREA);
+                                       sttime = rrdset_create("netdata", "plugin_tc_time", NULL, "tc.helper", NULL, "NetData TC script execution", "milliseconds/run", 135001, rrd_update_every, RRDSET_TYPE_AREA);
                                        rrddim_add(sttime, "run_time",  "run time",  1, 1, RRDDIM_ABSOLUTE);
                                }
                                else rrdset_next(sttime);
index b4cb57888d7c52296bb6a7af1eb610ff3ffad894..eb8f141b89a545c9c90fdce770f3055b0ecc400b 100755 (executable)
@@ -244,7 +244,7 @@ void *pluginsd_worker_thread(void *arg)
                                char *title = words[3];
                                char *units = words[4];
                                char *family = words[5];
-                               char *category = words[6];
+                               char *context = words[6];
                                char *chart = words[7];
                                char *priority_s = words[8];
                                char *update_every_s = words[9];
@@ -267,25 +267,23 @@ void *pluginsd_worker_thread(void *arg)
                                if(unlikely(chart)) chart_type = rrdset_type_id(chart);
 
                                if(unlikely(noname || !name || !*name || strcasecmp(name, "NULL") == 0 || strcasecmp(name, "(NULL)") == 0)) name = NULL;
-                               if(unlikely(!family || !*family)) family = id;
-                               if(unlikely(!category || !*category)) category = type;
+                               if(unlikely(!family || !*family)) family = NULL;
+                               if(unlikely(!context || !*context)) context = NULL;
 
                                st = rrdset_find_bytype(type, id);
                                if(unlikely(!st)) {
-                                       debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', category='%s', chart='%s', priority=%d, update_every=%d"
+                                       debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', context='%s', chart='%s', priority=%d, update_every=%d"
                                                , type, id
                                                , name?name:""
                                                , family?family:""
-                                               , category?category:""
+                                               , context?context:""
                                                , rrdset_type_name(chart_type)
                                                , priority
                                                , update_every
                                                );
 
-                                       st = rrdset_create(type, id, name, family, title, units, priority, update_every, chart_type);
+                                       st = rrdset_create(type, id, name, family, context, title, units, priority, update_every, chart_type);
                                        cd->update_every = update_every;
-
-                                       if(unlikely(strcmp(category, "none") == 0)) st->isdetail = 1;
                                }
                                else debug(D_PLUGINSD, "PLUGINSD: Chart '%s' already exists. Not adding it again.", st->id);
                        }
index 5a61e9f09c1d082f6f92552e90a6c40ffa9867c5..f404118fa87be8e2e8c0925888ae040ccc52c10c 100755 (executable)
@@ -299,7 +299,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                                }
                                else error("Cannot read sector size for device %s from %s. Assuming 512.", disk, ssfilename);
 
-                               st = rrdset_create(RRD_TYPE_DISK, disk, NULL, disk, "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA);
+                               st = rrdset_create(RRD_TYPE_DISK, disk, NULL, disk, "disk.io", "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA);
 
                                rrddim_add(st, "reads", NULL, sector_size, 1024, RRDDIM_INCREMENTAL);
                                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) {
                if(ddo_ops) {
                        st = rrdset_find_bytype("disk_ops", disk);
                        if(!st) {
-                               st = rrdset_create("disk_ops", disk, NULL, disk, "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("disk_ops", disk, NULL, disk, "disk.ops", "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -334,7 +334,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                if(ddo_qops) {
                        st = rrdset_find_bytype("disk_qops", disk);
                        if(!st) {
-                               st = rrdset_create("disk_qops", disk, NULL, disk, "Disk Current I/O Operations", "operations", 2002, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("disk_qops", disk, NULL, disk, "disk.qops", "Disk Current I/O Operations", "operations", 2002, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                rrddim_add(st, "operations", NULL, 1, 1, RRDDIM_ABSOLUTE);
@@ -350,7 +350,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                if(ddo_backlog) {
                        st = rrdset_find_bytype("disk_backlog", disk);
                        if(!st) {
-                               st = rrdset_create("disk_backlog", disk, NULL, disk, "Disk Backlog", "backlog (ms)", 2003, update_every, RRDSET_TYPE_AREA);
+                               st = rrdset_create("disk_backlog", disk, NULL, disk, "disk.backlog", "Disk Backlog", "backlog (ms)", 2003, update_every, RRDSET_TYPE_AREA);
                                st->isdetail = 1;
 
                                rrddim_add(st, "backlog", NULL, 1, 10, RRDDIM_INCREMENTAL);
@@ -366,7 +366,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                if(ddo_util) {
                        st = rrdset_find_bytype("disk_util", disk);
                        if(!st) {
-                               st = rrdset_create("disk_util", disk, NULL, disk, "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA);
+                               st = rrdset_create("disk_util", disk, NULL, disk, "disk.util", "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA);
                                st->isdetail = 1;
 
                                rrddim_add(st, "utilization", NULL, 1, 10, RRDDIM_INCREMENTAL);
@@ -382,7 +382,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                if(ddo_mops) {
                        st = rrdset_find_bytype("disk_mops", disk);
                        if(!st) {
-                               st = rrdset_create("disk_mops", disk, NULL, disk, "Disk Merged Operations", "merged operations/s", 2021, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("disk_mops", disk, NULL, disk, "disk.mops", "Disk Merged Operations", "merged operations/s", 2021, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -400,7 +400,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                if(ddo_iotime) {
                        st = rrdset_find_bytype("disk_iotime", disk);
                        if(!st) {
-                               st = rrdset_create("disk_iotime", disk, NULL, disk, "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("disk_iotime", disk, NULL, disk, "disk.iotime", "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -421,7 +421,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                        if(ddo_iotime && ddo_ops) {
                                st = rrdset_find_bytype("disk_await", disk);
                                if(!st) {
-                                       st = rrdset_create("disk_await", disk, NULL, disk, "Average Completed I/O Operation Time", "ms per operation", 2005, update_every, RRDSET_TYPE_LINE);
+                                       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);
                                        st->isdetail = 1;
 
                                        rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_ABSOLUTE);
@@ -437,7 +437,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                        if(ddo_io && ddo_ops) {
                                st = rrdset_find_bytype("disk_avgsz", disk);
                                if(!st) {
-                                       st = rrdset_create("disk_avgsz", disk, NULL, disk, "Average Completed I/O Operation Bandwidth", "kilobytes per operation", 2006, update_every, RRDSET_TYPE_AREA);
+                                       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);
                                        st->isdetail = 1;
 
                                        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) {
                        if(ddo_util && ddo_ops) {
                                st = rrdset_find_bytype("disk_svctm", disk);
                                if(!st) {
-                                       st = rrdset_create("disk_svctm", disk, NULL, disk, "Average Service Time", "ms per operation", 2007, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("disk_svctm", disk, NULL, disk, "disk.svctm", "Average Service Time", "ms per operation", 2007, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        rrddim_add(st, "svctm", NULL, 1, 1, RRDDIM_ABSOLUTE);
index e955b80eeaa08b16572080d7af576575b3ced458..25482dfa7eddb93e3626ad869a5eef79df98c946 100755 (executable)
@@ -116,7 +116,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
 
        st = rrdset_find_bytype("system", "interrupts");
        if(!st) {
-               st = rrdset_create("system", "interrupts", NULL, "system", "System interrupts", "interrupts/s", 1000, update_every, RRDSET_TYPE_STACKED);
+               st = rrdset_create("system", "interrupts", NULL, "interrupts", NULL, "System interrupts", "interrupts/s", 1000, update_every, RRDSET_TYPE_STACKED);
 
                for(l = 0; l < lines ;l++) {
                        if(!irrs[l].used) continue;
@@ -135,9 +135,6 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
                int c;
 
                for(c = 0; c < cpus ; c++) {
-                       char family[256];
-                       snprintf(family, 256, "cpu%d", c);
-
                        char id[256];
                        snprintf(id, 256, "cpu%d_interrupts", c);
 
@@ -146,7 +143,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
                                char name[256], title[256];
                                snprintf(name, 256, "cpu%d_interrupts", c);
                                snprintf(title, 256, "CPU%d Interrupts", c);
-                               st = rrdset_create("cpu", id, name, family, title, "interrupts/s", 2000 + c, update_every, RRDSET_TYPE_STACKED);
+                               st = rrdset_create("cpu", id, name, "interrupts", "cpu.interrupts", title, "interrupts/s", 2000 + c, update_every, RRDSET_TYPE_STACKED);
 
                                for(l = 0; l < lines ;l++) {
                                        if(!irrs[l].used) continue;
index a109e2365f79833cceba15038512c0d9e28bd660..dbd43369fd631dbadb39f4f5fd6c5a897666551a 100755 (executable)
@@ -22,7 +22,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
 
        if(do_ram == -1)                do_ram                  = config_get_boolean("plugin:proc:/proc/meminfo", "system ram", 1);
        if(do_swap == -1)               do_swap                 = config_get_boolean("plugin:proc:/proc/meminfo", "system swap", 1);
-       if(do_hwcorrupt == -1)  do_hwcorrupt    = config_get_boolean("plugin:proc:/proc/meminfo", "hardware corrupted ECC", 1);
+       if(do_hwcorrupt == -1)  do_hwcorrupt    = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "hardware corrupted ECC", CONFIG_ONDEMAND_ONDEMAND);
        if(do_committed == -1)  do_committed    = config_get_boolean("plugin:proc:/proc/meminfo", "committed memory", 1);
        if(do_writeback == -1)  do_writeback    = config_get_boolean("plugin:proc:/proc/meminfo", "writeback memory", 1);
        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) {
        if(do_ram) {
                st = rrdset_find("system.ram");
                if(!st) {
-                       st = rrdset_create("system", "ram", NULL, "mem", "System RAM", "MB", 200, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("system", "ram", NULL, "ram", NULL, "System RAM", "MB", 200, update_every, RRDSET_TYPE_STACKED);
 
                        rrddim_add(st, "buffers", NULL, 1, 1024, RRDDIM_ABSOLUTE);
                        rrddim_add(st, "used",    NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -138,7 +138,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
        if(do_swap) {
                st = rrdset_find("system.swap");
                if(!st) {
-                       st = rrdset_create("system", "swap", NULL, "mem", "System Swap", "MB", 201, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("system", "swap", NULL, "swap", NULL, "System Swap", "MB", 201, update_every, RRDSET_TYPE_STACKED);
                        st->isdetail = 1;
 
                        rrddim_add(st, "free",    NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -153,10 +153,12 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
 
        // --------------------------------------------------------------------
 
-       if(hwcorrupted && do_hwcorrupt) {
+       if(hwcorrupted && do_hwcorrupt && HardwareCorrupted > 0) {
+               do_hwcorrupt = CONFIG_ONDEMAND_YES;
+
                st = rrdset_find("mem.hwcorrupt");
                if(!st) {
-                       st = rrdset_create("mem", "hwcorrupt", NULL, "mem", "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("mem", "hwcorrupt", NULL, "errors", NULL, "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        rrddim_add(st, "HardwareCorrupted", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -172,7 +174,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
        if(do_committed) {
                st = rrdset_find("mem.committed");
                if(!st) {
-                       st = rrdset_create("mem", "committed", NULL, "mem", "Committed (Allocated) Memory", "MB", 5000, update_every, RRDSET_TYPE_AREA);
+                       st = rrdset_create("mem", "committed", NULL, "system", NULL, "Committed (Allocated) Memory", "MB", 5000, update_every, RRDSET_TYPE_AREA);
                        st->isdetail = 1;
 
                        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) {
        if(do_writeback) {
                st = rrdset_find("mem.writeback");
                if(!st) {
-                       st = rrdset_create("mem", "writeback", NULL, "mem", "Writeback Memory", "MB", 4000, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("mem", "writeback", NULL, "kernel", NULL, "Writeback Memory", "MB", 4000, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        rrddim_add(st, "Dirty", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -212,7 +214,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
        if(do_kernel) {
                st = rrdset_find("mem.kernel");
                if(!st) {
-                       st = rrdset_create("mem", "kernel", NULL, "mem", "Memory Used by Kernel", "MB", 6000, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("mem", "kernel", NULL, "kernel", NULL, "Memory Used by Kernel", "MB", 6000, update_every, RRDSET_TYPE_STACKED);
                        st->isdetail = 1;
 
                        rrddim_add(st, "Slab", NULL, 1, 1024, RRDDIM_ABSOLUTE);
@@ -234,7 +236,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
        if(do_slab) {
                st = rrdset_find("mem.slab");
                if(!st) {
-                       st = rrdset_create("mem", "slab", NULL, "mem", "Reclaimable Kernel Memory", "MB", 6500, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("mem", "slab", NULL, "slab", NULL, "Reclaimable Kernel Memory", "MB", 6500, update_every, RRDSET_TYPE_STACKED);
                        st->isdetail = 1;
 
                        rrddim_add(st, "reclaimable", NULL, 1, 1024, RRDDIM_ABSOLUTE);
index ac52ceeb0d44b8787fea3df8c0b95c08c6b151a8..5070ab817501ec8e2e12fd19c8d4842141c50229 100755 (executable)
@@ -118,7 +118,7 @@ int do_proc_net_dev(int update_every, unsigned long long dt) {
                if(ddo_bandwidth) {
                        st = rrdset_find_bytype("net", iface);
                        if(!st) {
-                               st = rrdset_create("net", iface, NULL, iface, "Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
+                               st = rrdset_create("net", iface, NULL, iface, "net.net", "Bandwidth", "kilobits/s", 7000, update_every, RRDSET_TYPE_AREA);
 
                                rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
                                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) {
                if(ddo_packets) {
                        st = rrdset_find_bytype("net_packets", iface);
                        if(!st) {
-                               st = rrdset_create("net_packets", iface, NULL, iface, "Packets", "packets/s", 1001, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_packets", iface, NULL, iface, "net.packets", "Packets", "packets/s", 7001, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                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) {
                if(ddo_errors) {
                        st = rrdset_find_bytype("net_errors", iface);
                        if(!st) {
-                               st = rrdset_create("net_errors", iface, NULL, iface, "Interface Errors", "errors/s", 1002, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_errors", iface, NULL, iface, "net.errors", "Interface Errors", "errors/s", 7002, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                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) {
                if(ddo_drops) {
                        st = rrdset_find_bytype("net_drops", iface);
                        if(!st) {
-                               st = rrdset_create("net_drops", iface, NULL, iface, "Interface Drops", "drops/s", 1003, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_drops", iface, NULL, iface, "net.drops", "Interface Drops", "drops/s", 7003, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                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) {
                if(ddo_fifo) {
                        st = rrdset_find_bytype("net_fifo", iface);
                        if(!st) {
-                               st = rrdset_create("net_fifo", iface, NULL, iface, "Interface FIFO Buffer Errors", "errors", 1100, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_fifo", iface, NULL, iface, "net.fifo", "Interface FIFO Buffer Errors", "errors", 7004, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                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) {
                if(ddo_compressed) {
                        st = rrdset_find_bytype("net_compressed", iface);
                        if(!st) {
-                               st = rrdset_create("net_compressed", iface, NULL, iface, "Compressed Packets", "packets/s", 1200, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_compressed", iface, NULL, iface, "net.compressed", "Compressed Packets", "packets/s", 7005, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                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) {
                if(ddo_events) {
                        st = rrdset_find_bytype("net_events", iface);
                        if(!st) {
-                               st = rrdset_create("net_events", iface, NULL, iface, "Network Interface Events", "events/s", 1200, update_every, RRDSET_TYPE_LINE);
+                               st = rrdset_create("net_events", iface, NULL, iface, "net.events", "Network Interface Events", "events/s", 7006, update_every, RRDSET_TYPE_LINE);
                                st->isdetail = 1;
 
                                rrddim_add(st, "frames", NULL, 1, 1, RRDDIM_INCREMENTAL);
index 280df962f96db1b3ca67facc3847fa91823bf9e9..8c2ece7d33de3020b73c6d895c08731164a104d3 100755 (executable)
@@ -54,7 +54,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) {
        if(do_sockets) {
                st = rrdset_find(RRD_TYPE_NET_IPVS ".sockets");
                if(!st) {
-                       st = rrdset_create(RRD_TYPE_NET_IPVS, "sockets", NULL, RRD_TYPE_NET_IPVS, "IPVS New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE);
+                       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);
 
                        rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_INCREMENTAL);
                }
@@ -69,7 +69,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) {
        if(do_packets) {
                st = rrdset_find(RRD_TYPE_NET_IPVS ".packets");
                if(!st) {
-                       st = rrdset_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, "IPVS Packets", "packets/s", 1002, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, NULL, "IPVS Packets", "packets/s", 1002, update_every, RRDSET_TYPE_LINE);
 
                        rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
                        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) {
        if(do_bandwidth) {
                st = rrdset_find(RRD_TYPE_NET_IPVS ".net");
                if(!st) {
-                       st = rrdset_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, "IPVS Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
+                       st = rrdset_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, NULL, "IPVS Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA);
 
                        rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
                        rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
index c99565c100de206cc7a59f6501fc6bbf85a62ddb..3f178a4a363cd62108726fef098f9473aaf2f5b0 100755 (executable)
@@ -77,7 +77,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
                        if(do_bandwidth) {
                                st = rrdset_find("system.ipv4");
                                if(!st) {
-                                       st = rrdset_create("system", "ipv4", NULL, "ipv4", "IPv4 Bandwidth", "kilobits/s", 2000, update_every, RRDSET_TYPE_AREA);
+                                       st = rrdset_create("system", "ipv4", NULL, "network", NULL, "IPv4 Bandwidth", "kilobits/s", 500, update_every, RRDSET_TYPE_AREA);
 
                                        rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
                                        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) {
                        if(do_inerrors) {
                                st = rrdset_find("ipv4.inerrors");
                                if(!st) {
-                                       st = rrdset_create("ipv4", "inerrors", NULL, "ipv4", "IPv4 Input Errors", "packets/s", 4000, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("ipv4", "inerrors", NULL, "errors", NULL, "IPv4 Input Errors", "packets/s", 4000, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_mcast) {
                                st = rrdset_find("ipv4.mcast");
                                if(!st) {
-                                       st = rrdset_create("ipv4", "mcast", NULL, "ipv4", "IPv4 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
+                                       st = rrdset_create("ipv4", "mcast", NULL, "multicast", NULL, "IPv4 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_bcast) {
                                st = rrdset_find("ipv4.bcast");
                                if(!st) {
-                                       st = rrdset_create("ipv4", "bcast", NULL, "ipv4", "IPv4 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
+                                       st = rrdset_create("ipv4", "bcast", NULL, "broadcast", NULL, "IPv4 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_mcast_p) {
                                st = rrdset_find("ipv4.mcastpkts");
                                if(!st) {
-                                       st = rrdset_create("ipv4", "mcastpkts", NULL, "ipv4", "IPv4 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("ipv4", "mcastpkts", NULL, "multicast", NULL, "IPv4 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_bcast_p) {
                                st = rrdset_find("ipv4.bcastpkts");
                                if(!st) {
-                                       st = rrdset_create("ipv4", "bcastpkts", NULL, "ipv4", "IPv4 Broadcast Packets", "packets/s", 8500, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("ipv4", "bcastpkts", NULL, "broadcast", NULL, "IPv4 Broadcast Packets", "packets/s", 8500, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
index e111bd417042d175f651ca4233ffe6e142cf5e87..12949f5d23e90e4fea3f927aae9b1f1d333ebf49 100644 (file)
@@ -420,7 +420,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
        if(do_rc == 2) {
                st = rrdset_find_bytype("nfsd", "readcache");
                if(!st) {
-                       st = rrdset_create("nfsd", "readcache", NULL, "nfsd", "Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "readcache", NULL, "nfsd", NULL, "Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED);
 
                        rrddim_add(st, "hits", NULL, 1, 1, RRDDIM_INCREMENTAL);
                        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) {
        if(do_fh == 2) {
                st = rrdset_find_bytype("nfsd", "filehandles");
                if(!st) {
-                       st = rrdset_create("nfsd", "filehandles", NULL, "nfsd", "File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("nfsd", "filehandles", NULL, "nfsd", NULL, "File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        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) {
        if(do_io == 2) {
                st = rrdset_find_bytype("nfsd", "io");
                if(!st) {
-                       st = rrdset_create("nfsd", "io", NULL, "nfsd", "I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA);
+                       st = rrdset_create("nfsd", "io", NULL, "nfsd", NULL, "I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA);
 
                        rrddim_add(st, "read", NULL, 1, 1000, RRDDIM_INCREMENTAL);
                        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) {
        if(do_th == 2) {
                st = rrdset_find_bytype("nfsd", "threads");
                if(!st) {
-                       st = rrdset_create("nfsd", "threads", NULL, "nfsd", "Threads", "threads", 5003, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("nfsd", "threads", NULL, "nfsd", NULL, "Threads", "threads", 5003, update_every, RRDSET_TYPE_LINE);
 
                        rrddim_add(st, "threads", NULL, 1, 1, RRDDIM_ABSOLUTE);
                }
@@ -491,7 +491,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
 
                st = rrdset_find_bytype("nfsd", "threads_fullcnt");
                if(!st) {
-                       st = rrdset_create("nfsd", "threads_fullcnt", NULL, "nfsd", "Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("nfsd", "threads_fullcnt", NULL, "nfsd", NULL, "Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE);
 
                        rrddim_add(st, "full_count", NULL, 1, 1, RRDDIM_INCREMENTAL);
                }
@@ -502,7 +502,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
 
                st = rrdset_find_bytype("nfsd", "threads_histogram");
                if(!st) {
-                       st = rrdset_create("nfsd", "threads_histogram", NULL, "nfsd", "Threads Usage Histogram", "percentage", 5005, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("nfsd", "threads_histogram", NULL, "nfsd", NULL, "Threads Usage Histogram", "percentage", 5005, update_every, RRDSET_TYPE_LINE);
 
                        rrddim_add(st, "0%-10%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
                        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) {
        if(do_ra == 2) {
                st = rrdset_find_bytype("nfsd", "readahead");
                if(!st) {
-                       st = rrdset_create("nfsd", "readahead", NULL, "nfsd", "Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "readahead", NULL, "nfsd", NULL, "Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED);
 
                        rrddim_add(st, "10%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
                        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) {
        if(do_net == 2) {
                st = rrdset_find_bytype("nfsd", "net");
                if(!st) {
-                       st = rrdset_create("nfsd", "net", NULL, "nfsd", "Network Reads", "reads/s", 5007, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "net", NULL, "nfsd", NULL, "Network Reads", "reads/s", 5007, update_every, RRDSET_TYPE_STACKED);
                        st->isdetail = 1;
 
                        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) {
        if(do_rpc == 2) {
                st = rrdset_find_bytype("nfsd", "rpc");
                if(!st) {
-                       st = rrdset_create("nfsd", "rpc", NULL, "nfsd", "Remote Procedure Calls", "calls/s", 5008, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("nfsd", "rpc", NULL, "nfsd", NULL, "Remote Procedure Calls", "calls/s", 5008, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        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) {
                unsigned int i;
                st = rrdset_find_bytype("nfsd", "proc2");
                if(!st) {
-                       st = rrdset_create("nfsd", "proc2", NULL, "nfsd", "NFS v2 Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "proc2", NULL, "nfsd", NULL, "NFS v2 Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED);
 
                        for(i = 0; nfsd_proc_values[i].present2 ; i++)
                                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) {
                unsigned int i;
                st = rrdset_find_bytype("nfsd", "proc3");
                if(!st) {
-                       st = rrdset_create("nfsd", "proc3", NULL, "nfsd", "NFS v3 Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "proc3", NULL, "nfsd", NULL, "NFS v3 Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED);
 
                        for(i = 0; nfsd_proc_values[i].present3 ; i++)
                                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) {
                unsigned int i;
                st = rrdset_find_bytype("nfsd", "proc4");
                if(!st) {
-                       st = rrdset_create("nfsd", "proc4", NULL, "nfsd", "NFS v4 Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "proc4", NULL, "nfsd", NULL, "NFS v4 Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED);
 
                        for(i = 0; nfsd_proc_values[i].present4 ; i++)
                                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) {
                unsigned int i;
                st = rrdset_find_bytype("nfsd", "proc4ops");
                if(!st) {
-                       st = rrdset_create("nfsd", "proc4ops", NULL, "nfsd", "NFS v4 Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED);
+                       st = rrdset_create("nfsd", "proc4ops", NULL, "nfsd", NULL, "NFS v4 Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED);
 
                        for(i = 0; nfsd4_ops_values[i].present ; i++)
                                rrddim_add(st, nfsd4_ops_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
index 9a7b988319d58272b16e5f02bef16c330303efea..3ea94fe5909b24fc506aa5e702b5db29bb9298e0 100755 (executable)
@@ -101,7 +101,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
                        if(do_ip_packets) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".packets");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "packets", NULL, RRD_TYPE_NET_SNMP, "IPv4 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "packets", NULL, "packets", NULL, "IPv4 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
 
                                        rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
                                        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) {
                        if(do_ip_fragsout) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".fragsout");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, "fragments", NULL, "IPv4 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_ip_fragsin) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".fragsin");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, "fragments", NULL, "IPv4 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_ip_errors) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".errors");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "errors", NULL, RRD_TYPE_NET_SNMP, "IPv4 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "errors", NULL, "errors", NULL, "IPv4 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_tcp_sockets) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".tcpsock");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcpsock", NULL, "tcp", "IPv4 TCP Connections", "active connections", 2500, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcpsock", NULL, "tcp", NULL, "IPv4 TCP Connections", "active connections", 2500, update_every, RRDSET_TYPE_LINE);
 
                                        rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_ABSOLUTE);
                                }
@@ -242,7 +242,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
                        if(do_tcp_packets) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".tcppackets");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", "IPv4 TCP Packets", "packets/s", 2600, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", NULL, "IPv4 TCP Packets", "packets/s", 2600, update_every, RRDSET_TYPE_LINE);
 
                                        rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
                                        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) {
                        if(do_tcp_errors) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".tcperrors");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", "IPv4 TCP Errors", "packets/s", 2700, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", NULL, "IPv4 TCP Errors", "packets/s", 2700, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_tcp_handshake) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".tcphandshake");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", "IPv4 TCP Handshake Issues", "events/s", 2900, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", NULL, "IPv4 TCP Handshake Issues", "events/s", 2900, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        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) {
                        if(do_udp_packets) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".udppackets");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", "IPv4 UDP Packets", "packets/s", 2601, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", NULL, "IPv4 UDP Packets", "packets/s", 2601, update_every, RRDSET_TYPE_LINE);
 
                                        rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
                                        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) {
                        if(do_udp_errors) {
                                st = rrdset_find(RRD_TYPE_NET_SNMP ".udperrors");
                                if(!st) {
-                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", "IPv4 UDP Errors", "events/s", 2701, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", NULL, "IPv4 UDP Errors", "events/s", 2701, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
index 86b8643ba75c02899e7fcb4093fa44b5ebb5d3dc..912c3eef0b0181196b3632daf61600c5827da85f 100755 (executable)
@@ -99,7 +99,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
        if(do_sockets) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".sockets");
                if(!st) {
-                       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);
+                       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);
 
                        rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_ABSOLUTE);
                }
@@ -114,7 +114,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
        if(do_new) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".new");
                if(!st) {
-                       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);
+                       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);
 
                        rrddim_add(st, "new", NULL, 1, 1, RRDDIM_INCREMENTAL);
                        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) {
        if(do_changes) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".changes");
                if(!st) {
-                       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);
+                       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);
                        st->isdetail = 1;
 
                        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) {
        if(do_expect) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".expect");
                if(!st) {
-                       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);
+                       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);
                        st->isdetail = 1;
 
                        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) {
        if(do_search) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".search");
                if(!st) {
-                       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);
+                       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);
                        st->isdetail = 1;
 
                        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) {
        if(do_errors) {
                st = rrdset_find(RRD_TYPE_NET_STAT_CONNTRACK ".errors");
                if(!st) {
-                       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);
+                       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);
                        st->isdetail = 1;
 
                        rrddim_add(st, "icmp_error", NULL, 1, 1, RRDDIM_INCREMENTAL);
index 7f280ac1e8130017aed39c9c9742d4b0acb740e0..9373baaecae5f33da22a76bc54fab747dd013c4b 100755 (executable)
@@ -104,7 +104,7 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
 
        st = rrdset_find_bytype("system", "softirqs");
        if(!st) {
-               st = rrdset_create("system", "softirqs", NULL, "system", "System softirqs", "softirqs/s", 1001, update_every, RRDSET_TYPE_STACKED);
+               st = rrdset_create("system", "softirqs", NULL, "softirqs", NULL, "System softirqs", "softirqs/s", 950, update_every, RRDSET_TYPE_STACKED);
 
                for(l = 0; l < lines ;l++) {
                        if(!irrs[l].used) continue;
@@ -123,9 +123,6 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
                int c;
 
                for(c = 0; c < cpus ; c++) {
-                       char family[256];
-                       snprintf(family, 256, "cpu%d", c);
-
                        char id[256];
                        snprintf(id, 256, "cpu%d_softirqs", c);
 
@@ -142,7 +139,7 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
                                char name[256], title[256];
                                snprintf(name, 256, "cpu%d_softirqs", c);
                                snprintf(title, 256, "CPU%d softirqs", c);
-                               st = rrdset_create("cpu", id, name, family, title, "softirqs/s", 3000 + c, update_every, RRDSET_TYPE_STACKED);
+                               st = rrdset_create("cpu", id, name, "softirqs", "cpu.softirqs", title, "softirqs/s", 3000 + c, update_every, RRDSET_TYPE_STACKED);
 
                                for(l = 0; l < lines ;l++) {
                                        if(!irrs[l].used) continue;
index 133ad97d8af9a742af1f5cdcbe796a2595c15693..4009644d717bcbbd5e56afe8160f6e908f3a5ee9 100755 (executable)
@@ -69,20 +69,24 @@ int do_proc_stat(int update_every, unsigned long long dt) {
 
                        char *title = "Core utilization";
                        char *type = RRD_TYPE_STAT;
+                       char *context = "cpu.cpu";
+                       char *family = "utilization";
                        long priority = 1000;
                        int isthistotal = 0;
 
                        if(strcmp(id, "cpu") == 0) {
                                isthistotal = 1;
-                               title = "Total CPU utilization";
                                type = "system";
+                               title = "Total CPU utilization";
+                               context = "system.cpu";
+                               family = id;
                                priority = 100;
                        }
 
                        if((isthistotal && do_cpu) || (!isthistotal && do_cpu_cores)) {
                                st = rrdset_find_bytype(type, id);
                                if(!st) {
-                                       st = rrdset_create(type, id, NULL, id, title, "percentage", priority, update_every, RRDSET_TYPE_STACKED);
+                                       st = rrdset_create(type, id, NULL, family, context, title, "percentage", priority, update_every, RRDSET_TYPE_STACKED);
 
                                        long multiplier = 1;
                                        long divisor = 1; // sysconf(_SC_CLK_TCK);
@@ -123,7 +127,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
                        if(do_interrupts) {
                                st = rrdset_find_bytype("system", "intr");
                                if(!st) {
-                                       st = rrdset_create("system", "intr", NULL, "cpu", "CPU Interrupts", "interrupts/s", 900, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("system", "intr", NULL, "interrupts", NULL, "CPU Interrupts", "interrupts/s", 900, update_every, RRDSET_TYPE_LINE);
                                        st->isdetail = 1;
 
                                        rrddim_add(st, "interrupts", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -142,7 +146,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
                        if(do_context) {
                                st = rrdset_find_bytype("system", "ctxt");
                                if(!st) {
-                                       st = rrdset_create("system", "ctxt", NULL, "cpu", "CPU Context Switches", "context switches/s", 800, update_every, RRDSET_TYPE_LINE);
+                                       st = rrdset_create("system", "ctxt", NULL, "processes", NULL, "CPU Context Switches", "context switches/s", 800, update_every, RRDSET_TYPE_LINE);
 
                                        rrddim_add(st, "switches", NULL, 1, 1, RRDDIM_INCREMENTAL);
                                }
@@ -168,7 +172,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
        if(do_forks) {
                st = rrdset_find_bytype("system", "forks");
                if(!st) {
-                       st = rrdset_create("system", "forks", NULL, "cpu", "New Processes", "processes/s", 700, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("system", "forks", NULL, "processes", NULL, "New Processes", "processes/s", 700, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        rrddim_add(st, "started", NULL, 1, 1, RRDDIM_INCREMENTAL);
@@ -184,7 +188,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
        if(do_processes) {
                st = rrdset_find_bytype("system", "processes");
                if(!st) {
-                       st = rrdset_create("system", "processes", NULL, "cpu", "Processes", "processes", 600, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("system", "processes", NULL, "processes", NULL, "Processes", "processes", 600, update_every, RRDSET_TYPE_LINE);
 
                        rrddim_add(st, "running", NULL, 1, 1, RRDDIM_ABSOLUTE);
                        rrddim_add(st, "blocked", NULL, -1, 1, RRDDIM_ABSOLUTE);
index b576968b0240e1b561669dfcedb947b5d8df9a03..40b84ed79335e208f53bfc62062e230525db9c7e 100755 (executable)
@@ -29,7 +29,7 @@ int do_proc_sys_kernel_random_entropy_avail(int update_every, unsigned long long
 
        RRDSET *st = rrdset_find_bytype("system", "entropy");
        if(!st) {
-               st = rrdset_create("system", "entropy", NULL, "system", "Available Entropy", "entropy", 1000, update_every, RRDSET_TYPE_LINE);
+               st = rrdset_create("system", "entropy", NULL, "cryptography", NULL, "Available Entropy", "entropy", 1000, update_every, RRDSET_TYPE_LINE);
                rrddim_add(st, "entropy", NULL, 1, 1, RRDDIM_ABSOLUTE);
        }
        else rrdset_next(st);
index 560e99565b9f248ee5429005fab2f7e5a5a6f091..6dd2788e53e63c871359cfc0492ebe48ebce3677 100755 (executable)
@@ -164,7 +164,7 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
        if(do_swapio) {
                st = rrdset_find("system.swapio");
                if(!st) {
-                       st = rrdset_create("system", "swapio", NULL, "mem", "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA);
+                       st = rrdset_create("system", "swapio", NULL, "swap", NULL, "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA);
 
                        rrddim_add(st, "in",  NULL, sysconf(_SC_PAGESIZE), 1024, RRDDIM_INCREMENTAL);
                        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) {
        if(do_io) {
                st = rrdset_find("system.io");
                if(!st) {
-                       st = rrdset_create("system", "io", NULL, "disk", "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA);
+                       st = rrdset_create("system", "io", NULL, "disk", NULL, "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA);
 
                        rrddim_add(st, "in",  NULL,  1, 1, RRDDIM_INCREMENTAL);
                        rrddim_add(st, "out", NULL, -1, 1, RRDDIM_INCREMENTAL);
@@ -196,9 +196,9 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
        // --------------------------------------------------------------------
 
        if(do_pgfaults) {
-               st = rrdset_find("system.pgfaults");
+               st = rrdset_find("mem.pgfaults");
                if(!st) {
-                       st = rrdset_create("system", "pgfaults", NULL, "mem", "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE);
+                       st = rrdset_create("mem", "pgfaults", NULL, "system", NULL, "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE);
                        st->isdetail = 1;
 
                        rrddim_add(st, "minor",  NULL,  1, 1, RRDDIM_INCREMENTAL);
index 1115eac0026691237475f4f662e9106c5cedfaca..2dce02e669741df8de4d1a31d4a923fe13a15b0d 100755 (executable)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -335,8 +335,13 @@ void rrdset_reset(RRDSET *st)
        }
 }
 
-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)
+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)
 {
+       if(!type || !type[0]) {
+               fatal("Cannot create rrd stats without a type.");
+               return NULL;
+       }
+
        if(!id || !id[0]) {
                fatal("Cannot create rrd stats without an id.");
                return NULL;
@@ -348,6 +353,12 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
 
        snprintf(fullid, RRD_ID_LENGTH_MAX, "%s.%s", type, id);
 
+       st = rrdset_find(fullid);
+       if(st) {
+               error("Cannot create rrd stats for '%s', it already exists.", fullid);
+               return st;
+       }
+
        long entries = config_get_number(fullid, "history", rrd_default_history_entries);
        if(entries < 5) entries = config_set_number(fullid, "history", 5);
        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
                st->name = NULL;
                st->type = NULL;
                st->family = NULL;
+               st->context = NULL;
                st->title = NULL;
                st->units = NULL;
                st->dimensions = NULL;
@@ -422,10 +434,11 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
 
        st->cache_dir = cache_dir;
 
-       st->family     = config_get(st->id, "family", family?family:st->id);
-       st->units      = config_get(st->id, "units", units?units:"");
-       st->type       = config_get(st->id, "type", type);
        st->chart_type = rrdset_type_id(config_get(st->id, "chart type", rrdset_type_name(chart_type)));
+       st->type       = config_get(st->id, "type", type);
+       st->family     = config_get(st->id, "family", family?family:st->type);
+       st->context    = config_get(st->id, "context", context?context:st->id);
+       st->units      = config_get(st->id, "units", units?units:"");
 
        st->priority = config_get_number(st->id, "priority", priority);
        st->enabled = enabled;
index b482d3e4e08c2b3aae21226bdf6be47ecd6ea6fc..4211b7d563d103fabe8eaaa8d65dd666efa30884 100755 (executable)
--- a/src/rrd.h
+++ b/src/rrd.h
@@ -22,8 +22,8 @@ extern int rrd_delete_unupdated_dimensions;
 
 #define RRD_ID_LENGTH_MAX 1024
 
-#define RRDSET_MAGIC           "NETDATA RRD SET FILE V016"
-#define RRDDIMENSION_MAGIC     "NETDATA RRD DIMENSION FILE V016"
+#define RRDSET_MAGIC           "NETDATA RRD SET FILE V017"
+#define RRDDIMENSION_MAGIC     "NETDATA RRD DIMENSION FILE V017"
 
 typedef long long total_number;
 #define TOTAL_NUMBER_FORMAT "%lld"
@@ -182,7 +182,8 @@ struct rrdset {
                                                                                                        // (the user overwrites the name of the charts)
 
        char *type;                                                                             // the type of graph RRD_TYPE_* (a category, for determining graphing options)
-       char *family;                                                                   // the family of this data set (for grouping them together)
+       char *family;                                                                   // grouping sets under the same family
+       char *context;                                                                  // the template of this data set
        char *title;                                                                    // title shown to user
        char *units;                                                                    // units of measurement
 
@@ -263,7 +264,16 @@ extern char *rrdset_cache_dir(const char *id);
 
 extern void rrdset_reset(RRDSET *st);
 
-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);
+extern 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);
 
 extern void rrdset_free_all(void);
 extern void rrdset_save_all(void);
index b9a123db668207084ae5603f9af7272569a4d89f..ad453cb687f957aa35a2a99f1928cc2af4bbc07b 100755 (executable)
@@ -23,6 +23,7 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
                "\t\t\t\"name\": \"%s\",\n"
                "\t\t\t\"type\": \"%s\",\n"
                "\t\t\t\"family\": \"%s\",\n"
+               "\t\t\t\"context\": \"%s\",\n"
                "\t\t\t\"title\": \"%s\",\n"
                "\t\t\t\"priority\": %ld,\n"
                "\t\t\t\"enabled\": %s,\n"
@@ -38,6 +39,7 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
                , st->name
                , st->type
                , st->family
+               , st->context
                , st->title
                , st->priority
                , st->enabled?"true":"false"
@@ -122,6 +124,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
                "\t\t\t\"name\": \"%s\",\n"
                "\t\t\t\"type\": \"%s\",\n"
                "\t\t\t\"family\": \"%s\",\n"
+               "\t\t\t\"context\": \"%s\",\n"
                "\t\t\t\"title\": \"%s\",\n"
                "\t\t\t\"priority\": %ld,\n"
                "\t\t\t\"enabled\": %d,\n"
@@ -144,6 +147,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
                , st->name
                , st->type
                , st->family
+               , st->context
                , st->title
                , st->priority
                , st->enabled
index 7885fa792bb41adcdcc5b272c785529005cb4516..822e0d41ad43d39a95f70442763499203549f4fc 100755 (executable)
@@ -105,7 +105,7 @@ int do_sys_kernel_mm_ksm(int update_every, unsigned long long dt) {
 
        st = rrdset_find("mem.ksm");
        if(!st) {
-               st = rrdset_create("mem", "ksm", NULL, "ksm", "Kernel Same Page Merging", "MB", 5000, update_every, RRDSET_TYPE_AREA);
+               st = rrdset_create("mem", "ksm", NULL, "ksm", NULL, "Kernel Same Page Merging", "MB", 5000, update_every, RRDSET_TYPE_AREA);
 
                rrddim_add(st, "shared", NULL, 1, 1024 * 1024, RRDDIM_ABSOLUTE);
                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) {
 
        st = rrdset_find("mem.ksm_savings");
        if(!st) {
-               st = rrdset_create("mem", "ksm_savings", NULL, "ksm", "Kernel Same Page Merging Savings", "MB", 5001, update_every, RRDSET_TYPE_AREA);
+               st = rrdset_create("mem", "ksm_savings", NULL, "ksm", NULL, "Kernel Same Page Merging Savings", "MB", 5001, update_every, RRDSET_TYPE_AREA);
 
                rrddim_add(st, "savings", NULL, -1, 1024 * 1024, RRDDIM_ABSOLUTE);
                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) {
 
        st = rrdset_find("mem.ksm_ratios");
        if(!st) {
-               st = rrdset_create("mem", "ksm_ratios", NULL, "ksm", "Kernel Same Page Merging Effectiveness", "percentage", 5002, update_every, RRDSET_TYPE_LINE);
+               st = rrdset_create("mem", "ksm_ratios", NULL, "ksm", NULL, "Kernel Same Page Merging Effectiveness", "percentage", 5002, update_every, RRDSET_TYPE_LINE);
 
                rrddim_add(st, "savings", NULL, 1, 10000, RRDDIM_ABSOLUTE);
        }
index b1d25018235f4d89669362a87f27441f8ccd6e37..47aa5396cd32b5a654d030afc1d07323effbc7a1 100755 (executable)
@@ -617,7 +617,7 @@ int run_test(struct test *test)
        snprintf(name, 100, "unittest-%s", test->name);
 
        // create the chart
-       RRDSET *st = rrdset_create("netdata", name, name, "netdata", "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
+       RRDSET *st = rrdset_create("netdata", name, name, "netdata", NULL, "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
        RRDDIM *rd = rrddim_add(st, "dimension", NULL, test->multiplier, test->divisor, test->algorithm);
        st->debug = 1;
 
@@ -714,7 +714,7 @@ int unit_test(long delay, long shift)
        int do_abst = 0;
        int do_absi = 0;
 
-       RRDSET *st = rrdset_create("netdata", name, name, "netdata", "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
+       RRDSET *st = rrdset_create("netdata", name, name, "netdata", NULL, "Unit Testing", "a value", 1, 1, RRDSET_TYPE_LINE);
        st->debug = 1;
 
        RRDDIM *rdabs = NULL;
index b0c358b501975f94c0bbed2bdbc6cdfcf6b12f90..8955e3441abf6503dd5f1cc69095c3aeec384949 100755 (executable)
 
                        var c = $(this.element).data('colors');
                        // this.log('read colors: ' + c);
-                       if(typeof c !== 'undefined' && c !== null) {
+                       if(typeof c !== 'undefined' && c !== null && c.length > 0) {
                                if(typeof c !== 'string') {
                                        this.log('invalid color given: ' + c + ' (give a space separated list of colors)');
                                }
index 7fcc4fa52404506f6a92bb6d8367180ad3e90946..0060aecd5e87f433cf4a28d29f0c8cdde3c06969 100755 (executable)
@@ -726,40 +726,6 @@ function sparkline(chart, dimension, units) {
        return h;
 }
 
-// documentation for each category and chart
-var messages = {
-
-       // categories / sections
-       'system': 'Overview of the key system metrics.',
-       '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).',
-       'net': 'Per network interface statistics collected from <code>/proc/net/dev</code>.',
-       '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>.',
-
-       // charts
-       '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.',
-       '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.',
-       '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).',
-       '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.',
-       '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.',
-       'system.forks': 'The number of new processes created per second, read from <code>/proc/stat</code>.',
-       '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.',
-       '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.',
-       '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.',
-       '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.',
-       '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.',
-       '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).',
-       'system.ipv4': 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.',
-       'system.ram': 'System memory, read from <code>/proc/meminfo</code>.',
-       'system.swap': 'System swap memory, read from <code>/proc/meminfo</code>.',
-
-       // just a line to allow ending all entries above with comma
-       'end': 'end'
-};
-
-function screenWidth() {
-       return (($(window).width() * 0.95) - 50);
-}
-
 function chartsPerRow(total) {
        if(options.chartsPerRow === 0) {
                width = Math.floor(total / options.chartsMinWidth);
@@ -769,249 +735,559 @@ function chartsPerRow(total) {
        else return options.chartsPerRow;
 }
 
-function chartsPrioritySort(a, b) {
-       if(a.priority === b.priority) {
-               if(a.name < b.name) return -1;
-       }
-       else if(a.priority < b.priority) return -1;
+function prioritySort(a, b) {
+       if(a.priority < b.priority) return -1;
+       if(a.priority > b.priority) return 1;
+       if(a.name < b.name) return -1;
        return 1;
 }
 
-function uniq(array, find_key, get_result) {
-       if(typeof get_result === 'undefined' || get_result === null)
-               get_result = find_key;
-
+function sortObjectByPriority(object) {
        var idx = {};
-       var result = new Array();
+       var sorted = new Array();
 
-       $.each(array, function(i, c) {
-               key = find_key(c);
-               if(typeof idx[key] === 'undefined') {
-                       idx[key] = true;
-                       result.push(get_result(c));
+       for(var i in object) {
+               if(typeof idx[i] === 'undefined') {
+                       idx[i] = object[i];
+                       sorted.push(i);
                }
-       });
-       return result;
-}
-
-function uniq_with_list(array, find_key_function) {
-       var idx = {};
-       var result = new Array();
+       }
 
-       $.each(array, function(i, c) {
-               key = find_key_function(c);
-               if(typeof idx[key] === 'undefined') {
-                       idx[key] = new Array();
-                       result.push( { name: key, values: idx[key] } );
-               }
-               idx[key].push(c);
-       });
-       result.sort(function(a, b) {
-               if(a.name < b.name) return -1;
+       sorted.sort(function(a, b) {
+               if(idx[a].priority < idx[b].priority) return -1;
+               if(idx[a].priority > idx[b].priority) return 1;
+               if(a < b) return -1;
                return 1;
        });
-       return result;
+
+       return sorted;
 }
 
-function prepareScreen(data) {
-       // console.log('NETDATA is paused - ready to prepare the screen');
-       // console.log(data);
+// ----------------------------------------------------------------------------
 
-       options.data = data;
-       options.hostname = data.hostname;
-       document.getElementById('hostname').innerHTML = options.hostname;
-       document.getElementById('hostname').href = NETDATA.serverDefault;
-       document.title = options.hostname + ' dashboard';
-       var charts = data.charts;
+function gaugeChart(title, width, dimensions, colors) {
+       if(typeof colors === 'undefined')
+               colors = '';
+       
+       if(typeof dimensions === 'undefined')
+               dimensions = '';
+       
+       return '<div data-netdata="CHART_UNIQUE_ID"'
+                                                       + ' data-dimensions="' + dimensions + '"'
+                                                       + ' data-chart-library="gauge"'
+                                                       + ' data-gauge-adjust="width"'
+                                                       + ' data-title="' + title + '"'
+                                                       + ' data-width="' + width + '"'
+                                                       + ' data-before="0"'
+                                                       + ' data-after="-CHART_DURATION"'
+                                                       + ' data-points="CHART_DURATION"'
+                                                       + ' data-colors="' + colors + '"'
+                                                       + ' role="application"></div>';
+}
 
-       function name2id(s) {
-               return s
-                       .replace(' ', '_')
-                       .replace('(', '_')
-                       .replace(')', '_')
-                       .replace('/', '_');
-       }
+// ----------------------------------------------------------------------------
+
+var menuData = {
+       'system': {
+               title: 'System Overview',
+               info: 'Overview of the key system metrics.'
+       },
+
+       'ap': {
+               title: 'Access Points',
+               info: undefined
+       },
+
+       'tc': {
+               title: 'Quality of Service',
+               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).'
+       },
+
+       'net': {
+               title: 'Network Interfaces',
+               info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
+       },
+
+       'ipv4': {
+               title: 'IPv4 Networking',
+               info: undefined
+       },
+
+       'ipvs': {
+               title: 'IP Virtual Server',
+               info: undefined
+       },
+
+       'netfilter': {
+               title: 'Firewall (netfilter)',
+               info: undefined
+       },
+
+       'cpu': {
+               title: 'CPUs',
+               info: undefined
+       },
+
+       'mem': {
+               title: 'Memory',
+               info: undefined
+       },
+
+       'disk': {
+               title: 'Disks',
+               info: undefined
+       },
+
+       'sensors': {
+               title: 'Sensors',
+               info: undefined
+       },
+
+       'nfsd': {
+               title: 'File Server (nfsd)',
+               info: undefined
+       },
+
+       'apps': {
+               title: 'Applications',
+               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>.',
+               height: 1.5
+       },
+
+       'netdata': {
+               title: 'Netdata Monitoring',
+               info: undefined
+       },
+
+       'example': {
+               title: 'Example Charts',
+               info: undefined
+       },
+};
 
-       $.each(charts, function(i, c) {
-               if(c.enabled === true) {
-
-                       // find the category of the chart
-                       c.category = c.type.split('.')[0];
-
-                       var tmp = c.category.split('_')[0];
-                       if(tmp === 'net' || tmp === 'disk' || tmp === 'ap')
-                               c.category = tmp;
-
-                       switch(c.category) {
-                               case 'system':
-                                       c.category_priority = 10;
-                                       c.category_title = 'System Summary';
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
-
-                               case 'tc':
-                                       c.category_priority = 20;
-                                       c.category_title = 'Quality Of Service';
-                                       c.glyphicon = "glyphicon-random";
-                                       
-                                       // find the name of the interface from the tc family
-                                       if(typeof options.interfaces_registry[c.family] === 'undefined' || options.interfaces_registry[c.family] === c.family)
-                                                options.interfaces_registry[c.family] = c.name.split('.')[1].split('_')[0];
-
-                                       break;
-
-                               case 'net':
-                                       c.category_priority = 30;
-                                       c.category_title = 'Network Interfaces';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'ap':
-                                       c.category_priority = 35;
-                                       c.category_title = 'Access Points';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'apps':
-                                       c.category_priority = 40;
-                                       c.category_title = 'Applications Monitoring';
-                                       c.glyphicon = "glyphicon-tasks";
-                                       break;
-
-                               case 'ipvs':
-                                       c.category_priority = 50;
-                                       c.category_title = 'IP Virtual Server';
-                                       c.glyphicon = "glyphicon-transfer";
-                                       break;
-
-                               case 'netfilter':
-                                       c.category_priority = 60;
-                                       c.category_title = 'Netfilter / IPTables';
-                                       c.glyphicon = "glyphicon-cloud";
-                                       break;
-
-                               case 'ipv4':
-                                       c.category_priority = 70;
-                                       c.category_title = 'IPv4 Summary';
-                                       c.glyphicon = "glyphicon-globe";
-                                       break;
-
-                               case 'mem':
-                                       c.category_priority = 80;
-                                       c.category_title = 'Memory';
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
-
-                               case 'cpu':
-                                       c.category_priority = 90;
-                                       c.category_title = 'CPU Cores';
-                                       c.glyphicon = "glyphicon-dashboard";
-
-                                       if(c.id.match(/^cpu\.cpu[0-9]+$/)) {
-                                               c.family = 'Utilization';
-                                       }
-                                       else if(c.id.match(/^cpu\.cpu[0-9]+_interrupts$/)) {
-                                               c.family = 'Interrupts';
-                                       }
-                                       else if(c.id.match(/^cpu\.cpu[0-9]+_softirqs$/)) {
-                                               c.family = 'SoftIRQs';
-                                       }
-
-                                       break;
-
-                               case 'disk':
-                                       c.category_priority = 100;
-                                       c.category_title = 'Disks';
-                                       c.glyphicon = "glyphicon-hdd";
-                                       break;
-
-                               case 'nfsd':
-                                       c.category_priority = 110;
-                                       c.category_title = 'NFS Server';
-                                       c.glyphicon = "glyphicon-hdd";
-                                       break;
-
-                               case 'squid':
-                                       c.category_priority = 140;
-                                       c.category_title = 'Proxy Server';
-                                       c.glyphicon = "glyphicon-link";
-                                       break;
-
-                               case 'netdata':
-                                       c.category_priority = 150;
-                                       c.category_title = 'Netdata Monitoring';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'sensors':
-                                       c.category_priority = 160;
-                                       c.category_title = 'Hardware Sensors';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'postfix':
-                                       c.category_priority = 170;
-                                       c.category_title = 'Mail Server';
-                                       c.glyphicon = "glyphicon-thumbs-up";
-                                       break;
-
-                               case 'example':
-                                       c.category_priority = 100000;
-                                       c.category_title = 'Example Plugins';
-                                       c.glyphicon = "glyphicon-search";
-                                       break;
-
-                               default:
-                                       c.category_priority = 150;
-                                       c.category_title = c.type;
-                                       c.glyphicon = "glyphicon-dashboard";
-                                       break;
-                       }
+var submenuData = {
+       'mem.ksm': {
+               title: 'Memory Deduper',
+               info: 'Kernel Same-page Merging (KSM) is the kernel memory de-duper.'
+       }
+};
 
-                       // find the unique categories
-                       if(typeof options.categories_idx[c.category] === 'undefined') {
-                               options.categories_idx[c.category] = {
-                                       charts: new Array()
-                               }
-                               options.categories.push({
-                                       name: c.category,
-                                       title: c.category_title,
-                                       priority: c.category_priority,
-                                       glyphicon: c.glyphicon,
-                                       charts: options.categories_idx[c.category].charts
-                               });
+var chartData = {
+       'system.cpu': {
+               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.'
+       },
+
+       'system.load': {
+               info: 'Current system load read from <code>/proc/loadavg</code>.',
+               height: 0.7
+       },
+
+       'system.io': {
+               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.'
+       },
+
+       'system.swapio': {
+               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).'
+       },
+
+       'system.pgfaults': {
+               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.'
+       },
+
+       'system.entropy': {
+               colors: '#CC22AA',
+               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.'
+       },
+
+       'system.forks': {
+               colors: '#5555DD',
+               info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
+       },
+
+       'system.intr': {
+               colors: '#DD5555',
+               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.'
+       },
+
+       'system.interrupts': {
+               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.'
+       },
+
+       'system.softirqs': {
+               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.'
+       },
+
+       'system.processes': {
+               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.'
+       },
+
+       'system.ctxt': {
+               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.'
+       },
+
+       'system.idlejitter': {
+               colors: '#5555AA',
+               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).'
+       },
+
+       'system.ipv4': {
+               info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.'
+       },
+
+       'system.ram': {
+               info: 'System memory, read from <code>/proc/meminfo</code>.'
+       },
+
+       'system.swap': {
+               info: 'System swap memory, read from <code>/proc/meminfo</code>.'
+       },
+
+       'mem.committed': {
+               colors: NETDATA.colors[3]
+       },
+
+       'apps.cpu': {
+               height: 2.0
+       },
+
+       'apps.preads': {
+               height: 2.0
+       },
+
+       'apps.pwrites': {
+               height: 2.0
+       },
+
+       'tc.qos': {
+               heads: [
+                       function(id) {
+                               if(id.match(/.*-ifb$/))
+                                       return gaugeChart('Inbound', '12%', '', '#5555AA');
+                               else
+                                       return gaugeChart('Outbound', '12%', '', '#AA9900');
                        }
-                       options.categories_idx[c.category].charts.push(c);
-
-                       // find the unique families
-                       if(typeof options.families_idx[c.family] === 'undefined') {
-                               options.families_idx[c.family] = {
-                                       charts: new Array()
-                               };
-                               options.families.push({
-                                       name: c.family,
-                                       title: c.family,
-                                       priority: c.category_priority,
-                                       glyphicon: c.glyphicon,
-                                       charts: options.categories_idx[c.category].charts
-                               });
+               ]
+       },
+
+       'net.net': {
+               heads: [
+                       gaugeChart('Received', '12%', 'received'),
+                       gaugeChart('Sent', '12%', 'sent')
+               ]
+       },
+
+       'disk.util': {
+               colors: '#FF5588',
+               heads: [
+                       gaugeChart('Utilization', '12%', '', '#FF5588')
+               ]
+       },
+
+       'disk.backlog': {
+               colors: '#CCCC00'
+       },
+
+       'disk.io': {
+               heads: [
+                       gaugeChart('Read', '12%', 'reads'),
+                       gaugeChart('Write', '12%', 'writes')
+               ]
+       },
+
+       'netfilter.sockets': {
+               colors: '#88AA00',
+               heads: [
+                       gaugeChart('Active Connections', '12%', '', '#88AA00')
+               ]
+       },
+
+       'netfilter.new': {
+               heads: [
+                       gaugeChart('New Connections', '12%', '', '#5555AA')
+               ]
+       },
+
+       'disk.iotime': {
+               height: 0.5
+       },
+       'disk.mops': {
+               height: 0.5
+       },
+       'disk.svctm': {
+               height: 0.5
+       },
+       'disk.avgsz': {
+               height: 0.5
+       },
+       'disk.await': {
+               height: 0.5
+       },
+
+       'apache.connections': {
+               colors: NETDATA.colors[4],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[4])
+               ]
+       },
+
+       'apache.requests': {
+               colors: NETDATA.colors[0],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[0])
+               ]
+       },
+
+       'apache.net': {
+               colors: NETDATA.colors[3],
+               mainheads: [
+                       gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
+               ]
+       },
+
+       'apache.workers': {
+               mainheads: [
+                       function(id) {
+                               return  '<div data-netdata="' + id + '"'
+                                       + ' data-dimensions="busy"'
+                                       + ' data-append-options="percentage"'
+                                       + ' data-gauge-max-value="100"'
+                                       + ' data-chart-library="gauge"'
+                                       + ' data-title="Workers Utilization"'
+                                       + ' data-units="percentage %"'
+                                       + ' data-gauge-adjust="width"'
+                                       + ' data-width="12%"'
+                                       + ' data-before="0"'
+                                       + ' data-after="-CHART_DURATION"'
+                                       + ' data-points="CHART_DURATION"'
+                                       + ' role="application"></div>';
                        }
-                       options.families_idx[c.family].charts.push(c);
-               }
-       });
+               ]
+       },
+
+       'apache.bytesperreq': {
+               colors: NETDATA.colors[3],
+               height: 0.5
+       },
+
+       'apache.reqpersec': {
+               colors: NETDATA.colors[4],
+               height: 0.5
+       },
+
+       'apache.bytespersec': {
+               colors: NETDATA.colors[6],
+               height: 0.5
+       },
+
+       'nginx.connections': {
+               colors: NETDATA.colors[4],
+               mainheads: [
+                       gaugeChart('Connections', '12%', '', NETDATA.colors[4])
+               ]
+       },
+
+       'nginx.requests': {
+               colors: NETDATA.colors[0],
+               mainheads: [
+                       gaugeChart('Requests', '12%', '', NETDATA.colors[0])
+               ]
+       }
+};
 
-       function prioritySort(a, b) {
-               if(a.priority < b.priority) return -1;
-               if(a.priority > b.priority) return 1;
-               if(a.name < b.name) return -1;
-               return 1;
+function anyAttribute(obj, attr, key, def) {
+       if(typeof obj[key] !== 'undefined') {
+               if(typeof obj[key][attr] !== 'undefined')
+                       return obj[key][attr];
+       }
+       return def;
+}
+
+function menuTitle(menu) {
+       return anyAttribute(menuData, 'title', menu, menu);
+}
+
+function menuInfo(menu) {
+       return anyAttribute(menuData, 'title', menu, null);
+}
+
+function menuHeight(menu, relative) {
+       return anyAttribute(menuData, 'height', menu, 1.0) * relative;
+}
+
+function submenuTitle(menu, submenu) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'title', key, submenu);
+}
+
+function submenuInfo(menu, submenu) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'info', key, null);
+}
+
+function submenuHeight(menu, submenu, relative) {
+       var key = menu + '.' + submenu;
+       return anyAttribute(submenuData, 'height', key, 1.0) * relative;
+}
+
+
+function chartInfo(id) {
+       if(typeof chartData[id] !== 'undefined' && typeof chartData[id].info !== 'undefined')
+               return '<div class="chart-message netdata-chart-alignment" role="document">' + chartData[id].info + '</div>';
+       else
+               return '';
+}
+
+function chartHeight(id, def) {
+       if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
+               return def * chartData[id].height;
+       else
+               return def;
+}
+
+
+// ----------------------------------------------------------------------------
+
+// enrich the data structure returned by netdata
+// to reflect our menu system and content
+function enrichChartData(chart) {
+       // net_* and disk_* have special grouping
+       if(chart.type.match(/^net_/))
+               chart.menu = 'net';
+       else if(chart.type.match(/^disk_/))
+               chart.menu = 'disk';
+       else
+               chart.menu = chart.type;
+
+       // increase the priority of IFB devices
+       if(chart.type === 'tc' && chart.id.match(/.*-ifb$/))
+               chart.priority--;
+
+       chart.submenu = chart.family;
+}
+
+// ----------------------------------------------------------------------------
+
+function name2id(s) {
+       return s
+               .replace(' ', '_')
+               .replace('(', '_')
+               .replace(')', '_')
+               .replace('.', '_')
+               .replace('/', '_');
+}
+
+function headMain(charts, duration) {
+       var head = '';
+
+       if(typeof charts['system.swap'] !== 'undefined')
+               head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
+               + ' data-dimensions="free"'
+               + ' data-append-options="percentage"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Free Swap"'
+               + ' data-units="%"'
+               + ' data-easypiechart-max-value="100"'
+               + ' data-width="8%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="#DD4400"'
+               + ' role="application"></div>';
+
+       if(typeof charts['system.io'] !== 'undefined') {
+               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
+               + ' data-dimensions="in"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Disk Read"'
+               + ' data-units="KB / s"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+
+               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
+               + ' data-dimensions="out"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Disk Write"'
+               + ' data-units="KB / s"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
        }
 
-       // sort all of them
-       options.categories.sort(prioritySort);
-       options.families.sort(prioritySort);
-       $.each(options.families,   function(i, c) { c.charts.sort(prioritySort); });
+       if(typeof charts['system.cpu'] !== 'undefined')
+               head += '<div data-netdata="system.cpu"'
+               + ' data-chart-library="gauge"'
+               + ' data-title="CPU"'
+               + ' data-units="%"'
+               + ' data-gauge-max-value="100"'
+               + ' data-width="18%"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="' + NETDATA.colors[12] + '"'
+               + ' role="application"></div>';
+
+       if(typeof charts['system.ipv4'] !== 'undefined') {
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
+               + ' data-dimensions="received"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv4 Inbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+
+               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
+               + ' data-dimensions="sent"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="IPv4 Outbound"'
+               + ' data-units="kbps"'
+               + ' data-width="10%"'
+               + ' data-before="0"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' role="application"></div>';
+       }
 
+       if(typeof charts['system.ram'] !== 'undefined')
+               head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
+               + ' data-dimensions="cached|free"'
+               + ' data-append-options="percentage"'
+               + ' data-chart-library="easypiechart"'
+               + ' data-title="Available RAM"'
+               + ' data-units="%"'
+               + ' data-easypiechart-max-value="100"'
+               + ' data-width="8%"'
+               + ' data-after="-' + duration.toString() + '"'
+               + ' data-points="' + duration.toString() + '"'
+               + ' data-colors="' + NETDATA.colors[7] + '"'
+               + ' role="application"></div>';
+
+       return head;
+}
+
+function generateHeadCharts(type, chart, duration) {
+       var head = '';
+       var hcharts = anyAttribute(chartData, type, chart.context, []);
+       if(hcharts.length > 0) {
+               var hi = 0, hlen = hcharts.length;
+               while(hi < hlen) {
+                       if(typeof hcharts[hi] === 'function')
+                               head += hcharts[hi](chart.id).replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
+                       else
+                               head += hcharts[hi].replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
+                       hi++;
+               }
+       }
+       return head;
+}
+
+function renderPage(menus, data) {
        var div = document.getElementById('charts_div');
        var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
 
@@ -1019,661 +1295,155 @@ function prepareScreen(data) {
        var duration = Math.round(($(div).width() * pcent_width / 100 * data.update_every / 3) / 60) * 60;
        var html = '';
        var sidebar = '<ul class="nav dashboard-sidenav" data-spy="affix" id="sidebar_ul">';
+       var mainhead = headMain(data.charts, duration);
 
-       function getMessage(id) {
-               if(typeof messages[id] !== 'undefined')
-                       return '<div class="chart-message" role="document">' + messages[id] + '</div>';
-               else
-                       return '';
-       }
+       // sort the menus
+       var main = sortObjectByPriority(menus);
+       var i = 0, len = main.length;
+       while(i < len) {
+               var menu = main[i++];
 
-       // render the charts
-       $.each(options.categories, function(i, t) {
-               t.charts.sort(prioritySort);
-
-               sidebar += '<li class="' + ((i === 0)?'active':'').toString() + '"><a href="#' + name2id(t.name) + '">' + t.title + '</a>';
-               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">';
-
-               if(t.name === 'cpu') {
-                       var families = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(families, function(j, c) {
-                               sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + c.name + '</a></li>';
-                               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>';
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight;
-
-                                       html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-                               html += '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'net' || t.name === 'tc' || t.name === 'ap') {
-                       var interfaces = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(interfaces, function(j, c) {
-                               var menuitem = c.name;
-                               var name = options.interfaces_registry[menuitem];
-                               if(typeof name !== 'undefined' && name !== menuitem)
-                                       menuitem = menuitem + ' (' + name + ')';
-
-                               sidebar += '<li class><a href="#' + name2id(t.name) + '_' + name2id(c.name) + '">' + menuitem + '</a></li>';
-                               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>';
-
-                               var head = '<div style="width: 100%; text-align: center;">';
-                               var all = '';
-
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight / 2;
-                                       switch(f.type) {
-                                               case 'net':
-                                                       h = options.chartsHeight;
-
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="received"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-title="Receive"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' role="application"></div>';
+               // generate an entry at the main menu
 
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="sent"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-title="Sent"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-
-                                               case 'tc':
-                                                       h = options.chartsHeight;
-                                                       if(f.id.match(/.*-ifb$/) !== null)
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Receive"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                               + ' role="application"></div>';
-
-                                                       else
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Sent"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + NETDATA.colors[3] + '"'
-                                                               + ' role="application"></div>';
-                                                       break;
-                                               case 'ap_bandwidth': h = options.chartsHeight; break;
-                                               case 'ap_bitrate'  : h = options.chartsHeight; break;
-                                       }
-
-                                       all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-
-                               head += '</div>';
-                               html += head + all + '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'disk') {
-                       var disks = uniq_with_list(t.charts, function(c) { return c.family; });
-
-                       sidebar += '<ul class="nav">';
-                       $.each(disks, function(j, c) {
-                               sidebar += '<li class><a href="#' + name2id(c.name) + '">' + c.name + '</a></li>';
-                               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>';
-                               var head = '<div style="width: 100%; text-align: center;">';
-                               var all = '';
-                               $.each(c.values, function(x, f) {
-                                       var c = null;
-                                       var h = options.chartsHeight / 2;
-                                       switch(f.type) {
-                                               case 'disk'        : h = options.chartsHeight;
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-dimensions="reads"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Read"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' role="application"></div>';
-
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-dimensions="writes"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-title="Write"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' role="application"></div>';
-                                                               break;
-                                               case 'disk_backlog': c = '#CCCC00'; break;
-                                               case 'disk_util'   : c = '#FF5588';
-                                                               head += '<div data-netdata="' + f.id + '"'
-                                                               + ' data-chart-library="gauge"'
-                                                               + ' data-title="Utilization"'
-                                                               + ' data-gauge-max-value="100"'
-                                                               + ' data-gauge-adjust="width"'
-                                                               + ' data-width="12%"'
-                                                               + ' data-before="0"'
-                                                               + ' data-after="-' + duration.toString() + '"'
-                                                               + ' data-points="' + duration.toString() + '"'
-                                                               + ' data-colors="' + c + '"'
-                                                               + ' role="application"></div>';
-                                                               break;
-                                               case 'disk_qops'   : c = '#5555FF'; break;
-                                       }
-
-                                       all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                               + ' data-width="100%"'
-                                               + ' data-height="' + h.toString() + 'px"'
-                                               + ' data-before="0"'
-                                               + ' data-after="-' + duration.toString() + '"'
-                                               + ' data-colors="' + c + '"'
-                                               + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                               + ' role="application"></div>';
-                               });
-                               head += '</div>';
-                               html += head + all + '</div>'; // netdata-group-container
-                       });
-                       sidebar += '</ul>';
-               }
-               else if(t.name === 'apps') {
-                       $.each(t.charts, function(x, f) {
-                               var c = null;
-                               var h = Math.round(options.chartsHeight * 1.5);
-                               switch(f.id) {
-                                       case 'apps.cpu'         : h = Math.round(options.chartsHeight * 2); break;
-                                       case 'apps.preads'      : h = Math.round(options.chartsHeight * 2); break;
-                                       case 'apps.pwrites'     : h = Math.round(options.chartsHeight * 2); break;
-                                       case 'apps.mem'         : h = Math.round(options.chartsHeight * 2); break;
-                                       case 'apps.major_faults': h = Math.round(options.chartsHeight * 2); break;
-                               }
-
-                               html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="100%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-               }
-               else if(t.name === 'system') {
-                       var head = '<div style="text-align: center; vertical-align: bottom; width: 100%;">';
-
-                       if(typeof charts['system.swap'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
-                               + ' data-dimensions="free"'
-                               + ' data-append-options="percentage"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Free Swap"'
-                               + ' data-units="%"'
-                               + ' data-easypiechart-max-value="100"'
-                               + ' data-width="8%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[1] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.io'] !== 'undefined') {
-                               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
-                               + ' data-dimensions="in"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Disk Read"'
-                               + ' data-units="KB / s"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.io"'
-                               + ' data-dimensions="out"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Disk Write"'
-                               + ' data-units="KB / s"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-                       }
+               sidebar += '<li class=""><a href="#' + menu + '">' + menus[menu].title + '</a><ul class="nav">';
+               html += '<div role="section"><div role="sectionhead"><h1 id="' + menu + '" role="heading">' + menus[menu].title + '</h1></div><div id="' + menu + '" role="document">';
 
-                       if(typeof charts['system.cpu'] !== 'undefined')
-                               head += '<div data-netdata="system.cpu"'
-                               + ' data-chart-library="gauge"'
-                               + ' data-title="CPU"'
-                               + ' data-units="%"'
-                               + ' data-gauge-max-value="100"'
-                               + ' data-width="18%"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[12] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.ipv4'] !== 'undefined') {
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
-                               + ' data-dimensions="received"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="IPv4 Inbound"'
-                               + ' data-units="kbps"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
-                               + ' data-dimensions="sent"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="IPv4 Outbound"'
-                               + ' data-units="kbps"'
-                               + ' data-width="10%"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' role="application"></div>';
-                       }
+               if(menus[menu].info !== null)
+                       html += menus[menu].info;
 
-                       if(typeof charts['system.ram'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
-                               + ' data-dimensions="cached|free"'
-                               + ' data-append-options="percentage"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Available RAM"'
-                               + ' data-units="%"'
-                               + ' data-easypiechart-max-value="100"'
-                               + ' data-width="8%"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[7] + '"'
-                               + ' role="application"></div>';
-
-/*                     if(typeof charts['system.swapio'] !== 'undefined') {
-                               head += "<div style=\"display: inline-block\">";
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
-                               + ' data-dimensions="in"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Swap Read"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[2] + '"'
-                               + ' role="application"></div>';
-
-                               head += '<div style="margin-right: 10px;" data-netdata="system.swapio"'
-                               + ' data-dimensions="out"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Swap Write"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[1] + '"'
-                               + ' role="application"></div>';
-
-                               head += "</div>";
-                       }
+               // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
 
-                       if(typeof charts['system.ctxt'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.ctxt"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Switches"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[3] + '"'
-                               + ' role="application"></div>';
-
-                       if(typeof charts['system.intr'] !== 'undefined')
-                               head += '<div style="margin-right: 10px;" data-netdata="system.intr"'
-                               + ' data-chart-library="easypiechart"'
-                               + ' data-title="Interrupts"'
-                               + ' data-width="100px"'
-                               + ' data-before="0"'
-                               + ' data-after="-' + duration.toString() + '"'
-                               + ' data-points="' + duration.toString() + '"'
-                               + ' data-colors="' + NETDATA.colors[7] + '"'
-                               + ' role="application"></div>';
-*/
-                       head += "</div>";
-                       var all = '';
-                       $.each(t.charts, function(x, f) {
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-                       html += head + all;
-               }
-               else if(t.name === 'netdata') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
+               var shtml = '';
+               var mhead = '<div style="width: 100%; text-align: center;">' + mainhead;
+               mainhead = '';
 
-                       $.each(t.charts, function(x, f) {
-                               switch(f.id) {
-                                       case 'netdata.net'   :
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="in"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Received"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
+               // sort the submenus of this menu
+               var sub = sortObjectByPriority(menus[menu].submenus);
+               var si = 0, slen = sub.length;
+               while(si < slen) {
+                       var submenu = sub[si++];
 
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="out"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Sent"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[1] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+                       // generate an entry at the submenu
+                       sidebar += '<li class><a href="#' + name2id(menu + '_' + submenu) + '">' + menus[menu].submenus[submenu].title + '</a></li>';
+                       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>';
 
-                                       case 'netdata.requests'   : c = NETDATA.colors[2];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests / second"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-
-                                       case 'netdata.clients'   : c = NETDATA.colors[3];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+                       if(menus[menu].submenus[submenu].info !== null)
+                               shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
-               }
-               else if(t.name === 'netfilter') {
                        var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
+                       var chtml = '';
 
-                       $.each(t.charts, function(x, f) {
-                               switch(f.id) {
-                                       case 'netfilter.sockets'   :
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Active Connections"'
-                                                       + ' data-units="connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+                       // console.log('    \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
 
-                                       case 'netfilter.new':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="new"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="New Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+                       // sort the charts in this submenu of this menu
+                       menus[menu].submenus[submenu].charts.sort(prioritySort);
+                       var ci = 0, clen = menus[menu].submenus[submenu].charts.length;
+                       while(ci < clen) {
+                               var chart = menus[menu].submenus[submenu].charts[ci++];
+
+                               // generate the submenu heading charts
+                               mhead += generateHeadCharts('mainheads', chart, duration);
+                               head += generateHeadCharts('heads', chart, duration);
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
+                               // generate the chart
+                               chtml += chartInfo(chart.context) + '<div data-netdata="' + chart.id + '"'
                                        + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
+                                       + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
                                        + ' data-before="0"'
                                        + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
+                                       + ' data-id="' + name2id(options.hostname + '/' + chart.id) + '"'
+                                       + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
                                        + ' role="application"></div>';
-                       });
+
+                               // console.log('         \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context  + ' height: ' + menus[menu].submenus[submenu].height);
+                       }
+
                        head += '</div>';
-                       html += head + all;
+                       shtml += head + chtml + '</div>';
                }
-               else if(t.name === 'apache') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
-
-                       $.each(t.charts, function(x, f) {
-                               var c = 'null';
-                               var h = options.chartsHeight;
-                               switch(f.id) {
-                                       case 'apache.connections':
-                                                       c = NETDATA.colors[4];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
 
-                                       case 'apache.requests':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+               mhead += '</div>';
+               sidebar += '</ul></li>';
+               html += mhead + shtml + '</div></div><hr role="separator"/>';
+       }
 
-                                       case 'apache.net':
-                                                       c = NETDATA.colors[1];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Bandwidth"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+       sidebar += '</ul>';
+       div.innerHTML = html;
+       document.getElementById('sidebar').innerHTML = sidebar;
+       finalizePage();
+}
 
-                                       case 'apache.workers':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-dimensions="busy"'
-                                                       + ' data-append-options="percentage"'
-                                                       + ' data-gauge-max-value="100"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Workers Utilization"'
-                                                       + ' data-units="percentage %"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[2] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+function renderChartsAndMenu(data) {
+       var menus = {};
+       var charts = data.charts;
 
-                                       case 'apache.bytesperreq':
-                                                       c = NETDATA.colors[3];
-                                                       h = Math.round(h / 2);
-                                                       break;
+       for(var c in charts) {
+               enrichChartData(charts[c]);
+
+               // create the menu
+               if(typeof menus[charts[c].menu] === 'undefined') {
+                       menus[charts[c].menu] = {
+                               priority: charts[c].priority,
+                               submenus: {},
+                               title: menuTitle(charts[c].menu),
+                               info: menuInfo(charts[c].menu),
+                               height: menuHeight(charts[c].menu, options.chartsHeight)
+                       };
+               }
+               
+               if(charts[c].priority < menus[charts[c].menu].priority)
+                       menus[charts[c].menu].priority = charts[c].priority;
+
+               // create the submenu
+               if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
+                       menus[charts[c].menu].submenus[charts[c].submenu] = {
+                               priority: charts[c].priority,
+                               charts: new Array(),
+                               title: submenuTitle(charts[c].menu, charts[c].submenu),
+                               info: submenuInfo(charts[c].menu, charts[c].submenu),
+                               height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
+                       };
+               }
+               
+               if(charts[c].priority < menus[charts[c].menu].submenus[charts[c].submenu].priority)
+                       menus[charts[c].menu].submenus[charts[c].submenu].priority = charts[c].priority;
 
-                                       default:
-                                                       h = Math.round(h / 2);
-                                                       break;
-                               }
+               // index the chart in the menu/submenu
+               menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
+       }
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
-               }
-               else if(t.name === 'nginx') {
-                       var head = '<div style="width: 100%; text-align: center;">';
-                       var all = '';
-                       $.each(t.charts, function(x, f) {
-                               var c = 'null';
-                               var h = options.chartsHeight;
-
-                               switch(f.id) {
-                                       case 'nginx.connections':
-                                                       c = NETDATA.colors[4];
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Connections"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + c + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
+       renderPage(menus, data);
+}
 
-                                       case 'nginx.requests':
-                                                       head += '<div data-netdata="' + f.id + '"'
-                                                       + ' data-chart-library="gauge"'
-                                                       + ' data-title="Requests"'
-                                                       + ' data-gauge-adjust="width"'
-                                                       + ' data-width="12%"'
-                                                       + ' data-before="0"'
-                                                       + ' data-after="-' + duration.toString() + '"'
-                                                       + ' data-points="' + duration.toString() + '"'
-                                                       + ' data-colors="' + NETDATA.colors[0] + '"'
-                                                       + ' role="application"></div>';
-                                                       break;
-                               }
+function downloadAllCharts(netdata_url) {
+       if(typeof netdata_url === 'undefined' || netdata_url === null)
+               netdata_url = NETDATA.serverDefault;
 
-                               all += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + h.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' data-colors="' + c + '"'
-                                       + ' role="application"></div>';
-                       });
-                       head += '</div>';
-                       html += head + all;
-               }
-               else {
-                       $.each(t.charts, function(x, f) {
-                               html += getMessage(f.id) + '<div data-netdata="' + f.id + '"'
-                                       + ' data-width="' + pcent_width.toString() + '%"'
-                                       + ' data-height="' + options.chartsHeight.toString() + 'px"'
-                                       + ' data-before="0"'
-                                       + ' data-after="-' + duration.toString() + '"'
-                                       + ' data-id="' + name2id(options.hostname + '/' + f.id) + '"'
-                                       + ' role="application"></div>';
-                       });
-               }
+       NETDATA.pause(function() {
 
-               sidebar += '</li>';
-               html += '</div>'; // document
-               html += '</div>'; // section
-               html += '<hr role="separator"/>';
-       });
-       sidebar += '</ul>';
-/*
-       // show the colors
-       html += '<br/><div class="row">'
-       $.each(NETDATA.colors, function(i, c){
-               html += '<div style="display: inline-block;"><div style="display: inline-block; width: 100px; height: 100px; background: ' + c + ';"></div><br/>' + c + '</div>';
+               // download all the charts the server knows
+               NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
+
+                       options.data = data;
+                       options.hostname = data.hostname;
+                       document.getElementById('hostname').innerHTML = options.hostname;
+                       document.getElementById('hostname').href = NETDATA.serverDefault;
+                       document.title = options.hostname + ' dashboard';
+                       
+                       renderChartsAndMenu(data);
+
+                       // prepare our DOM
+//                     prepareScreen(data);
+
+                       // due to affix issues, prepareScreen() will unpause
+                       // netdata as needed
+               });
        });
-       html += '</div>'
-*/
-       div.innerHTML = html;
-       document.getElementById('sidebar').innerHTML = sidebar;
-       
+}
+
+// ----------------------------------------------------------------------------
+
+function finalizePage() {
        // resize all charts - without starting the background thread
        // this has to be done while NETDATA is paused
        // if we ommit this, the affix menu will be wrong, since all
@@ -1765,25 +1535,6 @@ function prepareScreen(data) {
                }, 1000);
 }
 
-NETDATA.pause(function() {
-
-//     $('#welcomeModal').on('hidden.bs.modal', function (e) {
-//             NETDATA.updatedDom();
-//     });
-//     $('#welcomeModal').on('shown.bs.modal', function (e) {
-//             NETDATA.updatedDom();
-//     });
-
-       // download all the charts the server knows
-       NETDATA.chartRegistry.downloadAll(NETDATA.serverDefault, function(data) {
-
-               // prepare our DOM
-               // this will be called when NETDATA is paused
-               prepareScreen(data);
-
-               // due to affix issues, prepareScreen() will unpause
-               // netdata as needed
-       });
-});
+downloadAllCharts();
 
 </script>