@cryptotaxi247 / netdata-1 / commits / 01ac776ef

updated

Costa Tsaousis (ktsaou) committed Mar 23, 2014 at 04:18 UTC 01ac776ef4b446177dda2b7ff6ee3d3b5565d18c
1 file changed +46 -23
README.md
+46 -23
@@ -15,14 +15,34 @@ Example server with 20 interfaces:
15 # How it works
16
17 1. You run a daemon on your linux: netdata.
18 -This deamon is written in C and is extremely lightweight.
19 -What it does is that it reads /proc/net/dev and for every interface present there, it creates a JSON data file.
20 -This JSON file contains all the data needed for the web graphs.
21 -Since these files are created too often (e.g. once per second) it is adviced to put them on tmpfs.
22 -The files have a fixed length, around just 3k for 60 seconds of graphs.
18 + This deamon is written in C and is extremely lightweight.
19 +
20 + netdata:
21 +
22 + - reads /proc/net/dev and for every interface present there it keeps in its memory a short history of its received and sent bytes.
23 + - generates JSON HTTP responses containing all the data needed for the web graphs.
24 + - is a web server. You can access JSON data by using:
25 +
26 + ```
27 + http://127.0.0.1:19999/data/net.eth0
28 + ```
29 +
30 + This will give you the JSON file for traffic on eth0.
31 + The above is equivalent to:
32 +
33 + ```
34 + http://127.0.0.1:19999/data/net.eth0/3600/1/average
35 + ```
36 +
37 + where:
38 +
39 + - 3600 is the number of entries to generate (3600 is a default which can be overwritten by -l).
40 + - 1 is grouping count, 1 = every single entry, 2 = half the entries, 3 = one every 3 entries, etc
41 + - `average` is the grouping method. It can also be `max`.
42 +
43
44 2. On your web page, you add a few javascript lines and a DIV for every graph you need.
25 -Your browser will hit the web server to fetch the JSON data and refresh the graphs.
45 + Your browser will hit the web server to fetch the JSON data and refresh the graphs.
46
47 3. Graphs are generated using Google Charts API.
48
@@ -41,48 +61,51 @@ Your browser will hit the web server to fetch the JSON data and refresh the grap
61 ```
62
63 For this to work, you need to have persmission to create a directory in /run or /var/run or /tmp.
44 -If you run into problems, try to become root to verify it works.
64 +If you run into problems, try to become root to verify it works. Please, do not run netdata are root permanently.
65 +Since netdata is a web server, the right thing to do, is to have a special user for it.
66
67 Once you run it, the file netdata.conf will be created. You can edit this file to set options for each graph.
68 To apply the changes you made, you have to run netdata.start again.
69
49 -The directory /run/netdata (or /var/run/netdata, or /tmp/netdata depending on your distro) is ready to be
50 -served by a web server (it contains all files needed). Just link it to your htdocs and access it from your web browser.
70 +To access the panel for all graphs, go to:
71 +
72 + ```
73 + http://127.0.0.1:19999/
74 + ```
75 +
76 +
77
78 ---
79
80 ## Installation by hand
81
56 -### download everything in a directory inside your web docs.
57 -You don't need apache. Any web server able to provide static files will do the job fine.
58 -
82 ### Compile netdata
83 step into the directory you downloaded everything and compile netdata
84
85 ```sh
63 -gcc -O3 -o netdata netdata.c
86 +gcc -Wall -O3 -o netdata netdata.c -lpthread
87 ```
88
89 ### run netdata
67 -Run netdata and instruct it to create json files in the current directory.
90 +Run netdata:
91
92 ```sh
70 -./netdata -d -l 60 -u 1 -o "`pwd`"
93 +./netdata -d -l 60 -u 1 -p 19999
94 ```
95 - -d says to go daemon mode
73 - - -l 60 says to show 60 seconds of history
74 - - -u 1 says to create json files every second
75 - - -o sets the save path for the json files
76 -
77 -You should now have one .json file per interface you have active, in the current directory.
78 -All these files are updated once per second.
96 + - -l 60 says to keep 60 history entries
97 + - -u 1 says to add a new history entry every second
98 + - -p 19999 is the port to listen for web clients
99
100 ### edit index.html
101 Set in index.html the interfaces you would like to monitor on the web page.
102
103 ** REMEMBER: there are 2 sections in index.html to edit. A javascript section and an HTML section. **
104
105 +### open a web browser
106 +
107 + ```
108 + http://127.0.0.1:19999/
109 + ```
110
86 -### hit index.html from a web browser
87 -Enjoy real time monitor web graphs for your interfaces.
111