summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcharts.d/ap.chart.sh13
-rwxr-xr-xcharts.d/apache.chart.sh18
-rwxr-xr-xcharts.d/cpu_apps.chart.sh4
-rwxr-xr-xcharts.d/cpufreq.chart.sh5
-rwxr-xr-xcharts.d/example.chart.sh6
-rwxr-xr-xcharts.d/load_average.chart.sh14
-rwxr-xr-xcharts.d/mem_apps.chart.sh4
-rwxr-xr-xcharts.d/mysql.chart.sh45
-rwxr-xr-xcharts.d/nginx.chart.sh9
-rwxr-xr-xcharts.d/nut.chart.sh19
-rwxr-xr-xcharts.d/opensips.chart.sh39
-rwxr-xr-xcharts.d/postfix.chart.sh6
-rwxr-xr-xcharts.d/sensors.chart.sh16
-rwxr-xr-xcharts.d/squid.chart.sh9
-rwxr-xr-xnode.d/named.node.js70
-rwxr-xr-xnode.d/node_modules/netdata.js33
-rwxr-xr-xnode.d/sma_webbox.node.js20
-rwxr-xr-xnode.d/snmp.node.js8
-rwxr-xr-xplugins.d/charts.d.plugin2
-rwxr-xr-xsrc/apps_plugin.c34
-rwxr-xr-xsrc/main.c4
-rwxr-xr-xsrc/plugin_checks.c6
-rwxr-xr-xsrc/plugin_idlejitter.c2
-rwxr-xr-xsrc/plugin_proc.c10
-rwxr-xr-xsrc/plugin_tc.c6
-rwxr-xr-xsrc/plugins_d.c14
-rwxr-xr-xsrc/proc_diskstats.c20
-rwxr-xr-xsrc/proc_interrupts.c7
-rwxr-xr-xsrc/proc_meminfo.c20
-rwxr-xr-xsrc/proc_net_dev.c14
-rwxr-xr-xsrc/proc_net_ip_vs_stats.c6
-rwxr-xr-xsrc/proc_net_netstat.c12
-rw-r--r--src/proc_net_rpc_nfsd.c26
-rwxr-xr-xsrc/proc_net_snmp.c20
-rwxr-xr-xsrc/proc_net_stat_conntrack.c12
-rwxr-xr-xsrc/proc_softirqs.c7
-rwxr-xr-xsrc/proc_stat.c16
-rwxr-xr-xsrc/proc_sys_kernel_random_entropy_avail.c2
-rwxr-xr-xsrc/proc_vmstat.c8
-rwxr-xr-xsrc/rrd.c21
-rwxr-xr-xsrc/rrd.h18
-rwxr-xr-xsrc/rrd2json.c4
-rwxr-xr-xsrc/sys_kernel_mm_ksm.c6
-rwxr-xr-xsrc/unit_test.c4
-rwxr-xr-xweb/dashboard.js2
-rwxr-xr-xweb/index.html1553
46 files changed, 1004 insertions, 1190 deletions
diff --git a/charts.d/ap.chart.sh b/charts.d/ap.chart.sh
index 0a9a884a90..4704b89de3 100755
--- a/charts.d/ap.chart.sh
+++ b/charts.d/ap.chart.sh
@@ -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
diff --git a/charts.d/apache.chart.sh b/charts.d/apache.chart.sh
index 20c59afabb..efa559ddbc 100755
--- a/charts.d/apache.chart.sh
+++ b/charts.d/apache.chart.sh
@@ -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
diff --git a/charts.d/cpu_apps.chart.sh b/charts.d/cpu_apps.chart.sh
index 879cbbddd3..5a25163e13 100755
--- a/charts.d/cpu_apps.chart.sh
+++ b/charts.d/cpu_apps.chart.sh
@@ -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" |\
(
diff --git a/charts.d/cpufreq.chart.sh b/charts.d/cpufreq.chart.sh
index 1fce11e3f9..6a968237de 100755
--- a/charts.d/cpufreq.chart.sh
+++ b/charts.d/cpufreq.chart.sh
@@ -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 )
diff --git a/charts.d/example.chart.sh b/charts.d/example.chart.sh
index 7e07ccf47f..641d03e5de 100755
--- a/charts.d/example.chart.sh
+++ b/charts.d/example.chart.sh
@@ -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
diff --git a/charts.d/load_average.chart.sh b/charts.d/load_average.chart.sh
index 6e5d5e0572..8cc5af6ec6 100755
--- a/charts.d/load_average.chart.sh
+++ b/charts.d/load_average.chart.sh
@@ -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
diff --git a/charts.d/mem_apps.chart.sh b/charts.d/mem_apps.chart.sh
index d3a786e935..f537ada488 100755
--- a/charts.d/mem_apps.chart.sh
+++ b/charts.d/mem_apps.chart.sh
@@ -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";
diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh
index 8d0ac228fc..2839052898 100755
--- a/charts.d/mysql.chart.sh
+++ b/charts.d/mysql.chart.sh
@@ -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
diff --git a/charts.d/nginx.chart.sh b/charts.d/nginx.chart.sh
index d180aab5e1..bc8293c5df 100755
--- a/charts.d/nginx.chart.sh
+++ b/charts.d/nginx.chart.sh
@@ -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
diff --git a/charts.d/nut.chart.sh b/charts.d/nut.chart.sh
index 1a60524115..343c6d9cd1 100755
--- a/charts.d/nut.chart.sh
+++ b/charts.d/nut.chart.sh
@@ -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
diff --git a/charts.d/opensips.chart.sh b/charts.d/opensips.chart.sh
index 2e4e59b3a9..4b60c811df 100755
--- a/charts.d/opensips.chart.sh
+++ b/charts.d/opensips.chart.sh
@@ -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 $open