@cryptotaxi247 / netdata-1 / commits / 58c7968ee

multi-os support (final touch)

Costa Tsaousis (ktsaou) committed Feb 8, 2017 at 01:00 UTC 58c7968eebcd1c08bc77c398cd47f996440a8134
4 files changed +249 -172
conf.d/Makefile.am
+9 -3
@@ -57,11 +57,11 @@ dist_pythonconfig_DATA = \
57 $(NULL)
58
59 healthconfigdir=$(configdir)/health.d
60 +
61 dist_healthconfig_DATA = \
62 health.d/apache.conf \
63 health.d/backend.conf \
64 health.d/bind_rndc.conf \
64 - health.d/cpu.conf \
65 health.d/disks.conf \
66 health.d/elasticsearch.conf \
67 health.d/entropy.conf \
@@ -80,17 +80,23 @@ dist_healthconfig_DATA = \
80 health.d/nginx.conf \
81 health.d/postgres.conf \
82 health.d/qos.conf \
83 - health.d/ram.conf \
83 health.d/redis.conf \
84 health.d/retroshare.conf \
85 health.d/softnet.conf \
86 health.d/squid.conf \
88 - health.d/swap.conf \
87 health.d/tcp_resets.conf \
88 health.d/udp_errors.conf \
89 health.d/varnish.conf \
90 $(NULL)
91
92 +if LINUX
93 +dist_healthconfig_DATA += \
94 + health.d/cpu.conf \
95 + health.d/ram.conf \
96 + health.d/swap.conf \
97 + $(NULL)
98 +endif LINUX
99 +
100 chartsconfigdir=$(configdir)/charts.d
101 dist_chartsconfig_DATA = \
102 charts.d/apache.conf \
configure.ac
+2
@@ -59,11 +59,13 @@ darwin*)
59 LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit"
60 ;;
61 *)
62 + build_target=linux
63 ;;
64 esac
65
66 AM_CONDITIONAL([FREEBSD], [test x$build_target = xfreebsd])
67 AM_CONDITIONAL([MACOS], [test x$build_target = xmacos])
68 +AM_CONDITIONAL([LINUX], [test x$build_target = xlinux])
69
70 AC_ARG_ENABLE(
71 [plugin-nfacct],
web/dashboard_info.js
+63 -59
@@ -14,177 +14,177 @@ netdataDashboard.menu = {
14 'services': {
15 title: 'systemd Services',
16 icon: '<i class="fa fa-cogs" aria-hidden="true"></i>',
17 - info: 'Resources utilization of systemd services.'
17 + info: 'Resources utilization of systemd services. netdata monitors all systemd services via cgroups (the resources accounting used by containers). '
18 },
19
20 'ap': {
21 title: 'Access Points',
22 icon: '<i class="fa fa-wifi" aria-hidden="true"></i>',
23 - info: undefined
23 + info: 'Performance metrics for the access points (i.e. wireless interfaces in AP mode) found on the system.'
24 },
25
26 'tc': {
27 title: 'Quality of Service',
28 icon: '<i class="fa fa-globe" aria-hidden="true"></i>',
29 - 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).'
29 + 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). QoS data collection may have a slight time difference compared to the interface (QoS data collection uses a BASH script, so a shift in data collection of a few milliseconds should be justified).'
30 },
31
32 'net': {
33 title: 'Network Interfaces',
34 icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',
35 - info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
35 + info: 'Performance metrics for network interfaces.'
36 },
37
38 'ipv4': {
39 title: 'IPv4 Networking',
40 icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',
41 - info: undefined
41 + info: 'Performance metrics for the IPv4 stack of the system.'
42 },
43
44 'ipv6': {
45 title: 'IPv6 Networking',
46 icon: '<i class="fa fa-cloud" aria-hidden="true"></i>',
47 - info: undefined
47 + info: 'Performance metrics for the IPv6 stack of the system.'
48 },
49
50 'ipvs': {
51 title: 'IP Virtual Server',
52 icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
53 - info: undefined
53 + info: '<a href="http://www.linuxvirtualserver.org/software/ipvs.html" target="_blank">IPVS (IP Virtual Server)</a> implements transport-layer load balancing inside the Linux kernel, so called Layer-4 switching. IPVS running on a host acts as a load balancer at the front of a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address.'
54 },
55
56 'netfilter': {
57 title: 'Firewall (netfilter)',
58 icon: '<i class="fa fa-shield" aria-hidden="true"></i>',
59 - info: undefined
59 + info: 'Performance metrics of the netfilter components.'
60 },
61
62 'cpu': {
63 title: 'CPUs',
64 icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',
65 - info: undefined
65 + info: 'Detailed information for each CPU of the system. A summary of the system for all CPUs can be found at the <a href="#menu_system">System Overview</a> section.'
66 },
67
68 'mem': {
69 title: 'Memory',
70 icon: '<i class="fa fa-bolt" aria-hidden="true"></i>',
71 - info: undefined
71 + info: 'Detailed information about the memory management of the system.'
72 },
73
74 'disk': {
75 title: 'Disks',
76 icon: '<i class="fa fa-folder" aria-hidden="true"></i>',
77 - info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by altering the relative settings in the netdata configuration file.'
77 + info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by configuring the relative settings in the netdata configuration file.'
78 },
79
80 'sensors': {
81 title: 'Sensors',
82 icon: '<i class="fa fa-leaf" aria-hidden="true"></i>',
83 - info: undefined
83 + info: 'Readings of the configured system sensors.'
84 },
85
86 'nfsd': {
87 title: 'NFS Server',
88 icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
89 - info: undefined
89 + info: 'Performance metrics of the Network File Server. NFS is a distributed file system protocol, allowing a user on a client computer to access files over a network, much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. The NFS is an open standard defined in Request for Comments (RFC).'
90 },
91
92 'nfs': {
93 title: 'NFS Client',
94 icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
95 - info: undefined
95 + info: 'Performance metrics of the NFS operations of this system, acting as an NFS client.'
96 },
97
98 'apps': {
99 title: 'Applications',
100 icon: '<i class="fa fa-heartbeat" aria-hidden="true"></i>',
101 - 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 internally 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). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
101 + info: 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through all processes 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 internally 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). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
102 height: 1.5
103 },
104
105 'users': {
106 title: 'Users',
107 icon: '<i class="fa fa-user" aria-hidden="true"></i>',
108 - info: 'Per user statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
108 + info: 'Per user statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through all processes and aggregates statistics per user. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
109 height: 1.5
110 },
111
112 'groups': {
113 title: 'User Groups',
114 icon: '<i class="fa fa-users" aria-hidden="true"></i>',
115 - info: 'Per user group statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user group. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
115 + info: 'Per user group statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through all processes and aggregates statistics per user group. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
116 height: 1.5
117 },
118
119 'netdata': {
120 title: 'Netdata Monitoring',
121 icon: '<i class="fa fa-bar-chart" aria-hidden="true"></i>',
122 - info: undefined
122 + info: 'Performance metrics for the operation of netdata itself and its plugins.'
123 },
124
125 'example': {
126 title: 'Example Charts',
127 - info: undefined
127 + info: 'Example charts, demonstrating the external plugin architecture.'
128 },
129
130 'cgroup': {
131 title: '',
132 icon: '<i class="fa fa-th" aria-hidden="true"></i>',
133 - info: undefined
133 + info: 'Container resource utilization metrics. Netdata reads this information from <b>cgroups</b> (abbreviated from <b>control groups</b>), a Linux kernel feature that limits and accounts resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes. <b>cgroups</b> together with <b>namespaces</b> (that offer isolation between processes) provide what we usually call: <b>containers</b>.'
134 },
135
136 'cgqemu': {
137 title: '',
138 icon: '<i class="fa fa-th-large" aria-hidden="true"></i>',
139 - info: undefined
139 + info: 'QEMU virtual machine resource utilization metrics. QEMU (short for Quick Emulator) is a free and open-source hosted hypervisor that performs hardware virtualization.'
140 },
141
142 'fping': {
143 title: 'fping',
144 icon: '<i class="fa fa-exchange" aria-hidden="true"></i>',
145 - info: undefined
145 + info: 'Network latency statistics, via <b>fping</b>. <b>fping</b> is a program to send ICMP echo probes to network hosts, similar to <code>ping</code>, but much better performing when pinging multiple hosts. fping versions after 3.15 can be directly used as netdata plugins.'
146 },
147
148 'memcached': {
149 title: 'memcached',
150 icon: '<i class="fa fa-database" aria-hidden="true"></i>',
151 - info: undefined
151 + info: 'Performance metrics for <b>memcached</b>. Memcached is a general-purpose distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read.'
152 },
153
154 'mysql': {
155 title: 'MySQL',
156 icon: '<i class="fa fa-database" aria-hidden="true"></i>',
157 - info: undefined
157 + info: 'Performance metrics for <b>mysql</b>, the open-source relational database management system (RDBMS).'
158 },
159
160 'postgres': {
161 title: 'Postgres',
162 icon: '<i class="fa fa-database" aria-hidden="true"></i>',
163 - info: undefined
163 + info: 'Performance metrics for <b>PostgresSQL</b>, the object-relational database (ORDBMS).'
164 },
165
166 'redis': {
167 title: 'Redis',
168 icon: '<i class="fa fa-database" aria-hidden="true"></i>',
169 - info: undefined
169 + info: 'Performance metrics for <b>redis</b>. Redis (REmote DIctionary Server) is a software project that implements data structure servers. It is open-source, networked, in-memory, and stores keys with optional durability.'
170 },
171
172 'retroshare': {
173 title: 'RetroShare',
174 icon: '<i class="fa fa-share-alt" aria-hidden="true"></i>',
175 - info: undefined
175 + info: 'Performance metrics for <b>RetroShare</b>. RetroShare is open source software for encrypted filesharing, serverless email, instant messaging, online chat, and BBS, based on a friend-to-friend network built on GNU Privacy Guard (GPG).'
176 },
177
178 'ipfs': {
179 title: 'IPFS',
180 icon: '<i class="fa fa-folder-open" aria-hidden="true"></i>',
181 - info: undefined
181 + info: 'Performance metrics for the InterPlanetary File System (IPFS), a content-addressable, peer-to-peer hypermedia distribution protocol.'
182 },
183
184 'phpfpm': {
185 title: 'PHP-FPM',
186 icon: '<i class="fa fa-eye" aria-hidden="true"></i>',
187 - info: undefined
187 + info: 'Performance metrics for <b>PHP-FPM</b>, an alternative FastCGI implementation for PHP.'
188 },
189
190 'postfix': {
@@ -272,7 +272,7 @@ netdataDashboard.submenu = {
272
273 'netfilter.conntrack': {
274 title: 'Connection Tracker',
275 - info: 'Netfilter Connection Tracker performance monitoring, read from <code>/proc/net/stat/nf_conntrack</code>. The connection tracker keeps track of all connections of the machine, inbound and outbound. It works by keeping a database with all open connections, tracking network and address translation and connection expectations.'
275 + info: 'Netfilter Connection Tracker performance metrics. The connection tracker keeps track of all connections of the machine, inbound and outbound. It works by keeping a database with all open connections, tracking network and address translation and connection expectations.'
276 },
277
278 'netfilter.nfacct': {
@@ -282,17 +282,17 @@ netdataDashboard.submenu = {
282
283 'netfilter.synproxy': {
284 title: 'DDoS Protection',
285 - info: 'DDoS Protection performance monitoring read from <code>/proc/net/stat/synproxy</code>. <a href="https://github.com/firehol/firehol/wiki/Working-with-SYNPROXY" target="_blank">SYNPROXY</a> is a TCP SYN packets proxy. It is used to protect any TCP server (like a web server) from SYN floods and similar DDoS attacks. It is a netfilter module, in the Linux kernel (since version 3.12). It is optimized to handle millions of packets per second utilizing all CPUs available without any concurrency locking between the connections. It can be used for any kind of TCP traffic (even encrypted), since it does not interfere with the content itself.'
285 + info: 'DDoS protection performance metrics. <a href="https://github.com/firehol/firehol/wiki/Working-with-SYNPROXY" target="_blank">SYNPROXY</a> is a TCP SYN packets proxy. It is used to protect any TCP server (like a web server) from SYN floods and similar DDoS attacks. It is a netfilter module, in the Linux kernel (since version 3.12). It is optimized to handle millions of packets per second utilizing all CPUs available without any concurrency locking between the connections. It can be used for any kind of TCP traffic (even encrypted), since it does not interfere with the content itself.'
286 },
287
288 'system.softnet_stat': {
289 title: 'softnet',
290 - info: 'Statistics for CPUs SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Break down per CPU core can be found at <a href="#menu_cpu_submenu_softnet_stat">CPU / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
290 + info: 'Statistics for CPUs SoftIRQs related to network receive work. Break down per CPU core can be found at <a href="#menu_cpu_submenu_softnet_stat">CPU / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
291 },
292
293 'cpu.softnet_stat': {
294 title: 'softnet',
295 - info: 'Statistics for per CPUs core SoftIRQs related to network receive work, read from <code>/proc/net/softnet_stat</code>. Total for all CPU cores can be found at <a href="#menu_system_submenu_softnet_stat">System / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
295 + info: 'Statistics for per CPUs core SoftIRQs related to network receive work. Total for all CPU cores can be found at <a href="#menu_system_submenu_softnet_stat">System / softnet statistics</a>. <b>processed</b> states the number of packets processed, <b>dropped</b> is the number packets dropped because the network device backlog was full (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_max_backlog</code>), <b>squeezed</b> is the number of packets dropped because the network device budget ran out (to fix them use <code>sysctl</code> to increase <code>net.core.netdev_budget</code>). More information about identifying and troubleshooting network driver related issues can be found at <a href="https://access.redhat.com/sites/default/files/attachments/20150325_network_performance_tuning.pdf" target="_blank">Red Hat Enterprise Linux Network Performance Tuning Guide</a>.'
296 }
297 };
298
@@ -308,60 +308,64 @@ netdataDashboard.submenu = {
308 //
309 netdataDashboard.context = {
310 'system.cpu': {
311 - 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="#menu_cpu">CPUs</a> section and per application usage at the <a href="#menu_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 driver issues.',
311 + info: function() {
312 + return '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="#menu_cpu">CPUs</a> section and per application usage at the <a href="#menu_apps">Applications Monitoring</a> section.'
313 + + netdataDashboard.sparkline('<br/>Keep an eye on <b>iowait</b> ', 'system.cpu', 'iowait', '%', '. If it is constantly high, your disks are a bottleneck and they slow your system down.')
314 + + netdataDashboard.sparkline('<br/>An important metric worth monitoring, is <b>softirq</b> ', 'system.cpu', 'softirq', '%', '. A constantly high percentage of softirq may indicate network driver issues.');
315 + },
316 valueRange: "[0, 100]"
317 },
318
319 'system.load': {
316 - info: 'Current system load, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. Linux calculates this once every 5 seconds. Netdata reads them from <code>/proc/loadavg</code>. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',
320 + info: 'Current system load, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. The system calculates this once every 5 seconds. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',
321 height: 0.7
322 },
323
324 'system.io': {
321 - 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="#menu_disk">Disks</a> section and per application Disk usage at the <a href="#menu_apps">Applications Monitoring</a> section.'
325 + info: 'Total Disk I/O, for all disks. You can get detailed information about each disk at the <a href="#menu_disk">Disks</a> section and per application Disk usage at the <a href="#menu_apps">Applications Monitoring</a> section.'
326 },
327
328 'system.swapio': {
325 - 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).'
329 + info: 'Total Swap I/O. (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).'
330 },
331
332 'system.pgfaults': {
329 - 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="#menu_apps">Applications Monitoring</a> section.'
333 + info: 'Total page faults. <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="#menu_apps">Applications Monitoring</a> section.'
334 },
335
336 'system.entropy': {
337 colors: '#CC22AA',
334 - 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 (<a href="https://en.wikipedia.org/wiki//dev/random" target="_blank">/dev/random</a>) 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 <code>haveged</code> or <code>rng-tools</code> (i.e. <b>rngd</b>), to keep the pool in healthy levels.'
338 + info: '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, is like a pool of random numbers (<a href="https://en.wikipedia.org/wiki//dev/random" target="_blank">/dev/random</a>) 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 <code>haveged</code> or <code>rng-tools</code> (i.e. <b>rngd</b>), to keep the pool in healthy levels.'
339 },
340
341 'system.forks': {
342 colors: '#5555DD',
339 - info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
343 + info: 'Number of new processes created.'
344 },
345
346 'system.intr': {
347 colors: '#DD5555',
344 - 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="#menu_cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
348 + info: 'Total number of CPU interrupts. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#menu_cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
349 },
350
351 'system.interrupts': {
348 - info: 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#menu_cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
352 + info: 'CPU interrupts in detail. At the <a href="#menu_cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
353 },
354
355 'system.softirqs': {
352 - info: 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#menu_cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
356 + info: 'CPU softirqs in detail. At the <a href="#menu_cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
357 },
358
359 'system.processes': {
356 - info: 'System processes, read from <code>/proc/stat</code>. <b>Running</b> are the processes in the CPU. <b>Blocked</b> are processes that are willing to enter the CPU, but they cannot, e.g. because they wait for disk activity.'
360 + info: 'System processes. <b>Running</b> are the processes in the CPU. <b>Blocked</b> are processes that are willing to enter the CPU, but they cannot, e.g. because they wait for disk activity.'
361 },
362
363 'system.active_processes': {
360 - info: 'All system processes, read from <code>/proc/loadavg</code>.'
364 + info: 'All system processes.'
365 },
366
367 'system.ctxt': {
364 - 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.'
368 + info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, 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.'
369 },
370
371 'system.idlejitter': {
@@ -370,19 +374,19 @@ netdataDashboard.context = {
374 },
375
376 'system.ipv4': {
373 - info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'
377 + info: 'Total IPv4 Traffic.'
378 },
379
380 'system.ipv6': {
377 - info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'
381 + info: 'Total IPv6 Traffic.'
382 },
383
384 'system.ram': {
381 - info: 'System memory, read from <code>/proc/meminfo</code>.'
385 + info: 'System memory usage.'
386 },
387
388 'system.swap': {
385 - info: 'System swap memory, read from <code>/proc/meminfo</code>.'
389 + info: 'System swap memory usage.'
390 },
391
392 // ------------------------------------------------------------------------
@@ -413,24 +417,24 @@ netdataDashboard.context = {
417 },
418
419 'mem.pgfaults': {
416 - info: 'A <a href="https://en.wikipedia.org/wiki/Page_fault" target="_blank">page fault</a> is a type of interrupt, called trap, raised by computer hardware when a running program accesses a memory page that is mapped into the virtual address space, but not actually loaded into main memory. If the page is loaded in memory at the time the fault is generated, but is not marked in the memory management unit as being loaded in memory, then it is called a <b>minor</b> or soft page fault. A <b>major</b> page fault is generated when the system needs to load the memory page from disk or swap memory. These values are read from <code>/proc/vmstat</code>.'
420 + info: 'A <a href="https://en.wikipedia.org/wiki/Page_fault" target="_blank">page fault</a> is a type of interrupt, called trap, raised by computer hardware when a running program accesses a memory page that is mapped into the virtual address space, but not actually loaded into main memory. If the page is loaded in memory at the time the fault is generated, but is not marked in the memory management unit as being loaded in memory, then it is called a <b>minor</b> or soft page fault. A <b>major</b> page fault is generated when the system needs to load the memory page from disk or swap memory.'
421 },
422
423 'mem.committed': {
424 colors: NETDATA.colors[3],
421 - info: 'Committed Memory, read from <code>/proc/meminfo</code>, is the sum of all memory which has been allocated by processes.'
425 + info: 'Committed Memory, is the sum of all memory which has been allocated by processes.'
426 },
427
428 'mem.writeback': {
425 - info: 'Read from <code>/proc/meminfo</code>, <b>Dirty</b> is the amount of memory waiting to be written to disk. <b>Writeback</b> is how much memory is actively being written to disk.'
429 + info: '<b>Dirty</b> is the amount of memory waiting to be written to disk. <b>Writeback</b> is how much memory is actively being written to disk.'
430 },
431
432 'mem.kernel': {
429 - info: 'Read from <code>/proc/meminfo</code>, This chart displays the total ammount of memory being used by the kernel. <b>Slab</b> is the amount of memory used by the kernel to cache data structures for its own use. <b>KernelStack</b> is the amount of memory allocated for each task done by the kernel. <b>PageTables</b> is the amount of memory decicated to the lowest level of page tables (A page table is used to turn a virtual address into a physical memory address). <b>VmallocUsed</b> is the amount of memory being used as virtual address space.'
433 + info: 'The total ammount of memory being used by the kernel. <b>Slab</b> is the amount of memory used by the kernel to cache data structures for its own use. <b>KernelStack</b> is the amount of memory allocated for each task done by the kernel. <b>PageTables</b> is the amount of memory decicated to the lowest level of page tables (A page table is used to turn a virtual address into a physical memory address). <b>VmallocUsed</b> is the amount of memory being used as virtual address space.'
434 },
435
436 'mem.slab': {
433 - info: 'Read from <code>/proc/meminfo</code>, <b>reclaimable</b> is the amount of memory which the kernel can reuse. <b>unreclaimable</b> can not be reused even when the kernel is lacking memory.'
437 + info: '<b>Reclaimable</b> is the amount of memory which the kernel can reuse. <b>Unreclaimable</b> can not be reused even when the kernel is lacking memory.'
438 },
439
440 // ------------------------------------------------------------------------
@@ -568,12 +572,12 @@ netdataDashboard.context = {
572 heads: [
573 netdataDashboard.gaugeChart('Utilization', '12%', '', '#FF5588')
574 ],
571 - info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the Linux kernel always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'
575 + info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the system always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'
576 },
577
578 'disk.backlog': {
579 colors: '#0099CC',
576 - info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the Linux kernel is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'
580 + info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the system is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'
581 },
582
583 'disk.io': {
@@ -585,7 +589,7 @@ netdataDashboard.context = {
589 },
590
591 'disk.ops': {
588 - info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the Linux kernel is able to merge adjacent to each other (see merged operations chart).'
592 + info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the system is able to merge adjacent to each other (see merged operations chart).'
593 },
594
595 'disk.qops': {
@@ -598,7 +602,7 @@ netdataDashboard.context = {
602 },
603 'disk.mops': {
604 height: 0.5,
601 - info: 'The number of merged disk operations. The Linux kernel is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
605 + info: 'The number of merged disk operations. The system is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
606 },
607 'disk.svctm': {
608 height: 0.5,
web/index.html
+175 -110
@@ -537,9 +537,7 @@
537 if(localStorageTest() === true)
538 ret = localStorage.getItem(name);
539 }
540 - catch(error) {
541 - ;
542 - }
540 + catch(error) {}
541
542 if(typeof ret === 'undefined' || ret === null)
543 return null;
@@ -557,9 +555,7 @@
555 return true;
556 }
557 }
560 - catch(error) {
561 - ;
562 - }
558 + catch(error) {}
559
560 return false;
561 }
@@ -685,10 +681,7 @@
681 this_is_demo = true;
682 }
683 }
688 - catch(error) {
689 - ;
690 - }
691 -
684 + catch(error) {}
685 return this_is_demo;
686 }
687
@@ -707,9 +700,7 @@
700 }
701
702 function netdataReload(url) {
710 - var t = netdataURL(url);
711 - // console.log('netdataReload: ' + t);
712 - document.location = t;
703 + document.location = netdataURL(url);
704
705 // since we play with hash
706 // this is needed to reload the page
@@ -852,6 +843,8 @@
843
844 var deleteRegistryUrl = null;
845 function deleteRegistryModalHandler(guid, name, url) {
846 + void(guid);
847 +
848 deleteRegistryUrl = url;
849 document.getElementById('deleteRegistryServerName').innerHTML = name;
850 document.getElementById('deleteRegistryServerName2').innerHTML = name;
@@ -876,45 +869,23 @@
869 }
870
871 var options = {
879 - sparklines_registry: {},
872 menus: {},
873 submenu_names: {},
874 data: null,
875 hostname: 'netdata_server', // will be overwritten by the netdata server
884 - categories: new Array(),
876 + categories: [],
877 categories_idx: {},
886 - families: new Array(),
878 + families: [],
879 families_idx: {},
880
881 chartsPerRow: 0,
882 chartsMinWidth: 1450,
891 - chartsHeight: 180,
892 - sparklinesHeight: 60,
883 + chartsHeight: 180
884 };
885
895 - // generate a sparkline
896 - // used in the documentation
897 - function sparkline(chart, dimension, units) {
898 - var key = chart + '.' + dimension;
899 -
900 - if(typeof units === 'undefined')
901 - units = '';
902 -
903 - if(typeof options.sparklines_registry[key] === 'undefined')
904 - options.sparklines_registry[key] = { count: 1 };
905 - else
906 - options.sparklines_registry[key].count++;
907 -
908 - key = key + '.' + options.sparklines_registry[key].count;
909 -
910 - var h = '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')';
911 -
912 - return h;
913 - }
914 -
886 function chartsPerRow(total) {
887 if(options.chartsPerRow === 0) {
917 - width = Math.floor(total / options.chartsMinWidth);
888 + var width = Math.floor(total / options.chartsMinWidth);
889 if(width === 0) width = 1;
890 return width;
891 }
@@ -930,9 +901,11 @@
901
902 function sortObjectByPriority(object) {
903 var idx = {};
933 - var sorted = new Array();
904 + var sorted = [];
905
906 for(var i in object) {
907 + if(!object.hasOwnProperty(i)) continue;
908 +
909 if(typeof idx[i] === 'undefined') {
910 idx[i] = object[i];
911 sorted.push(i);
@@ -967,10 +940,42 @@
940 // ----------------------------------------------------------------------------
941
942 var netdataDashboard = {
943 + sparklines_registry: {},
944 +
945 menu: {},
946 submenu: {},
947 context: {},
948
949 + // generate a sparkline
950 + // used in the documentation
951 + sparkline: function (prefix, chart, dimension, units, suffix) {
952 + if(options.data === null || typeof options.data.charts === 'undefined')
953 + return '';
954 +
955 + if(typeof options.data.charts[chart] === 'undefined')
956 + return '';
957 +
958 + if(typeof options.data.charts[chart].dimensions === 'undefined')
959 + return '';
960 +
961 + if(typeof options.data.charts[chart].dimensions[dimension] === 'undefined')
962 + return '';
963 +
964 + var key = chart + '.' + dimension;
965 +
966 + if(typeof units === 'undefined')
967 + units = '';
968 +
969 + if(typeof this.sparklines_registry[key] === 'undefined')
970 + this.sparklines_registry[key] = { count: 1 };
971 + else
972 + this.sparklines_registry[key].count++;
973 +
974 + key = key + '.' + this.sparklines_registry[key].count;
975 +
976 + return prefix + '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')' + suffix;
977 + },
978 +
979 gaugeChart: function(title, width, dimensions, colors) {
980 if(typeof colors === 'undefined')
981 colors = '';
@@ -979,53 +984,67 @@
984 dimensions = '';
985
986 return '<div data-netdata="CHART_UNIQUE_ID"'
982 - + ' data-dimensions="' + dimensions + '"'
983 - + ' data-chart-library="gauge"'
984 - + ' data-gauge-adjust="width"'
985 - + ' data-title="' + title + '"'
986 - + ' data-width="' + width + '"'
987 - + ' data-before="0"'
988 - + ' data-after="-CHART_DURATION"'
989 - + ' data-points="CHART_DURATION"'
990 - + ' data-colors="' + colors + '"'
991 - + ' role="application"></div>';
987 + + ' data-dimensions="' + dimensions + '"'
988 + + ' data-chart-library="gauge"'
989 + + ' data-gauge-adjust="width"'
990 + + ' data-title="' + title + '"'
991 + + ' data-width="' + width + '"'
992 + + ' data-before="0"'
993 + + ' data-after="-CHART_DURATION"'
994 + + ' data-points="CHART_DURATION"'
995 + + ' data-colors="' + colors + '"'
996 + + ' role="application"></div>';
997 },
998
999 anyAttribute: function(obj, attr, key, def) {
995 - if(typeof obj[key] !== 'undefined') {
996 - if(typeof obj[key][attr] !== 'undefined')
997 - return obj[key][attr];
1000 + if(typeof(obj[key]) !== 'undefined') {
1001 + var x = obj[key][attr];
1002 +
1003 + if(typeof(x) === 'undefined')
1004 + return def;
1005 +
1006 + if(typeof(x) === 'function')
1007 + return x();
1008 +
1009 + return x;
1010 }
1011 +
1012 return def;
1013 },
1014
1015 menuTitle: function(chart) {
1016 if(typeof chart.menu_pattern !== 'undefined') {
1004 - return (netdataDashboard.anyAttribute(netdataDashboard.menu, 'title', chart.menu_pattern, chart.menu_pattern).toString()
1017 + return (this.anyAttribute(this.menu, 'title', chart.menu_pattern, chart.menu_pattern).toString()
1018 + '&nbsp;' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString()).replace(/_/g, ' ');
1019 }
1020
1008 - return (netdataDashboard.anyAttribute(netdataDashboard.menu, 'title', chart.menu, chart.menu)).toString().replace(/_/g, ' ');
1021 + return (this.anyAttribute(this.menu, 'title', chart.menu, chart.menu)).toString().replace(/_/g, ' ');
1022 },
1023
1024 menuIcon: function(chart) {
1025 if(typeof chart.menu_pattern !== 'undefined')
1013 - return netdataDashboard.anyAttribute(netdataDashboard.menu, 'icon', chart.menu_pattern, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>').toString();
1026 + return this.anyAttribute(this.menu, 'icon', chart.menu_pattern, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>').toString();
1027
1015 - return netdataDashboard.anyAttribute(netdataDashboard.menu, 'icon', chart.menu, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>');
1028 + return this.anyAttribute(this.menu, 'icon', chart.menu, '<i class="fa fa-puzzle-piece" aria-hidden="true"></i>');
1029 },
1030
1018 - menuInfo: function(menu) {
1019 - return netdataDashboard.anyAttribute(netdataDashboard.menu, 'info', menu, null);
1031 + menuInfo: function(chart) {
1032 + if(typeof chart.menu_pattern !== 'undefined')
1033 + return this.anyAttribute(this.menu, 'info', chart.menu_pattern, null);
1034 +
1035 + return this.anyAttribute(this.menu, 'info', chart.menu, null);
1036 },
1037
1022 - menuHeight: function(menu, relative) {
1023 - return netdataDashboard.anyAttribute(netdataDashboard.menu, 'height', menu, 1.0) * relative;
1038 + menuHeight: function(chart) {
1039 + if(typeof chart.menu_pattern !== 'undefined')
1040 + return this.anyAttribute(this.menu, 'height', chart.menu_pattern, 1.0);
1041 +
1042 + return this.anyAttribute(this.menu, 'height', chart.menu, 1.0);
1043 },
1044
1045 submenuTitle: function(menu, submenu) {
1046 var key = menu + '.' + submenu;
1028 - var title = netdataDashboard.anyAttribute(netdataDashboard.submenu, 'title', key, submenu).toString().replace(/_/g, ' ');;
1047 + var title = this.anyAttribute(this.submenu, 'title', key, submenu).toString().replace(/_/g, ' ');
1048 if(title.length > 28) {
1049 var a = title.substring(0, 13);
1050 var b = title.substring(title.length - 12, title.length);
@@ -1036,31 +1055,33 @@
1055
1056 submenuInfo: function(menu, submenu) {
1057 var key = menu + '.' + submenu;
1039 - return netdataDashboard.anyAttribute(netdataDashboard.submenu, 'info', key, null);
1058 + return this.anyAttribute(this.submenu, 'info', key, null);
1059 },
1060
1061 submenuHeight: function(menu, submenu, relative) {
1062 var key = menu + '.' + submenu;
1044 - return netdataDashboard.anyAttribute(netdataDashboard.submenu, 'height', key, 1.0) * relative;
1063 + return this.anyAttribute(this.submenu, 'height', key, 1.0) * relative;
1064 },
1065
1066 contextInfo: function(id) {
1048 - if(typeof netdataDashboard.context[id] !== 'undefined' && typeof netdataDashboard.context[id].info !== 'undefined')
1049 - return '<div class="chart-message netdata-chart-alignment" role="document">' + netdataDashboard.context[id].info + '</div>';
1067 + var x = this.anyAttribute(this.context, 'info', id, null);
1068 +
1069 + if(x !== null)
1070 + return '<div class="chart-message netdata-chart-alignment" role="document">' + x + '</div>';
1071 else
1072 return '';
1073 },
1074
1075 contextValueRange: function(id) {
1055 - if(typeof netdataDashboard.context[id] !== 'undefined' && typeof netdataDashboard.context[id].valueRange !== 'undefined')
1056 - return netdataDashboard.context[id].valueRange;
1076 + if(typeof this.context[id] !== 'undefined' && typeof this.context[id].valueRange !== 'undefined')
1077 + return this.context[id].valueRange;
1078 else
1079 return '[null, null]';
1080 },
1081
1082 contextHeight: function(id, def) {
1062 - if(typeof netdataDashboard.context[id] !== 'undefined' && typeof netdataDashboard.context[id].height !== 'undefined')
1063 - return def * netdataDashboard.context[id].height;
1083 + if(typeof this.context[id] !== 'undefined' && typeof this.context[id].height !== 'undefined')
1084 + return def * this.context[id].height;
1085 else
1086 return def;
1087 }
@@ -1374,6 +1395,8 @@
1395 var charts = data.charts;
1396
1397 for(var c in charts) {
1398 + if(!charts.hasOwnProperty(c)) continue;
1399 +
1400 enrichChartData(charts[c]);
1401
1402 // create the menu
@@ -1383,8 +1406,8 @@
1406 submenus: {},
1407 title: netdataDashboard.menuTitle(charts[c]),
1408 icon: netdataDashboard.menuIcon(charts[c]),
1386 - info: netdataDashboard.menuInfo(charts[c].menu),
1387 - height: netdataDashboard.menuHeight(charts[c].menu, options.chartsHeight)
1409 + info: netdataDashboard.menuInfo(charts[c]),
1410 + height: netdataDashboard.menuHeight(charts[c]) * options.chartsHeight
1411 };
1412 }
1413
@@ -1395,7 +1418,7 @@
1418 if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
1419 menus[charts[c].menu].submenus[charts[c].submenu] = {
1420 priority: charts[c].priority,
1398 - charts: new Array(),
1421 + charts: [],
1422 title: null,
1423 info: netdataDashboard.submenuInfo(charts[c].menu, charts[c].submenu),
1424 height: netdataDashboard.submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
@@ -1412,7 +1435,11 @@
1435 // propagate the descriptive subname given to QoS
1436 // to all the other submenus with the same name
1437 for(var m in menus) {
1438 + if(!menus.hasOwnProperty(m)) continue;
1439 +
1440 for(var s in menus[m].submenus) {
1441 + if(!menus[m].submenus.hasOwnProperty(s)) continue;
1442 +
1443 // set the family using a name
1444 if(typeof options.submenu_names[s] !== 'undefined') {
1445 menus[m].submenus[s].title = s + ' (' + options.submenu_names[s] + ')';
@@ -1447,7 +1474,7 @@
1474 var bootstrapTableLoaded = false;
1475 function loadBootstrapTable(callback) {
1476 if(bootstrapTableLoaded === false) {
1450 - bootstrapTableLoaded === true;
1477 + bootstrapTableLoaded = true;
1478 loadJs(NETDATA.serverDefault + 'lib/bootstrap-table-1.11.0.min.js', function() {
1479 loadJs(NETDATA.serverDefault + 'lib/bootstrap-table-export-1.11.0.min.js', function() {
1480 loadJs(NETDATA.serverDefault + 'lib/tableExport-1.6.0.min.js', callback);
@@ -1463,7 +1490,7 @@
1490 var footer = '<hr/><a href="https://github.com/firehol/netdata/wiki/Generating-Badges" target="_blank">netdata badges</a> refresh automatically. Their color indicates the state of the alarm: <span style="color: #e05d44"><b>&nbsp;red&nbsp;</b></span> is critical, <span style="color:#fe7d37"><b>&nbsp;orange&nbsp;</b></span> is warning, <span style="color: #4c1"><b>&nbsp;bright green&nbsp;</b></span> is ok, <span style="color: #9f9f9f"><b>&nbsp;light grey&nbsp;</b></span> is undefined (i.e. no data or no status), <span style="color: #000"><b>&nbsp;black&nbsp;</b></span> is not initialized. You can copy and paste their URLs to embed them in any web page.<br/>netdata can send notifications for these alarms. Check <a href="https://github.com/firehol/netdata/blob/master/conf.d/health_alarm_notify.conf">this configuration file</a> for more information.';
1491
1492 NETDATA.alarms.get('all', function(data) {
1466 - options.alarm_families = new Array();
1493 + options.alarm_families = [];
1494
1495 alarmsCallback(data);
1496
@@ -1593,7 +1620,7 @@
1620 return '';
1621 }
1622
1596 - var has_alarm = ((typeof alarm.warn !== 'undefined' || typeof alarm.crit !== 'undefined')?true:false);
1623 + var has_alarm = (typeof alarm.warn !== 'undefined' || typeof alarm.crit !== 'undefined');
1624
1625 var role_href = ((has_alarm === true)?('<br/>&nbsp;<br/>role: <b>' + alarm.recipient + '</b><br/>&nbsp;<br/><b><i class="fa fa-line-chart" aria-hidden="true"></i></b><small>&nbsp;&nbsp;<a href="#" onClick="NETDATA.alarms.scrollToChart(\'' + alarm.chart + '\'); $(\'#alarmsModal\').modal(\'hide\'); return false;">jump to chart</a></small>'):('&nbsp;'));
1626
@@ -1656,14 +1683,16 @@
1683
1684 // find the proper family of each alarm
1685 var now = Date.now();
1659 - var x;
1686 + var x, family, alarm;
1687 var count_active = 0;
1688 var count_all = 0;
1689 var families = {};
1663 - var families_sort = new Array();
1690 + var families_sort = [];
1691 for(x in data.alarms) {
1665 - var alarm = data.alarms[x];
1666 - var family = alarm.family;
1692 + if(!data.alarms.hasOwnProperty(x)) continue;
1693 +
1694 + alarm = data.alarms[x];
1695 + family = alarm.family;
1696
1697 // find the chart
1698 var chart = options.data.charts[alarm.chart];
@@ -1682,7 +1711,7 @@
1711 if(typeof families[family] === 'undefined') {
1712 families[family] = {
1713 name: family,
1685 - arr: new Array(),
1714 + arr: [],
1715 priority: chart.priority
1716 };
1717
@@ -1705,7 +1734,7 @@
1734 var fc = 0;
1735 var len = families_sorted.length;
1736 while(len--) {
1708 - var family = families_sorted[len].name;
1737 + family = families_sorted[len].name;
1738 var active_family_added = false;
1739 var expanded = 'true';
1740 var collapsed = '';
@@ -1714,7 +1743,7 @@
1743 if(fc !== 0) {
1744 all += "</table></div></div></div>";
1745 expanded = 'false';
1717 - collapsed = 'class="collapsed"'
1746 + collapsed = 'class="collapsed"';
1747 cin = '';
1748 }
1749
@@ -1727,7 +1756,7 @@
1756 var arr = families[family].arr;
1757 var c = arr.length;
1758 while(c--) {
1730 - var alarm = arr[c];
1759 + alarm = arr[c];
1760 if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL') {
1761 if(!active_family_added) {
1762 active_family_added = true;
@@ -1760,12 +1789,13 @@
1789 if(families_sorted.length > 0) alarm_family_show(0);
1790
1791 // register bootstrap events
1763 - $('#alarms_all_accordion').on('show.bs.collapse', function (d) {
1792 + var $accordion = $('#alarms_all_accordion');
1793 + $accordion.on('show.bs.collapse', function (d) {
1794 var target = $(d.target);
1795 var id = $(target).data('alarm-id');
1796 alarm_family_show(id);
1797 });
1768 - $('#alarms_all_accordion').on('hidden.bs.collapse', function (d) {
1798 + $accordion.on('hidden.bs.collapse', function (d) {
1799 var target = $(d.target);
1800 var id = $(target).data('alarm-id');
1801 $('#alarm_all_' + id.toString()).html('');
@@ -1790,6 +1820,8 @@
1820 fileName: 'netdata_alarm_log'
1821 },
1822 rowStyle: function(row, index) {
1823 + void(index);
1824 +
1825 switch(row.status) {
1826 case 'CRITICAL' : return { classes: 'danger' }; break;
1827 case 'WARNING' : return { classes: 'warning' }; break;
@@ -1810,9 +1842,8 @@
1842 title: 'Event Date',
1843 valign: 'middle',
1844 titleTooltip: 'The date and time the even took place',
1813 - formatter: function(value, row, index) { return timestamp4human(value, ' '); },
1845 + formatter: function(value, row, index) { void(row); void(index); return timestamp4human(value, ' '); },
1846 align: 'center',
1815 - valign: 'middle',
1847 switchable: false,
1848 sortable: true
1849 },
@@ -1822,7 +1853,6 @@
1853 valign: 'middle',
1854 titleTooltip: 'The host that generated this event',
1855 align: 'center',
1825 - valign: 'middle',
1856 visible: false,
1857 sortable: true
1858 },
@@ -1830,7 +1860,7 @@
1860 field: 'unique_id',
1861 title: 'Unique ID',
1862 titleTooltip: 'The host unique ID for this event',
1833 - formatter: function(value, row, index) { return alarmid4human(value); },
1863 + formatter: function(value, row, index) { void(row); void(index); return alarmid4human(value); },
1864 align: 'center',
1865 valign: 'middle',
1866 visible: false,
@@ -1840,7 +1870,7 @@
1870 field: 'alarm_id',
1871 title: 'Alarm ID',
1872 titleTooltip: 'The ID of the alarm that generated this event',
1843 - formatter: function(value, row, index) { return alarmid4human(value); },
1873 + formatter: function(value, row, index) { void(row); void(index); return alarmid4human(value); },
1874 align: 'center',
1875 valign: 'middle',
1876 visible: false,
@@ -1850,7 +1880,7 @@
1880 field: 'alarm_event_id',
1881 title: 'Alarm Event ID',
1882 titleTooltip: 'The incremental ID of this event for the given alarm',
1853 - formatter: function(value, row, index) { return alarmid4human(value); },
1883 + formatter: function(value, row, index) { void(row); void(index); return alarmid4human(value); },
1884 align: 'center',
1885 valign: 'middle',
1886 visible: false,
@@ -1879,6 +1909,8 @@
1909 title: 'Alarm',
1910 titleTooltip: 'The alarm name that generated this event',
1911 formatter: function(value, row, index) {
1912 + void(row);
1913 + void(index);
1914 return value.toString().replace(/_/g, ' ');
1915 },
1916 align: 'center',
@@ -1908,6 +1940,8 @@
1940 title: 'Old Value',
1941 titleTooltip: 'The value of the alarm, just before this event',
1942 formatter: function(value, row, index) {
1943 + void(row);
1944 + void(index);
1945 return ((value !== null)?Math.round(value * 100) / 100:'NaN').toString();
1946 },
1947 align: 'center',
@@ -1920,6 +1954,8 @@
1954 title: 'Value',
1955 titleTooltip: 'The value of the alarm, that triggered this event',
1956 formatter: function(value, row, index) {
1957 + void(row);
1958 + void(index);
1959 return ((value !== null)?Math.round(value * 100) / 100:'NaN').toString();
1960 },
1961 align: 'right',
@@ -1958,7 +1994,11 @@
1994 field: 'duration',
1995 title: 'Last Duration',
1996 titleTooltip: 'The duration the alarm was at its previous state, just before this event',
1961 - formatter: function(value, row, index) { return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' }); },
1997 + formatter: function(value, row, index) {
1998 + void(row);
1999 + void(index);
2000 + return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' });
2001 + },
2002 align: 'center',
2003 valign: 'middle',
2004 visible: false,
@@ -1968,7 +2008,11 @@
2008 field: 'non_clear_duration',
2009 title: 'Raised Duration',
2010 titleTooltip: 'The duration the alarm was raised, just before this event',
1971 - formatter: function(value, row, index) { return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' }); },
2011 + formatter: function(value, row, index) {
2012 + void(row);
2013 + void(index);
2014 + return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' });
2015 + },
2016 align: 'center',
2017 valign: 'middle',
2018 visible: false,
@@ -1988,6 +2032,9 @@
2032 title: 'Processed Status',
2033 titleTooltip: 'True when this event is processed',
2034 formatter: function(value, row, index) {
2035 + void(row);
2036 + void(index);
2037 +
2038 if(value === true)
2039 return 'DONE';
2040 else
@@ -2003,6 +2050,9 @@
2050 title: 'Updated Status',
2051 titleTooltip: 'True when this event has been updated by another event',
2052 formatter: function(value, row, index) {
2053 + void(row);
2054 + void(index);
2055 +
2056 if(value === true)
2057 return 'UPDATED';
2058 else
@@ -2017,7 +2067,7 @@
2067 field: 'updated_by_id',
2068 title: 'Updated By ID',
2069 titleTooltip: 'The unique ID of the event that obsoleted this one',
2020 - formatter: function(value, row, index) { return alarmid4human(value); },
2070 + formatter: function(value, row, index) { void(row); void(index); return alarmid4human(value); },
2071 align: 'center',
2072 valign: 'middle',
2073 visible: false,
@@ -2027,7 +2077,7 @@
2077 field: 'updates_id',
2078 title: 'Updates ID',
2079 titleTooltip: 'The unique ID of the event obsoleted because of this event',
2030 - formatter: function(value, row, index) { return alarmid4human(value); },
2080 + formatter: function(value, row, index) { void(row); void(index); return alarmid4human(value); },
2081 align: 'center',
2082 valign: 'middle',
2083 visible: false,
@@ -2046,7 +2096,7 @@
2096 field: 'exec_run',
2097 title: 'Script Run At',
2098 titleTooltip: 'The date and time the script has been ran',
2049 - formatter: function(value, row, index) { return timestamp4human(value, ' '); },
2099 + formatter: function(value, row, index) { void(row); void(index); return timestamp4human(value, ' '); },
2100 align: 'center',
2101 valign: 'middle',
2102 visible: false,
@@ -2057,6 +2107,9 @@
2107 title: 'Script Return Value',
2108 titleTooltip: 'The return code of the script',
2109 formatter: function(value, row, index) {
2110 + void(row);
2111 + void(index);
2112 +
2113 if(value === 0)
2114 return 'OK (returned 0)';
2115 else
@@ -2071,7 +2124,12 @@
2124 field: 'delay',
2125 title: 'Script Delay',
2126 titleTooltip: 'The hysteresis of the notification',
2074 - formatter: function(value, row, index) { return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' }); },
2127 + formatter: function(value, row, index) {
2128 + void(row);
2129 + void(index);
2130 +
2131 + return seconds4human(value, { negative_suffix: '', space: ' ', now: 'no time' });
2132 + },
2133 align: 'center',
2134 valign: 'middle',
2135 visible: false,
@@ -2081,7 +2139,7 @@
2139 field: 'delay_up_to_timestamp',
2140 title: 'Script Delay Run At',
2141 titleTooltip: 'The date and time the script should be run, after hysteresis',
2084 - formatter: function(value, row, index) { return timestamp4human(value, ' '); },
2142 + formatter: function(value, row, index) { void(row); void(index); return timestamp4human(value, ' '); },
2143 align: 'center',
2144 valign: 'middle',
2145 visible: false,
@@ -2115,6 +2173,8 @@
2173 function alarmsCallback(data) {
2174 var count = 0;
2175 for(x in data.alarms) {
2176 + if(!data.alarms.hasOwnProperty(x)) continue;
2177 +
2178 var alarm = data.alarms[x];
2179 if(alarm.status === 'WARNING' || alarm.status === 'CRITICAL')
2180 count++;
@@ -2159,6 +2219,8 @@
2219 var charts = data.charts;
2220 var x;
2221 for(x in charts) {
2222 + if(!charts.hasOwnProperty(x)) continue;
2223 +
2224 var chart = charts[x];
2225 data.charts_by_name[chart.name] = chart;
2226 }
@@ -2398,7 +2460,7 @@
2460 {
2461 //console.log('They were open tags');
2462 //console.log(openTags);
2401 - for (j = 0; j < openTags.length; j++) {
2463 + for (var j = 0; j < openTags.length; j++) {
2464 //console.log('Cierro tag ' + openTags[j]);
2465 bag += '</' + openTags[j] + '>'; // Close all tags that were opened
2466
@@ -2444,8 +2506,9 @@
2506 //console.log('hash = ' + urlOptions.hash);
2507 }
2508
2509 + var $sidebar = $('#sidebar');
2510 /* activate bootstrap sidebar (affix) */
2448 - $('#sidebar').affix({
2511 + $sidebar.affix({
2512 offset: {
2513 top: (isdemo())?150:0,
2514 bottom: 0
@@ -2455,7 +2518,7 @@
2518 /* fix scrolling of very long affix lists
2519 http://stackoverflow.com/questions/21691585/bootstrap-3-1-0-affix-too-long
2520 */
2458 - $('#sidebar').on('affixed.bs.affix', function() {
2521 + $sidebar.on('affixed.bs.affix', function() {
2522 $(this).removeAttr('style');
2523 });
2524
@@ -2466,7 +2529,7 @@
2529 });
2530
2531 // change the URL based on the current position of the screen
2469 - $('#sidebar').on('activate.bs.scrollspy', function (e) {
2532 + $sidebar.on('activate.bs.scrollspy', function (e) {
2533 // console.log(e);
2534 var el = $(e.target);
2535 //if(el.find('ul').size() == 0) {
@@ -2493,13 +2556,13 @@
2556 // console.log('switching ' + option.toString());
2557 self.bootstrapToggle(NETDATA.getOption(option)?'on':'off');
2558 }
2496 - }
2559 + };
2560
2561 var theme_sync_option = function(option) {
2562 var self = $('#' + option);
2563
2564 self.bootstrapToggle(netdataTheme === 'slate'?'on':'off');
2502 - }
2565 + };
2566
2567 sync_option('eliminate_zero_dimensions');
2568 sync_option('destroy_on_hide');
@@ -2557,19 +2620,21 @@
2620 netdataReload();
2621 });
2622
2560 - $('#updateModal').on('show.bs.modal', function() {
2623 + var $updateModal = $('#updateModal');
2624 + $updateModal.on('show.bs.modal', function() {
2625 versionLog('checking, please wait...');
2626 });
2627
2564 - $('#updateModal').on('shown.bs.modal', function() {
2628 + $updateModal.on('shown.bs.modal', function() {
2629 notifyForUpdate(true);
2630 });
2631
2568 - $('#alarmsModal').on('shown.bs.modal', function() {
2632 + var $alarmsModal = $('#alarmsModal');
2633 + $alarmsModal.on('shown.bs.modal', function() {
2634 NETDATA.pause(alarmsUpdateModal);
2635 });
2636
2572 - $('#alarmsModal').on('hidden.bs.modal', function() {
2637 + $alarmsModal.on('hidden.bs.modal', function() {
2638 NETDATA.unpause();
2639 document.getElementById('alarms_active').innerHTML =
2640 document.getElementById('alarms_all').innerHTML =
@@ -2685,7 +2750,7 @@
2750 });
2751
2752 NETDATA.requiredJs.push({
2688 - url: NETDATA.serverDefault + 'dashboard_info.js?v20170115-1',
2753 + url: NETDATA.serverDefault + 'dashboard_info.js?v20170207-12',
2754 async: false,
2755 isAlreadyLoaded: function() { return false; }
2756 });