]> arthur.barton.de Git - netdata.git/commitdiff
Merge pull request #1284 from ktsaou/master
authorCosta Tsaousis <costa@tsaousis.gr>
Sun, 27 Nov 2016 00:31:07 +0000 (02:31 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Nov 2016 00:31:07 +0000 (02:31 +0200)
file permissions + optimizations

32 files changed:
charts.d/cpufreq.chart.sh
conf.d/Makefile.am
conf.d/charts.d/ap.conf [new file with mode: 0644]
conf.d/charts.d/apache.conf [new file with mode: 0644]
conf.d/charts.d/apcupsd.conf [new file with mode: 0644]
conf.d/charts.d/cpu_apps.conf [new file with mode: 0644]
conf.d/charts.d/cpufreq.conf [new file with mode: 0644]
conf.d/charts.d/example.conf [new file with mode: 0644]
conf.d/charts.d/exim.conf [new file with mode: 0644]
conf.d/charts.d/hddtemp.conf [new file with mode: 0644]
conf.d/charts.d/load_average.conf [new file with mode: 0644]
conf.d/charts.d/mem_apps.conf [new file with mode: 0644]
conf.d/charts.d/mysql.conf [new file with mode: 0644]
conf.d/charts.d/nginx.conf [new file with mode: 0644]
conf.d/charts.d/nut.conf [new file with mode: 0644]
conf.d/charts.d/opensips.conf [new file with mode: 0644]
conf.d/charts.d/phpfpm.conf [new file with mode: 0644]
conf.d/charts.d/postfix.conf [new file with mode: 0644]
conf.d/charts.d/sensors.conf [new file with mode: 0644]
conf.d/charts.d/squid.conf [new file with mode: 0644]
conf.d/charts.d/tomcat.conf [new file with mode: 0644]
conf.d/python.d/mysql.conf
configs.signatures
netdata-installer.sh
node.d/node_modules/netdata.js
src/daemon.c
src/rrd2json.c
src/web_server.c
web/dashboard.js
web/index.html
web/old/index.js
web/old/netdata.js

index b358ac3e74827455d95ef5753bd1b0735c27e9fa..b21504a0e16b59c45a02d76fb2a5f3d8b6f4377b 100755 (executable)
@@ -9,7 +9,7 @@
 # if this chart is called X.chart.sh, then all functions and global variables
 # must start with X_
 
-cpufreq_sys_dir="/sys/devices"
+cpufreq_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices"
 cpufreq_sys_depth=10
 cpufreq_source_update=1
 
index 2acaf801daa7adfec368a51fdc26d902ca561542..d10c693e6bff35dc83f75af1487e838faf910a16 100644 (file)
@@ -73,3 +73,26 @@ dist_healthconfig_DATA = \
     health.d/swap.conf \
     health.d/tcp_resets.conf \
     $(NULL)
+
+chartsconfigdir=$(configdir)/charts.d
+dist_chartsconfig_DATA = \
+    charts.d/apache.conf \
+    charts.d/apcupsd.conf \
+    charts.d/cpufreq.conf \
+    charts.d/exim.conf \
+    charts.d/load_average.conf \
+    charts.d/mysql.conf \
+    charts.d/nut.conf \
+    charts.d/phpfpm.conf \
+    charts.d/sensors.conf \
+    charts.d/tomcat.conf \
+    charts.d/ap.conf \
+    charts.d/cpu_apps.conf \
+    charts.d/example.conf \
+    charts.d/hddtemp.conf \
+    charts.d/mem_apps.conf \
+    charts.d/nginx.conf \
+    charts.d/opensips.conf \
+    charts.d/postfix.conf \
+    charts.d/squid.conf \
+    $(NULL)
diff --git a/conf.d/charts.d/ap.conf b/conf.d/charts.d/ap.conf
new file mode 100644 (file)
index 0000000..88a447e
--- /dev/null
@@ -0,0 +1,19 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# nothing fancy to configure.
+# this module will run
+# iw dev - to find wireless devices in AP mode
+# iw ${dev} station dump - to get connected clients
+# based on the above, it generates several charts
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#ap_update_every=
+
+# the charts priority on the dashboard
+#ap_priority=6900
diff --git a/conf.d/charts.d/apache.conf b/conf.d/charts.d/apache.conf
new file mode 100644 (file)
index 0000000..b82c2a7
--- /dev/null
@@ -0,0 +1,26 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# the URL to download apache status info
+#apache_url="http://127.0.0.1:80/server-status?auto"
+#apache_curl_opts=
+
+# convert apache floating point values
+# to integer using this multiplier
+# this only affects precision - the values
+# will be in the proper units
+#apache_decimal_detail=1000000
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#apache_update_every=
+
+# the charts priority on the dashboard
+#apache_priority=60000
diff --git a/conf.d/charts.d/apcupsd.conf b/conf.d/charts.d/apcupsd.conf
new file mode 100644 (file)
index 0000000..f8bf7ed
--- /dev/null
@@ -0,0 +1,19 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+#apcupsd_ip=127.0.0.1
+#apcupsd_port=3551
+
+# how long to wait for apcupsd to respond
+#apcupsd_timeout=3
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#apcupsd_update_every=10
+
+# the charts priority on the dashboard
+#apcupsd_priority=90000
diff --git a/conf.d/charts.d/cpu_apps.conf b/conf.d/charts.d/cpu_apps.conf
new file mode 100644 (file)
index 0000000..46d7036
--- /dev/null
@@ -0,0 +1,15 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# app.plugin can do better
+
+#cpu_apps_apps=
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#cpu_apps_update_every=2
diff --git a/conf.d/charts.d/cpufreq.conf b/conf.d/charts.d/cpufreq.conf
new file mode 100644 (file)
index 0000000..4f26562
--- /dev/null
@@ -0,0 +1,20 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+#cpufreq_sys_dir="/sys/devices"
+#cpufreq_sys_depth=10
+#cpufreq_source_update=1
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#cpufreq_update_every=
+
+# the charts priority on the dashboard
+#cpufreq_priority=10000
diff --git a/conf.d/charts.d/example.conf b/conf.d/charts.d/example.conf
new file mode 100644 (file)
index 0000000..dc4b690
--- /dev/null
@@ -0,0 +1,17 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# to enable this chart, you have to set this to 12345
+# (just a demonstration for something that needs to be checked)
+#example_magic_number=12345
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#example_update_every=
+
+# the charts priority on the dashboard
+#example_priority=150000
diff --git a/conf.d/charts.d/exim.conf b/conf.d/charts.d/exim.conf
new file mode 100644 (file)
index 0000000..4a1464b
--- /dev/null
@@ -0,0 +1,20 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# the exim command to run
+# if empty, it will use the one found in the system path
+#exim_command=
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#exim_update_every=5
+
+# the charts priority on the dashboard
+#exim_priority=60000
diff --git a/conf.d/charts.d/hddtemp.conf b/conf.d/charts.d/hddtemp.conf
new file mode 100644 (file)
index 0000000..535cb01
--- /dev/null
@@ -0,0 +1,20 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+#hddtemp_host="localhost"
+#hddtemp_port="7634"
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#hddtemp_update_every=3
+
+# the charts priority on the dashboard
+#hddtemp_priority=90000
+
diff --git a/conf.d/charts.d/load_average.conf b/conf.d/charts.d/load_average.conf
new file mode 100644 (file)
index 0000000..abbe80c
--- /dev/null
@@ -0,0 +1,18 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# netdata can collect this metric already
+
+#load_average_enabled=0
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#load_average_update_every=5
+
+# the charts priority on the dashboard
+#load_priority=100
diff --git a/conf.d/charts.d/mem_apps.conf b/conf.d/charts.d/mem_apps.conf
new file mode 100644 (file)
index 0000000..aa4ac68
--- /dev/null
@@ -0,0 +1,15 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# app.plugin can do better
+
+#mem_apps_apps=
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#mem_apps_update_every=2
diff --git a/conf.d/charts.d/mysql.conf b/conf.d/charts.d/mysql.conf
new file mode 100644 (file)
index 0000000..6a0b55a
--- /dev/null
@@ -0,0 +1,19 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+#mysql_cmds[name]=""
+#mysql_opts[name]=""
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#mysql_update_every=2
+
+# the charts priority on the dashboard
+#mysql_priority=60000
diff --git a/conf.d/charts.d/nginx.conf b/conf.d/charts.d/nginx.conf
new file mode 100644 (file)
index 0000000..8b88b0e
--- /dev/null
@@ -0,0 +1,19 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+#nginx_url="http://127.0.0.1:80/stub_status"
+#nginx_curl_opts=""
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#nginx_update_every=
+
+# the charts priority on the dashboard
+#nginx_priority=60000
diff --git a/conf.d/charts.d/nut.conf b/conf.d/charts.d/nut.conf
new file mode 100644 (file)
index 0000000..2844849
--- /dev/null
@@ -0,0 +1,20 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# a space separated list of UPS names
+# if empty, the list returned by 'upsc -l' will be used
+#nut_ups=
+
+# how much time in seconds, to wait for nut to respond
+#nut_timeout=2
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#nut_update_every=2
+
+# the charts priority on the dashboard
+#nut_priority=90000
diff --git a/conf.d/charts.d/opensips.conf b/conf.d/charts.d/opensips.conf
new file mode 100644 (file)
index 0000000..abc4c70
--- /dev/null
@@ -0,0 +1,17 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+#opensips_opts="fifo get_statistics all"
+#opensips_cmd=
+#opensips_timeout=2
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#opensips_update_every=5
+
+# the charts priority on the dashboard
+#opensips_priority=80000
diff --git a/conf.d/charts.d/phpfpm.conf b/conf.d/charts.d/phpfpm.conf
new file mode 100644 (file)
index 0000000..1e85763
--- /dev/null
@@ -0,0 +1,22 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# first, you need open php-fpm status in php-fpm.conf
+# second, you need add status location in nginx.conf
+# you can see, https://easyengine.io/tutorials/php/fpm-status-page/
+#phpfpm_urls[name]=""
+#phpfpm_curl_opts[name]=""
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#phpfpm_update_every=
+
+# the charts priority on the dashboard
+#phpfpm_priority=60000
diff --git a/conf.d/charts.d/postfix.conf b/conf.d/charts.d/postfix.conf
new file mode 100644 (file)
index 0000000..7d33d26
--- /dev/null
@@ -0,0 +1,20 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# the postqueue command
+# if empty, it will use the one found in the system path
+#postfix_postqueue=
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#postfix_update_every=15
+
+# the charts priority on the dashboard
+#postfix_priority=60000
diff --git a/conf.d/charts.d/sensors.conf b/conf.d/charts.d/sensors.conf
new file mode 100644 (file)
index 0000000..d42d17d
--- /dev/null
@@ -0,0 +1,27 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# the directory the kernel keeps sensor data
+#sensors_sys_dir="/sys/devices"
+
+# how deep in the tree to check for sensor data
+#sensors_sys_depth=10
+
+# if set to 1, the script will overwrite internal
+# script functions with code generated ones
+# leave to 1, is faster
+#sensors_source_update=1
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#sensors_update_every=
+
+# the charts priority on the dashboard
+#sensors_priority=90000
diff --git a/conf.d/charts.d/squid.conf b/conf.d/charts.d/squid.conf
new file mode 100644 (file)
index 0000000..cf92c12
--- /dev/null
@@ -0,0 +1,21 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+#squid_host=
+#squid_port=
+#squid_url=
+#squid_timeout=2
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#squid_update_every=2
+
+# the charts priority on the dashboard
+#squid_priority=60000
diff --git a/conf.d/charts.d/tomcat.conf b/conf.d/charts.d/tomcat.conf
new file mode 100644 (file)
index 0000000..7106694
--- /dev/null
@@ -0,0 +1,34 @@
+# no need for shebang - this file is loaded from charts.d.plugin
+
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+
+# THIS PLUGIN IS DEPRECATED
+# USE THE PYTHON.D ONE
+
+# the URL to download tomcat status info
+# usually http://localhost:8080/manager/status?XML=true
+#tomcat_url=""
+#tomcat_curl_opts=""
+
+# set tomcat username/password here
+#tomcat_user=""
+#tomcat_password=""
+
+# the data collection frequency
+# if unset, will inherit the netdata update frequency
+#tomcat_update_every=1
+
+# the charts priority on the dashboard
+#tomcat_priority=60000
+
+# convert tomcat floating point values
+# to integer using this multiplier
+# this only affects precision - the values
+# will be in the proper units
+#tomcat_decimal_detail=1000000
+
+# used by volume chart to convert bytes to KB
+#tomcat_decimal_KB_detail=1000
index 8fbbe6513ef3870a27fc6ee5a644d27787c5a43f..d7e760f9bfaccac54fad8ed5cdf6326a09bcd0d0 100644 (file)
 #     pass: 'password'       # the mysql password to use
 #
 
+# ----------------------------------------------------------------------
+# mySQL CONFIGURATION
+#
+# netdata does not need any privilege - only the ability to connect
+# to the mysql server (netdata will not be able to see any data).
+#
+# Execute these commands to give the local user 'netdata' the ability
+# to connect to the mysql server on localhost, without a password:
+#
+# > create user 'netdata'@'localhost';
+# > grant usage on *.* to 'netdata'@'localhost' with grant option;
+# > flush privileges;
+#
+# with the above statements, netdata will be able to gather mysql
+# statistics, without the ability to see or alter any data or affect
+# mysql operation in any way. No change is required below.
+
 # ----------------------------------------------------------------------
 # AUTO-DETECTION JOBS
 # only one of them will run (they have the same name)
@@ -80,6 +97,10 @@ mycnf2:
   name     : 'local'
   'my.cnf' : '/etc/mysql/my.cnf'
 
+debiancnf:
+  name     : 'local'
+  'my.cnf' : '/etc/mysql/debian.cnf'
+
 socket1:
   name     : 'local'
   # user     : ''
index 896ea5bcc157b7f80cb73812d60b3cc608d371bd..cec5699559c73d4fa5f57297be4261a89cdafe53 100644 (file)
@@ -18,8 +18,11 @@ declare -A configs_signatures=(
   ['0c5e0fa364d7bdf7c16e8459a0544572']='health.d/netfilter.conf'
   ['0cd4e1fb57497e4d4c2451a9e58f724d']='python.d/redis.conf'
   ['0e59bc11d0a869ea0247c04c08c8d72e']='python.d/ipfs.conf'
+  ['0ef8af1f358741afa7fd5d0ffabefaac']='charts.d/mysql.conf'
+  ['10c3b525850a1cb9de760a8ee96fbc6e']='charts.d/opensips.conf'
   ['13141998a5d71308d9c119834c27bfd3']='python.d.conf'
   ['142a5b693d34b0308bb0b8aec71fad79']='python.d/postfix.conf'
+  ['14783e051650442ec9e2ed38d81d667e']='charts.d/exim.conf'
   ['15d8401b56a74120f9f832873ec9c578']='health.d/postgres.conf'
   ['15e32114994b92be7853b88091e7c6fb']='python.d/exim.conf'
   ['174c21a6ce5de97bda83d502aa47a9f8']='health.d/apache.conf'
@@ -36,6 +39,8 @@ declare -A configs_signatures=(
   ['23ae815aefa221b1929f96752a1f7556']='health.d/squid.conf'
   ['2472e49550326f7142e2c425ccbca005']='health.d/softnet.conf'
   ['254de8ec49602bea2da3631676d7cfec']='health.d/cpu.conf'
+  ['256a7f06f7e579a61752fc64418cffe5']='charts.d/nut.conf'
+  ['262f98b3d88b98978cb08d566ce85a9d']='charts.d/squid.conf'
   ['2827de41cf34a91b7a8e4d8724f59668']='health.d/net.conf'
   ['28df44a90e8ea4c6156314c03e88bf44']='health.d/softnet.conf'
   ['297160ae7ee01a547ed14f857b4f2c8d']='health.d/memcached.conf'
@@ -59,6 +64,7 @@ declare -A configs_signatures=(
   ['3848172053221b95279ba9bf789cd4e0']='health.d/apache.conf'
   ['3866efafd38e161136428d0f818cac43']='health.d/net.conf'
   ['38d1bf04fe9901481dd6febcc0404a86']='python.d.conf'
+  ['39304b2570611c3acb35b72762b46778']='charts.d/sensors.conf'
   ['39571e9fad9b759200c5d5b2ee13feb4']='python.d/redis.conf'
   ['39f9422b0f0c3eec11a31aff79d89514']='health.d/retroshare.conf'
   ['3af522d65b50a5e447607ffb28c81ff5']='apps_groups.conf'
@@ -74,12 +80,14 @@ declare -A configs_signatures=(
   ['42ad0e70b1365b6e7244cc305dbaa529']='health_alarm_notify.conf'
   ['42bf1c7c64ed77038a0aa094d792a9e2']='python.d/mysql.conf'
   ['43ebb7f224c3b232d8ad044d7e9508b6']='health.d/net.conf'
+  ['444e20cf75e2cd019e8d412d5d1f4a7f']='charts.d/cpu_apps.conf'
   ['450667c552ab7a7d8d4a2c214fdacca5']='health.d/entropy.conf'
   ['45a77ac36ba9f1898144b902de17204b']='health.d/memcached.conf'
   ['46798cda21e1a5faa769abf4e5d27c48']='health.d/disks.conf'
   ['46ef6c1b638e40a7dfd62defdc5f99a3']='health.d/retroshare.conf'
   ['47180421d580baeaedf8c0ef3d647fb5']='python.d/hddtemp.conf'
   ['48195c5c8c0476a49b714b4c76bdb570']='python.d/squid.conf'
+  ['48eef63bcf744bae114b502b6dacb4a1']='charts.d/phpfpm.conf'
   ['4a448831776de8acf2e0bdc4cc994cb4']='apps_groups.conf'
   ['4b775fb31342f1478b3773d041a72911']='python.d.conf'
   ['4ccb06fff1ce06dc5bc80e0a9f568f6e']='charts.d.conf'
@@ -109,6 +117,7 @@ declare -A configs_signatures=(
   ['5e6fd588ef6934cf04ddb5e662aa02ea']='health.d/postgres.conf'
   ['5eb670b6fe39da5fec2523d910b0dd1e']='health.d/cpu.conf'
   ['5ff1bcaa58695754e2f6980bfe19f579']='health.d/entropy.conf'
+  ['61b7ed36f35e7bd930f5f7f91694a112']='charts.d/postfix.conf'
   ['621f10b257a11add5ff5aff41e9662e3']='health.d/memcached.conf'
   ['623771eecb3c277fc728b5304793f93b']='health.d/cpu.conf'
   ['636d032928ea0f4741eab264fb49c099']='apps_groups.conf'
@@ -117,9 +126,11 @@ declare -A configs_signatures=(
   ['647361e99b5f4e0d73470c569bb9461c']='apps_groups.conf'
   ['64ac37868097a462e5ee6905c350267e']='python.d/postgres.conf'
   ['64c48f9726ab987baec9c617a9fef7a6']='health.d/nginx.conf'
+  ['65c6933a17fb6b7f8e6baeab73431c17']='charts.d/apcupsd.conf'
   ['6608c6546b3c6bde084fc1d34b1163c1']='health.d/retroshare.conf'
   ['669ebef43ee341f6889d382e86d0e200']='health.d/named.conf'
   ['66dfe138058ca26a31a118007eb31f35']='health.d/nginx.conf'
+  ['6814b9bc84483db428f6a479ba221855']='python.d/mysql.conf'
   ['6a18f61a595c0d48c3363bcc0dbfa6b9']='health_alarm_notify.conf'
   ['6a47af861ad3dd112124c37fbf09672b']='apps_groups.conf'
   ['6b39de5d85db45115db236347a6896d4']='health.d/named.conf'
@@ -135,7 +146,9 @@ declare -A configs_signatures=(
   ['7454ed74511d7b9819dfe173f9020786']='python.d/redis.conf'
   ['749fe31362969d75f1ea66d15231d98d']='python.d/retroshare.conf'
   ['7596ae54d46ce199ac599429ef753caf']='health.d/cpu.conf'
+  ['75a9c4b0b1c73956df55585eb0619f6c']='charts.d/ap.conf'
   ['777f4da70f461ef675bde07fb3644312']='python.d/redis.conf'
+  ['7808ba2ca26bd0642270740cf6a8ee59']='charts.d/mem_apps.conf'
   ['7830066c46a7e5f9682b8d3f4566b4e5']='python.d/cpufreq.conf'
   ['78bb08809dffcb62e9bc493840f9c039']='python.d/squid.conf'
   ['78e0065738394f5bf15023f41d66ed4b']='python.d/squid.conf'
@@ -156,6 +169,7 @@ declare -A configs_signatures=(
   ['842b1ad5b89bfa5f421d9c5b72e001a4']='health.d/apache.conf'
   ['845023f9b4a526aa0e6493756dbe6034']='health.d/squid.conf'
   ['846ce94bfeeb90c0dc6a89e8d25f1a68']='health.d/named.conf'
+  ['8490f690d97adacc4e2096df82e7e8a5']='charts.d/cpufreq.conf'
   ['8810140ce9c09af1d18b9602c4003904']='health_alarm_notify.conf'
   ['88f77865f75c9fb61c97d700bd4561ee']='python.d/mysql.conf'
   ['8989b5e2f4ef9cd278ef58be0fae4074']='health.d/disks.conf'
@@ -226,6 +240,7 @@ declare -A configs_signatures=(
   ['bb51112d01ff20053196a57632df8962']='apps_groups.conf'
   ['bba2f3886587f137ea08a6e63dd3d376']='python.d.conf'
   ['bda5517ea01640cfdfa0a27549619d6a']='health.d/memcached.conf'
+  ['c004430f55310ae9ed489c4905ed02cb']='charts.d/apache.conf'
   ['c080e006f544c949baca33cc24a9c126']='health_alarm_notify.conf'
   ['c1a7e634b5b8aad523a0d115a93379cd']='health.d/memcached.conf'
   ['c3296c08260bcd556e74711c820817be']='health.d/cpu.conf'
@@ -237,6 +252,7 @@ declare -A configs_signatures=(
   ['ca249db7a0637d55abb938d969f9b486']='python.d/postfix.conf'
   ['cb178b15427274d7def5b14bc4c09441']='health.d/net.conf'
   ['cb60badf376d246ad8ec9d3f524db430']='health.d/disks.conf'
+  ['cc4d31a0d1ff9c339892c1f8a0c5fcd3']='charts.d/load_average.conf'
   ['ccde91d209aeb02c4a6be0e43a8d92b3']='health.d/apache.conf'
   ['cd08e5534c94bf1f2cd28396c76b8bbc']='health.d/ram.conf'
   ['ce2e8768964a936f58c4c2144aee8a01']='health_alarm_notify.conf'
@@ -277,9 +293,12 @@ declare -A configs_signatures=(
   ['eb5168f0b516bc982aac45e59da6e52e']='health.d/nginx.conf'
   ['eb748d6fb69d11b0d29c5794657e206c']='health.d/qos.conf'
   ['ebd0612ccc5807524ebb2b647e3e56c9']='apps_groups.conf'
+  ['ecd3aa97e2581f88eb466d6612690ef2']='charts.d/nginx.conf'
   ['ee5343881744e6a97e6ee5cdd329cfb8']='health.d/retroshare.conf'
   ['ef9916ea144878a9f37cbb6b1b29da10']='health.d/squid.conf'
   ['f2f1b8656f5011e965ac45b818cf668d']='apps_groups.conf'
+  ['f42df9f13abfae2426519c6728b34882']='charts.d/example.conf'
+  ['f66e5236ba1245bb2e5fd99191f114c6']='charts.d/hddtemp.conf'
   ['f6c6656f900ff52d159dca12d624016a']='python.d/postgres.conf'
   ['f7a99e94231beda85c6254912d8d31c1']='python.d/tomcat.conf'
   ['f82924563e41d99cdae5431f0af69155']='python.d.conf'
@@ -288,6 +307,7 @@ declare -A configs_signatures=(
   ['fa4396513b358d6ec6a7f5bfb08439b8']='health.d/net.conf'
   ['fd3164e6e8cb6726706267eae49aa082']='health_alarm_notify.conf'
   ['fdd11640ba626cc2064c2fe3ea3eee4c']='health.d/cpu.conf'
+  ['fde44f62c8d7e52f09705cd273fae6b1']='charts.d/tomcat.conf'
   ['fdea185e0e52b459b48852aa37f20e0f']='apps_groups.conf'
   ['fe478efe2e721724edb1fe2ef1addf93']='health_alarm_notify.conf'
   ['feb8bcf828aa2529a7ee4a140feeb12d']='health.d/net.conf'
index 502eb8c85667f890df9f40af395d24116de8f9ba..a720ce421d35a18b6ad3c659c7d3225daacbbb5e 100755 (executable)
@@ -13,7 +13,7 @@ then
 fi
 
 LC_ALL=C
-umask 022
+umask 007
 
 # Be nice on production environments
 renice 19 $$ >/dev/null 2>/dev/null
@@ -547,6 +547,9 @@ do
     fi
 done
 
+echo >&2 "Fixing permissions ..."
+run find ./system/ -type f -a \! -name \*.in -a \! -name Makefile\* -a \! -name \*.conf  -exec chmod 755 {} \;
+
 NETDATA_ADDED_TO_DOCKER=0
 if [ ${UID} -eq 0 ]
     then
@@ -609,17 +612,20 @@ config_option() {
     echo "${value}"
 }
 
-# user
-defuser="netdata"
-[ ! "${UID}" = "0" ] && defuser="${USER}"
-NETDATA_USER="$( config_option "run as user" "${defuser}" )"
+# the user netdata will run as
+if [ "${UID}" = "0" ]
+    then
+    NETDATA_USER="$( config_option "run as user" "netdata" )"
+else
+    NETDATA_USER="${USER}"
+fi
 
-NETDATA_WEB_USER="$( config_option "web files owner" "${defuser}" )"
+# the owners of the web files
+NETDATA_WEB_USER="$(  config_option "web files owner" "${NETDATA_USER}" )"
 NETDATA_WEB_GROUP="$( config_option "web files group" "${NETDATA_WEB_USER}" )"
 
 # debug flags
-defdebug=0
-NETDATA_DEBUG="$( config_option "debug flags" ${defdebug} )"
+NETDATA_DEBUG="$( config_option "debug flags" 0 )"
 
 # port
 defport=19999
@@ -654,31 +660,57 @@ fi
 
 echo >&2
 echo >&2 "Fixing directories (user: ${NETDATA_USER})..."
-for x in "${NETDATA_WEB_DIR}" "${NETDATA_CONF_DIR}" "${NETDATA_CACHE_DIR}" "${NETDATA_LOG_DIR}" "${NETDATA_LIB_DIR}" "${NETDATA_CONF_DIR}/python.d" "${NETDATA_CONF_DIR}/charts.d" "${NETDATA_CONF_DIR}/node.d"
+
+# --- conf dir ----
+
+for x in "python.d" "charts.d" "node.d"
 do
-    if [ ! -d "${x}" ]
+    if [ ! -d "${NETDATA_CONF_DIR}/${x}" ]
         then
-        echo >&2 "Creating directory '${x}'"
-        run mkdir -p "${x}" || exit 1
+        echo >&2 "Creating directory '${NETDATA_CONF_DIR}/${x}'"
+        run mkdir -p "${NETDATA_CONF_DIR}/${x}" || exit 1
     fi
+done
+run chown --recursive "${NETDATA_USER}:${NETDATA_USER}" "${NETDATA_CONF_DIR}"
+run find "${NETDATA_CONF_DIR}" -type f -exec chmod 0660 {} \;
+run find "${NETDATA_CONF_DIR}" -type d -exec chmod 0775 {} \;
+
+# --- web dir ----
+
+if [ ! -d "${NETDATA_WEB_DIR}" ]
+    then
+    echo >&2 "Creating directory '${NETDATA_WEB_DIR}'"
+    run mkdir -p "${NETDATA_WEB_DIR}" || exit 1
+fi
+run chown --recursive "${NETDATA_WEB_USER}:${NETDATA_WEB_GROUP}" "${NETDATA_WEB_DIR}"
+run find "${NETDATA_WEB_DIR}" -type f -exec chmod 0664 {} \;
+run find "${NETDATA_WEB_DIR}" -type d -exec chmod 0775 {} \;
+
+# --- data dirs ----
 
-    if [ ${UID} -eq 0 ]
+for x in "${NETDATA_LIB_DIR}" "${NETDATA_CACHE_DIR}" "${NETDATA_LOG_DIR}"
+do
+    if [ ! -d "${x}" ]
         then
-        if [ "${x}" = "${NETDATA_WEB_DIR}" ]
-            then
-            run chown -R "${NETDATA_WEB_USER}:${NETDATA_WEB_GROUP}" "${x}" || echo >&2 "WARNING: Cannot change the ownership of the files in directory ${x} to ${NETDATA_WEB_USER}:${NETDATA_WEB_GROUP}..."
-        else
-            run chown -R "${NETDATA_USER}:${NETDATA_USER}" "${x}" || echo >&2 "WARNING: Cannot change the ownership of the files in directory ${x} to ${NETDATA_USER}..."
-        fi
+        echo >&2 "Creating directory '${x}'"
+        run mkdir -p "${x}" || exit 1
     fi
 
-    run chmod 0755 "${x}" || echo >&2 "WARNING: Cannot change the permissions of the directory ${x} to 0755..."
+    run chown --recursive "${NETDATA_USER}:${NETDATA_USER}" "${x}"
+    #run find "${x}" -type f -exec chmod 0660 {} \;
+    #run find "${x}" -type d -exec chmod 0770 {} \;
 done
 
+# --- plugins ----
+
 if [ ${UID} -eq 0 ]
     then
-    run chown root "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
-    run chmod 0755 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
+    run chown --recursive root:root "${NETDATA_PREFIX}/usr/libexec/netdata"
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type d -exec chmod 0755 {} \;
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -exec chmod 0644 {} \;
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -a -name \*.plugin -exec chmod 0755 {} \;
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -a -name \*.sh -exec chmod 0755 {} \;
+
     run setcap cap_dac_read_search,cap_sys_ptrace+ep "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
     if [ $? -ne 0 ]
         then
@@ -686,6 +718,10 @@ if [ ${UID} -eq 0 ]
         run chown root "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
         run chmod 4755 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
     fi
+else
+    run chown --recursive "${NETDATA_USER}:${NETDATA_USER}" "${NETDATA_PREFIX}/usr/libexec/netdata"
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -exec chmod 0755 {} \;
+    run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type d -exec chmod 0755 {} \;
 fi
 
 # -----------------------------------------------------------------------------
@@ -702,7 +738,7 @@ if [ ${DONOTSTART} -eq 1 ]
             then
             chown "${NETDATA_USER}" "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
         fi
-        chmod 0664 "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
+        chmod 0644 "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
     fi
     banner "is installed now!"
     echo >&2 "  enjoy real-time performance and health monitoring..."
index 5e052e13c4d1f013aab115a7aef7d5328cb1fb57..572e639beee9a69b88fc6f721c86675a62150408 100644 (file)
@@ -134,14 +134,7 @@ var netdata = {
     },
 
     zeropad2: function(s) {
-        if(typeof s !== 'string')
-            s = s.toString();
-
-        switch(s.length) {
-            case 0: return '00';
-            case 1: return '0' + s;
-            default: return s;
-        }
+        return ("00" + s).slice(-2);
     },
 
     logdate: function(d) {
@@ -171,7 +164,7 @@ var netdata = {
         if(typeof service === 'undefined')
             service = {};
 
-        var now = new Date().getTime();
+        var now = Date.now();
 
         service._current_chart = null;  // the current chart we work on
         service._queue = '';            // data to be sent to netdata
@@ -214,7 +207,7 @@ var netdata = {
             if(this.added !== true) {
                 this.added = true;
                 
-                var now = new Date().getTime();
+                var now = Date.now();
                 this.next_run = now - (now % (service.update_every * 1000)) + (service.update_every * 1000);
 
                 netdata.services.push(this);
@@ -230,14 +223,14 @@ var netdata = {
 
             this.module.active++;
             this.running = true;
-            this.started = new Date().getTime();
+            this.started = Date.now();
             this.updates++;
 
             if(netdata.options.DEBUG === true)
                 netdata.debug(this.module.name + ': ' + this.name + ': making ' + this.processor.name + ' request: ' + netdata.stringify(this));
 
             this.processor.process(this, function(response) {
-                service.ended = new Date().getTime();
+                service.ended = Date.now();
                 service.duration = service.ended - service.started;
 
                 if(typeof response === 'undefined')
@@ -541,7 +534,7 @@ var netdata = {
     runAllServices: function() {
         if(netdata.options.DEBUG === true) netdata.debug('runAllServices()');
 
-        var now = new Date().getTime();
+        var now = Date.now();
         var len = netdata.services.length;
         while(len--) {
             var service = netdata.services[len];
@@ -551,7 +544,7 @@ var netdata = {
 
             service.update();
 
-            now = new Date().getTime();
+            now = Date.now();
             service.next_run = now - (now % (service.update_every * 1000)) + (service.update_every * 1000);
         }
 
index 2453012e87ede4859a43183b8a8bb20a060c3841..c63634f060d5b8b09b76bac6fe698c0fe6acc7c6 100644 (file)
@@ -228,7 +228,7 @@ int become_daemon(int dont_fork, const char *user)
     }
 
     // Set new file permissions
-    umask(0002);
+    umask(0007);
 
     // adjust my Out-Of-Memory score
     oom_score_adj(1000);
index ac04ca7213e27dd66271651997a93948d2dea825..d4a200fec7747363fe8aeae59679fe555450d461 100644 (file)
@@ -1,6 +1,6 @@
 #include "common.h"
 
-void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
+void rrd_stats_api_v1_chart_with_data(RRDSET *st, BUFFER *wb, size_t *dimensions_count, size_t *memory_used)
 {
     pthread_rwlock_rdlock(&st->rwlock);
 
@@ -41,7 +41,7 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
 
     unsigned long memory = st->memsize;
 
-    int c = 0;
+    size_t dimensions = 0;
     RRDDIM *rd;
     for(rd = st->dimensions; rd ; rd = rd->next) {
         if(rd->flags & RRDDIM_FLAG_HIDDEN) continue;
@@ -51,14 +51,17 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
         buffer_sprintf(wb,
             "%s"
             "\t\t\t\t\"%s\": { \"name\": \"%s\" }"
-            , c?",\n":""
+            , dimensions?",\n":""
             , rd->id
             , rd->name
             );
 
-        c++;
+        dimensions++;
     }
 
+    if(dimensions_count) *dimensions_count += dimensions;
+    if(memory_used) *memory_used += memory;
+
     buffer_strcat(wb, "\n\t\t\t},\n\t\t\t\"green\": ");
     buffer_rrd_value(wb, st->green);
     buffer_strcat(wb, ",\n\t\t\t\"red\": ");
@@ -71,9 +74,13 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
     pthread_rwlock_unlock(&st->rwlock);
 }
 
+void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb) {
+    rrd_stats_api_v1_chart_with_data(st, wb, NULL, NULL);
+}
+
 void rrd_stats_api_v1_charts(BUFFER *wb)
 {
-    long c;
+    size_t c, dimensions = 0, memory = 0, alarms = 0;
     RRDSET *st;
 
     buffer_sprintf(wb, "{\n"
@@ -93,13 +100,28 @@ void rrd_stats_api_v1_charts(BUFFER *wb)
             buffer_strcat(wb, "\n\t\t\"");
             buffer_strcat(wb, st->id);
             buffer_strcat(wb, "\": ");
-            rrd_stats_api_v1_chart(st, wb);
+            rrd_stats_api_v1_chart_with_data(st, wb, &dimensions, &memory);
             c++;
         }
     }
+
+    RRDCALC *rc;
+    for(rc = localhost.alarms; rc ; rc = rc->next) {
+        alarms++;
+    }
     pthread_rwlock_unlock(&localhost.rrdset_root_rwlock);
 
-    buffer_strcat(wb, "\n\t}\n}\n");
+    buffer_sprintf(wb, "\n\t}"
+                    ",\n\t\"charts_count\": %zu"
+                    ",\n\t\"dimensions_count\": %zu"
+                    ",\n\t\"alarms_count\": %zu"
+                    ",\n\t\"rrd_memory_bytes\": %zu"
+                    "\n}\n"
+                   , c
+                   , dimensions
+                   , alarms
+                   , memory
+    );
 }
 
 
index cf88c8691dba42c3faef2d43e39742a9f0b7e4e4..b0e26283384f85e6a80480494273989dbab41496 100644 (file)
@@ -7,6 +7,8 @@ char *listen_fds_names[MAX_LISTEN_FDS] = { [0 ... 99] = NULL };
 int listen_port = LISTEN_PORT;
 int web_server_mode = WEB_SERVER_MODE_MULTI_THREADED;
 
+static int shown_server_socket_error = 0;
+
 #ifdef NETDATA_INTERNAL_CHECKS
 static void log_allocations(void)
 {
@@ -90,6 +92,7 @@ int create_listen_socket4(const char *ip, int port, int listen_backlog) {
     sock = socket(AF_INET, SOCK_STREAM, 0);
     if(sock < 0) {
         error("IPv4 socket() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
@@ -105,6 +108,7 @@ int create_listen_socket4(const char *ip, int port, int listen_backlog) {
     int ret = inet_pton(AF_INET, ip, (void *)&name.sin_addr.s_addr);
     if(ret != 1) {
         error("Failed to convert IP '%s' to a valid IPv4 address.", ip);
+        shown_server_socket_error = 1;
         close(sock);
         return -1;
     }
@@ -112,12 +116,14 @@ int create_listen_socket4(const char *ip, int port, int listen_backlog) {
     if(bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) {
         close(sock);
         error("IPv4 bind() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
     if(listen(sock, listen_backlog) < 0) {
         close(sock);
-        fatal("IPv4 listen() on ip '%s' port %d failed.", ip, port);
+        error("IPv4 listen() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
@@ -135,6 +141,7 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog) {
     sock = socket(AF_INET6, SOCK_STREAM, 0);
     if (sock < 0) {
         error("IPv6 socket() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
@@ -154,6 +161,7 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog) {
     int ret = inet_pton(AF_INET6, ip, (void *)&name.sin6_addr.s6_addr);
     if(ret != 1) {
         error("Failed to convert IP '%s' to a valid IPv6 address.", ip);
+        shown_server_socket_error = 1;
         close(sock);
         return -1;
     }
@@ -163,12 +171,14 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog) {
     if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) {
         close(sock);
         error("IPv6 bind() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
     if (listen(sock, listen_backlog) < 0) {
         close(sock);
         error("IPv6 listen() on ip '%s' port %d failed.", ip, port);
+        shown_server_socket_error = 1;
         return -1;
     }
 
@@ -179,6 +189,7 @@ int create_listen_socket6(const char *ip, int port, int listen_backlog) {
 static inline int add_listen_socket(int fd, const char *ip, int port) {
     if(listen_fds_count >= MAX_LISTEN_FDS) {
         error("Too many listening sockets. Failed to add listening socket at ip '%s' port %d", ip, port);
+        shown_server_socket_error = 1;
         close(fd);
         return -1;
     }
@@ -303,6 +314,8 @@ static inline int bind_to_one(const char *definition, int default_port, int list
 }
 
 int create_listen_sockets(void) {
+    shown_server_socket_error = 0;
+
     listen_backlog = (int) config_get_number("global", "http port listen backlog", LISTEN_BACKLOG);
 
     if(config_exists("global", "bind socket to IP") && !config_exists("global", "bind to"))
@@ -340,6 +353,11 @@ int create_listen_sockets(void) {
 
     if(!listen_fds_count)
         fatal("Cannot listen on any socket. Exiting...");
+    else if(shown_server_socket_error) {
+        size_t i;
+        for(i = 0; i < listen_fds_count ;i++)
+            info("Listen socket %s opened.", listen_fds_names[i]);
+    }
 
     return (int)listen_fds_count;
 }
index c47c5c0c9478a0d597cc5323ee3b55cf82ecb77d..080ae7dd2cf114009dc633f7d36f56252f2b82b6 100644 (file)
             dashboard_css: NETDATA.serverDefault + 'dashboard.css?v20161002-1',
             background: '#FFFFFF',
             foreground: '#000000',
-            grid: '#DDDDDD',
-            axis: '#CCCCCC',
+            grid: '#F0F0F0',
+            axis: '#F0F0F0',
             colors: [   '#3366CC', '#DC3912',   '#109618', '#FF9900',   '#990099', '#DD4477',
                         '#3B3EAC', '#66AA00',   '#0099C6', '#B82E2E',   '#AAAA11', '#5574A6',
                         '#994499', '#22AA99',   '#6633CC', '#E67300',   '#316395', '#8B0707',
                                         // rendering the chart that is panned or zoomed).
                                         // Used with .current.global_pan_sync_time
 
-        last_resized: new Date().getTime(), // the timestamp of the last resize request
+        last_resized: Date.now(),       // the timestamp of the last resize request
 
         last_page_scroll: 0,            // the timestamp the last time the page was scrolled
 
         console.log('welcome to NETDATA');
 
     NETDATA.onresize = function() {
-        NETDATA.options.last_resized = new Date().getTime();
+        NETDATA.options.last_resized = Date.now();
         NETDATA.onscroll();
     };
 
     NETDATA.onscroll_updater = function() {
         NETDATA.onscroll_updater_running = true;
         NETDATA.onscroll_updater_count++;
-        var start = new Date().getTime();
+        var start = Date.now();
 
         var targets = NETDATA.options.targets;
         var len = targets.length;
                 targets[len].isVisible();
         }
 
-        var end = new Date().getTime();
+        var end = Date.now();
         // console.log('scroll No ' + NETDATA.onscroll_updater_count + ' calculation took ' + (end - start).toString() + ' ms');
 
         if(NETDATA.options.current.async_on_scroll === false) {
     NETDATA.onscroll = function() {
         // console.log('onscroll');
 
-        NETDATA.options.last_page_scroll = new Date().getTime();
+        NETDATA.options.last_page_scroll = Date.now();
         NETDATA.options.auto_refresher_stop_until = 0;
 
         if(NETDATA.options.targets === null) return;
     NETDATA.error = function(code, msg) {
         NETDATA.errorLast.code = code;
         NETDATA.errorLast.message = msg;
-        NETDATA.errorLast.datetime = new Date().getTime();
+        NETDATA.errorLast.datetime = Date.now();
 
         console.log("ERROR " + code + ": " + NETDATA.errorCodes[code].message + ": " + msg);
 
             if(this.master !== null && this.master !== state)
                 this.master.resetChart(true, true);
 
-            var now = new Date().getTime();
+            var now = Date.now();
             this.master = state;
             this.seq = now;
             this.force_after_ms = after;
             if(NETDATA.chartDefaults.min_width !== null)
                 $(that.element).css('min-width', NETDATA.chartDefaults.min_width);
 
-            that.tm.last_dom_created = new Date().getTime();
+            that.tm.last_dom_created = Date.now();
 
             showLoading();
         };
             that.data_before = 0;           // milliseconds - the last timestamp of the data
             that.data_update_every = 0;     // milliseconds - the frequency to update the data
 
-            that.tm.last_initialized = new Date().getTime();
+            that.tm.last_initialized = Date.now();
             createDOM();
 
             that.setMode('auto');
                     showRendering();
                     that.element_chart.style.display = 'none';
                     if(that.element_legend !== null) that.element_legend.style.display = 'none';
-                    that.tm.last_hidden = new Date().getTime();
+                    that.tm.last_hidden = Date.now();
 
                     // de-allocate data
                     // This works, but I not sure there are no corner cases somewhere
                 init();
             }
             else {
-                that.tm.last_unhidden = new Date().getTime();
+                that.tm.last_unhidden = Date.now();
                 that.element_chart.style.display = '';
                 if(that.element_legend !== null) that.element_legend.style.display = '';
                 resizeChart();
                     maxMessageFontSize();
                 }
 
-                that.tm.last_resized = new Date().getTime();
+                that.tm.last_resized = Date.now();
             }
         };
 
             if(that.settings_id !== null)
                 NETDATA.localStorageSet('chart_heights.' + that.settings_id, h);
 
-            var now = new Date().getTime();
+            var now = Date.now();
             NETDATA.options.last_page_scroll = now;
             NETDATA.options.auto_refresher_stop_until = now + NETDATA.options.current.stop_updates_while_resizing;
 
             this.event_resize.chart_last_w = this.element.clientWidth;
             this.event_resize.chart_last_h = this.element.clientHeight;
 
-            var now = new Date().getTime();
+            var now = Date.now();
             if(now - this.event_resize.last <= NETDATA.options.current.double_click_speed) {
                 // double click / double tap event
 
         var noDataToShow = function() {
             showMessageIcon('<i class="fa fa-warning"></i> empty');
             that.legendUpdateDOM();
-            that.tm.last_autorefreshed = new Date().getTime();
+            that.tm.last_autorefreshed = Date.now();
             // that.data_update_every = 30 * 1000;
             //that.element_chart.style.display = 'none';
             //if(that.element_legend !== null) that.element_legend.style.display = 'none';
             this.current.force_before_ms = null;
             this.current.force_after_ms = null;
 
-            this.tm.last_mode_switch = new Date().getTime();
+            this.tm.last_mode_switch = Date.now();
         };
 
         // ----------------------------------------------------------------------------------------------------------------
                 return;
 
             if(typeof ms === 'number')
-                NETDATA.globalSelectionSync.dont_sync_before = new Date().getTime() + ms;
+                NETDATA.globalSelectionSync.dont_sync_before = Date.now() + ms;
             else
-                NETDATA.globalSelectionSync.dont_sync_before = new Date().getTime() + NETDATA.options.current.sync_selection_delay;
+                NETDATA.globalSelectionSync.dont_sync_before = Date.now() + NETDATA.options.current.sync_selection_delay;
         };
 
         // can we globally apply selection sync?
             if(NETDATA.options.current.sync_selection === false)
                 return false;
 
-            if(NETDATA.globalSelectionSync.dont_sync_before > new Date().getTime())
+            if(NETDATA.globalSelectionSync.dont_sync_before > Date.now())
                 return false;
 
             return true;
             if(this.debug === true)
                 this.log(logme + 'ACCEPTING UPDATE: current/min duration: ' + (current_duration / 1000).toString() + '/' + (this.fixed_min_duration / 1000).toString() + ', wanted duration: ' + (wanted_duration / 1000).toString() + ', duration diff: ' + (Math.round(Math.abs(current_duration - wanted_duration) / 1000)).toString() + ', movement: ' + (movement / 1000).toString() + ', tolerance: ' + (tolerance / 1000).toString() + ', returning: ' + ret);
 
-            this.current.force_update_at = new Date().getTime() + NETDATA.options.current.pan_and_zoom_delay;
+            this.current.force_update_at = Date.now() + NETDATA.options.current.pan_and_zoom_delay;
             this.current.force_after_ms = after;
             this.current.force_before_ms = before;
             NETDATA.globalPanAndZoom.setMaster(this, after, before);
             this.updates_since_last_unhide++;
             this.updates_since_last_creation++;
 
-            var started = new Date().getTime();
+            var started = Date.now();
 
             // if the result is JSON, find the latest update-every
             this.data_update_every = data.view_update_every * 1000;
                 NETDATA.globalSelectionSync.stop();
 
             // update the performance counters
-            var now = new Date().getTime();
+            var now = Date.now();
             this.tm.last_updated = now;
 
             // don't update last_autorefreshed if this chart is
             if(nocache === false && this.tm.last_visible_check > NETDATA.options.last_page_scroll)
                 return this.___isVisible___;
 
-            this.tm.last_visible_check = new Date().getTime();
+            this.tm.last_visible_check = Date.now();
 
             var wh = window.innerHeight;
             var x = this.element.getBoundingClientRect();
         };
 
         this.canBeAutoRefreshed = function() {
-            var now = new Date().getTime();
+            var now = Date.now();
 
             if(this.running === true) {
                 if(this.debug === true)
             this.chart_url = chart.url;
             this.data_update_every = chart.update_every * 1000;
             this.data_points = Math.round(this.chartWidth() / this.chartPixelsPerPoint());
-            this.tm.last_info_downloaded = new Date().getTime();
+            this.tm.last_info_downloaded = Date.now();
 
             if(this.title === null)
                 this.title = chart.title;
     };
 
     NETDATA.parseDom = function(callback) {
-        NETDATA.options.last_page_scroll = new Date().getTime();
+        NETDATA.options.last_page_scroll = Date.now();
         NETDATA.options.updated_dom = false;
 
         var targets = $('div[data-netdata]'); //.filter(':visible');
             dygraph.updateOptions(options);
         }
 
-        state.dygraph_last_rendered = new Date().getTime();
+        state.dygraph_last_rendered = Date.now();
         return true;
     };
 
                     // the internal default of dygraphs
                     context.touchDirections = { x: true, y: false };
 
-                    state.dygraph_last_touch_start = new Date().getTime();
+                    state.dygraph_last_touch_start = Date.now();
                     state.dygraph_last_touch_move = 0;
 
                     if(typeof event.touches[0].pageX === 'number')
                     state.dygraph_user_action = true;
                     Dygraph.defaultInteractionModel.touchmove(event, dygraph, context);
 
-                    state.dygraph_last_touch_move = new Date().getTime();
+                    state.dygraph_last_touch_move = Date.now();
                 },
                 touchend: function(event, dygraph, context) {
                     if(NETDATA.options.debug.dygraph === true || state.debug === true)
                     }
 
                     // if it was double tap within double click time, reset the charts
-                    var now = new Date().getTime();
+                    var now = Date.now();
                     if(typeof state.dygraph_last_touch_end !== 'undefined') {
                         if(state.dygraph_last_touch_move === 0) {
                             var dt = now - state.dygraph_last_touch_end;
 
         state.dygraph_force_zoom = false;
         state.dygraph_user_action = false;
-        state.dygraph_last_rendered = new Date().getTime();
+        state.dygraph_last_rendered = Date.now();
 
         if(typeof state.dygraph_instance.axes_[0].extremeRange !== 'undefined') {
             state.__commonMin = self.data('common-min') || null;
                 NETDATA.registry.machines = {};
                 NETDATA.registry.machines_array = new Array();
 
-                var now = new Date().getTime();
+                var now = Date.now();
                 var apu = person_urls;
                 var i = apu.length;
                 while(i--) {
index e6079e2d1b465bfb6cf8d982ac4bd7c2794cbde2..f8fea7c3766a6de0a81ffbdca658f994dc77dfba 100644 (file)
             html += mhead + shtml + '</div></div><hr role="separator"/>';
         }
 
+        sidebar += '<li class="" style="padding-top:15px;"><a href="https://github.com/firehol/netdata/wiki/Add-more-charts-to-netdata" target="_blank"><i class="fa fa-plus" aria-hidden="true"></i> add more charts</a></li>';
+        sidebar += '<li class=""><a href="https://github.com/firehol/netdata/wiki/Add-more-alarms-to-netdata" target="_blank"><i class="fa fa-plus" aria-hidden="true"></i> add more alarms</a></li>';
+        sidebar += '<li class="" style="margin:20px;color:#666;"><small>netdata on <b>' + data.hostname.toString() + '</b>, collects every ' + ((data.update_every == 1)?'second':data.update_every.toString() + ' seconds') + ' <b>' + data.dimensions_count.toLocaleString() + '</b> metrics, presented as <b>' + data.charts_count.toLocaleString() + '</b> charts and monitored by <b>' + data.alarms_count.toLocaleString() + '</b> alarms, using ' + Math.round(data.rrd_memory_bytes / 1024 / 1024).toLocaleString() + ' MB of memory for ' + Math.round(data.history / 3600).toLocaleString() + ' ' + ((data.history == 3600)?'hour':'hours').toString() + ' of real-time history.</small></li>';
         sidebar += '</ul>';
         div.innerHTML = html;
         document.getElementById('sidebar').innerHTML = sidebar;
             }
 
             // find the proper family of each alarm
-            var now = new Date().getTime();
+            var now = Date.now();
             var x;
             var count_active = 0;
             var count_all = 0;
     function notifyForUpdate(force) {
         versionLog('<p>checking for updates...</p>');
 
-        var now = new Date().getTime();
+        var now = Date.now();
 
         if(typeof force === 'undefined' || force !== true) {
             var last = loadLocalStorage('last_update_check');
     </div>
 </body>
 </html>
-<script type="text/javascript" src="dashboard.js?v20161112-1"></script>
+<script type="text/javascript" src="dashboard.js?v20161126-1"></script>
index 3a28daf738b4ef98076aa532b0f1e8ac1cb3fe89..370cf1bb05f0be9eae03f8f655a14ce0c8d96cc6 100644 (file)
@@ -228,7 +228,7 @@ function refreshHiddenChart(doNext) {
        }
 
        // is it too soon for a refresh?
-       var now = new Date().getTime();
+       var now = Date.now();
        if((now - mainchart.hiddenchart.last_updated) < (mainchart.update_every * 10 * 1000) || (now - mainchart.hiddenchart.last_updated) < (mainchart.hiddenchart.group * mainchart.hiddenchart.update_every * 1000)) {
                if(typeof doNext == "function") doNext();
                return;
@@ -319,7 +319,7 @@ function refreshHiddenChart(doNext) {
                }
 
                mainchart.dashboard.draw(mainchart.control_data);
-               mainchart.hiddenchart.last_updated = new Date().getTime();
+               mainchart.hiddenchart.last_updated = Date.now();
                mainchart.hiddenchart.refreshCount++;
        })
        .always(function() {
@@ -583,7 +583,7 @@ function playGraphs() {
        $('.global_play_button').button('play');
 
        // check if the thread died due to a javascript error
-       var now = new Date().getTime();
+       var now = Date.now();
        if((now - last_refresh) > 60000) {
                // it died or never started
                //mylog('It seems the refresh thread died. Restarting it.');
@@ -607,7 +607,7 @@ function checkRefreshThread() {
                return;
        }
 
-       var now = new Date().getTime();
+       var now = Date.now();
        if(now - last_refresh > 60000) {
                mylog('Refresh thread died. Restarting it.');
                renderChartCallback();
@@ -619,7 +619,7 @@ function checkRefreshThread() {
 // never call it directly, or new javascript threads will be spawn
 var timeout = null;
 function renderChartCallback() {
-       last_refresh = new Date().getTime();
+       last_refresh = Date.now();
 
        if(!page_is_visible) {
                timeout = setTimeout(triggerRefresh, CHARTS_CHECK_NO_FOCUS);
@@ -635,7 +635,7 @@ function renderChartCallback() {
        }
 
        if(last_user_scroll) {
-               var now = new Date().getTime();
+               var now = Date.now();
                if((now - last_user_scroll) >= CHARTS_SCROLL_IDLE) {
                        last_user_scroll = 0;
                        mylog('Scrolling: resuming refresh...');
@@ -672,7 +672,7 @@ function triggerRefresh() {
        //mylog('triggerRefresh()');
 
        if(!page_is_visible || (refresh_mode == REFRESH_PAUSED && mode != MODE_MAIN)) {
-               last_refresh = new Date().getTime();
+               last_refresh = Date.now();
                timeout = setTimeout(triggerRefresh, CHARTS_REFRESH_IDLE);
                return;
        }
@@ -1028,7 +1028,7 @@ function initCharts() {
        var height = TARGET_THUMB_GRAPH_HEIGHT;
 
        window.onscroll = function (e) {
-               last_user_scroll = new Date().getTime();
+               last_user_scroll = Date.now();
                mylog('Scrolling: detected');
        }
 
index f1af0a67d2b7f5e27e62920879c05b84ebba309b..db0e456853c11772fe330bf6b03c264cfd9c04ee 100644 (file)
@@ -13,7 +13,7 @@ function canChartBeRefreshed(chart) {
        if(chart.chart && chart.chart.getSelection()[0]) return false;
 
        // is it too soon for a refresh?
-       var now = new Date().getTime();
+       var now = Date.now();
        if((now - chart.last_updated) < (chart.group * chart.update_every * 1000)) return false;
 
        // is the chart in the visible area?
@@ -79,7 +79,7 @@ function renderChart(chart, doNext) {
                if(chart.chart) {
                        chart.chart.draw(chart.datatable, chart.chartOptions);
                        chart.refreshCount++;
-                       chart.last_updated = new Date().getTime();
+                       chart.last_updated = Date.now();
                }
                else console.log('Cannot create chart for ' + chart.url);
        })
@@ -89,7 +89,7 @@ function renderChart(chart, doNext) {
                chart.chart = null;
                chart.refreshCount = 0;
                showChartIsLoading(chart.div, chart.name, chart.chartOptions.width, chart.chartOptions.height, "failed to refresh");
-               chart.last_updated = new Date().getTime();
+               chart.last_updated = Date.now();
        })
        .always(function() {
                if(typeof doNext == "function") doNext();
@@ -128,7 +128,7 @@ function calculateChartPointsToShow(c, divisor, maxtime, group, enable_curve) {
 
        if(!divisor) divisor = 2;
 
-       var before = c.before?c.before:new Date().getTime() / 1000;
+       var before = c.before?c.before:Date.now() / 1000;
        var after = c.after?c.after:c.first_entry_t;
 
        var dt = before - after;