]> arthur.barton.de Git - netdata.git/blob - README.md
build: fix typo
[netdata.git] / README.md
1 netdata
2 =======
3
4 ### Linux real time system monitoring, over the web!
5
6 **Netdata** is a daemon that collects system information from a linux system and presents a web site to view the data.
7 The presentation is full of charts that precisely render all system values, in realtime, for a short time (1 hour by default).
8
9 You can use it to monitor all your servers, linux PCs or linux embedded devices, without the need to ssh to them.
10 Also, you can view a short history of all collected values, so if something happens you can use **netdata** to find out what and when.
11
12 Check it live at:
13
14  - [My Home Gentoo Box](http://195.97.5.206:19999/)
15  - [My Home Raspberry Pi B+](http://195.97.5.204:19999/) with data collection every 5s (raspbian playing movies 24x7)
16  - [My Home Raspberry Pi 2](http://195.97.5.205:19999/) (osmc as an access point)
17
18 Here is a screenshot:
19
20 ![image](https://cloud.githubusercontent.com/assets/2662304/10440038/b40bcb6c-7146-11e5-93ac-db2e177e39f8.png)
21
22
23 # Features
24
25 - **highly optimized C code**
26
27   It only needs a few milliseconds per second to collect all the data.
28   It will nicelly run even on a raspberry pi with just one cpu core, or any other embedded system.
29
30 - **extremely lightweight**
31
32   It only needs a few megabytes of memory to store all its round robin database.
33   
34   Although `netdata` does all its calculation using `long double` (128 bit) arithmetics, it stores all values using a **custom-made 32-bit number**. This custom-made number can store in 29 bits values from -167772150000000.0 to  167772150000000.0 with a precision of 0.00001 (yes, it is a floating point number, meaning that higher integer values have less decimal precision) and 3 bits for flags (2 are currently used and 1 is reserved for future use). This provides an extremely optimized memory footprint with just 0.0001% max accuracy loss (run: `./netdata --unittest` to see it in action).
35
36 - **per second data collection**
37
38   Every chart, every value, is updated every second. Of course, you can control collection period per module.
39
40   **netdata** can perform several calculations on each value (dimension) collected:
41
42   - **absolute**, stores the collected value, as collected (this is used, for example for the number of processes running, the number of connections open, the amount of RAM used, etc)
43
44   - **incremental**, stores the difference of the collected value to the last collected value (this is used, for example, for the bandwidth of interfaces, disk I/O, i.e. for counters that always get incremented) - **netdata** automatically interpolates these values to second boundary, using nanosecond calculations so that small delays at the data collection layer will not affect the quality of the result - also, **netdata** detects arithmetic overflows and presents them properly at the charts.
45
46   - **percentage of absolute row**, stores the percentage of the collected value, over the sum of all dimensions of the chart.
47
48   - **percentage of incremental row**, stores the percentage of this collected value, over the sum of the the **incremental** differences of all dimensions of the chart (this is used, for example, for system CPU utilization).
49
50 - **visualizes QoS classes automatically**
51
52   If you also use FireQOS for QoS, it collects class names automatically.
53
54 - **appealing web site**
55
56   The web site uses bootstrap and google charts for a very appealing result.
57   It works even on mobile devices and adapts to screen size changes and rotation (responsive design).
58
59 - **web charts do respect your browser resources**
60
61   The charts adapt to show only as many points are required to have a clear view.
62   Also, the javascript code respects your browser resources (stops refreshing when the window looses focus, when scrolling, etc).
63
64 - **highly configurable**
65
66   All charts and all features can be enabled or disabled.
67   The program generates its configuration file based on the resources available on the system it runs, for you to edit.
68
69 - It reads and renders charts for all these:
70  - `/proc/net/dev` (all netwrok interfaces for all their values)
71  - `/proc/diskstats` (all disks for all their values)
72  - `/proc/net/snmp` (total IPv4, TCP and UDP usage)
73  - `/proc/net/netstat` (more IPv4 usage)
74  - `/proc/net/stat/nf_conntrack` (connection tracking performance)
75  - `/proc/net/ip_vs/stats` (IPVS connection statistics)
76  - `/proc/stat` (CPU utilization)
77  - `/proc/meminfo` (memory information)
78  - `/proc/vmstat` (system performance)
79  - `/proc/net/rpc/nfsd` (NFS server statistics for both v3 and v4 NFS)
80  - `tc` classes (QoS classes)
81
82 - It supports **plugins** for collecting information from other sources!
83
84   Plugins can be written in any computer language (pipe / stdout communication for data collection).
85
86   It ships with 2 plugins: `apps.plugin` and `charts.d.plugin`:
87
88  - `apps.plugin` is a plugin that attempts to collect statistics per process. It groups the entire process tree based on your settings (for example, mplayer, kodi, vlc are all considered `media`) and for each group it attempts to find CPU usage, memory usages, physical and logical disk read and writes, number of processes, number of threads, number of open files, number of open sockets, number of open pipes, minor and major page faults (major = swapping), etc. 15 stackable (per group) charts in total.
89
90  - `charts.d.plugin` provides a simple way to script data collection in BASH. It includes example plugins that collect values from:
91
92     - `nut` (UPS load, frequency, voltage, etc)
93     - `sensors` (temperature, voltage, current, power, humidity, fans rotation sensors)
94     - `cpufreq` (current CPU clock frequency)
95     - `postfix` (e-mail queue size)
96     - `squid` (web proxy statistics)
97     - `mysql` (mysql global statistics)
98
99     Of course, you can write your own using BASH scripting.
100
101 - netdata is a web server, supporting gzip compression
102
103   It serves its own static files and dynamic files for rendering the site.
104   It does not support authentication or SSL - limit its access using your firewall.
105   It does not allow ` .. ` or ` / ` in the files requested (so it can only serve files stored in the `web/` directory).
106
107
108 # How it works
109
110 1. You run a daemon on your linux: netdata.
111  This deamon is written in C and is extremely lightweight.
112  
113  netdata:
114
115   - Spawns threads to collect all the data for all sources
116   - Keeps track of the collected values in memory (no disk I/O at all)
117   - Generates JSON and JSONP HTTP responses containing all the data needed for the web graphs
118   - Is a standalone web server.
119
120  For example, you can access JSON data by using:
121  
122  ```
123  http://127.0.0.1:19999/data/net.eth0
124  ```
125  
126  This will give you the JSON file for traffic on eth0.
127  The above is equivalent to:
128  
129  ```
130  http://127.0.0.1:19999/data/net.eth0/3600/1/average/0/0
131  ```
132  
133  where:
134
135   - 3600 is the number of entries to generate.
136   - 1 is grouping count, 1 = every single entry, 2 = half the entries, 3 = one every 3 entries, etc
137   - `average` is the grouping method. It can also be `max`.
138   - 0/0 they are `before` and `after` timestamps, allowing panning on the data
139
140
141 2. If you need to embed a **netdata** chart on your web page, you can add a few javascript lines and a `div` for every graph you need. Check [this example](http://195.97.5.206:19999/datasource.html) (open it in a new tab and view its source to get the idea).
142
143 3. Graphs are generated using Google Charts API (so, your client needs to have internet access).
144
145
146 # Installation
147
148 ## Automatic installation
149
150 Before you start, make sure you have `zlib` development files installed.
151 To install it in Ubuntu, you need to run:
152
153 ```sh
154 apt-get install zlib1g-dev
155 ```
156
157 Then do this to install and run netdata:
158
159 ```sh
160 git clone https://github.com/ktsaou/netdata.git netdata.git
161 cd netdata.git
162 ./netdata.start
163 ```
164
165 Once you run it, the file conf.d/netdata.conf will be created. You can edit this file to set options for each graph.
166 To apply the changes you made, you have to run netdata.start again.
167
168 If you run `netdata.start` as `root`, netdata will start by default as `nobody`. Otherwise it will run as the user that started it. If you run it as `root`, you can set the user you want it to run in the config file `conf.d/netdata.conf`.
169
170 To access the web site for all graphs, go to:
171
172  ```
173  http://127.0.0.1:19999/
174  ```
175
176 You can get the running config file at any time, by accessing `http://127.0.0.1:19999/netdata.conf`.
177
178 To start it at boot, just run `/path/to/netdata.git/netdata.start` from your `/etc/rc.local` or equivalent.
179
180 You can stop and start netdata at any point. Netdata saves on exit its round robbin database to `cache/` so that it will continue from where it stopped the last time.