]> arthur.barton.de Git - netdata.git/blob - README.md
Update README.md
[netdata.git] / README.md
1 netdata
2 =======
3
4 linux network traffic web monitoring
5
6 This little program will allow you to create embedable live monitoring charts on any web page.
7
8 ![image](https://f.cloud.github.com/assets/2662304/664777/3dad6c32-d78d-11e2-9ecf-b921afebfb0b.png)
9
10 ![image](https://f.cloud.github.com/assets/2662304/689979/807dfb4e-dac6-11e2-8546-6d83fdb05866.png)
11
12
13 # How it works
14
15 1. You run a daemon on your linux: netdata.
16 This deamon is written in C and is extremely lightweight.
17 What it does is that it reads /proc/net/dev and for every interface present there, it creates a JSON data file.
18 This JSON file contains all the data needed for the web graphs.
19 Since these files are created too often (e.g. once per second) it is adviced to put them on tmpfs.
20 The files have a fixed length, around just 3k for 60 seconds of graphs.
21
22 2. On your web page, you add a few javascript lines and a DIV for every graph you need.
23 Your browser will hit the web server to fetch the JSON data and refresh the graphs.
24
25 3. Graphs are generated using Google Charts API.
26
27
28
29 # Installation
30
31 ## Automatic installation
32
33 1. Download everything in a directory inside your web server.
34 2. cd to that directory
35 3. run:
36
37 ```sh
38 ./netdata.start
39 ```
40
41 For this to work, you need to have persmission to create a directory in /run or /var/run or /tmp.
42 If you run into problems, try to become root to verify it works.
43
44 Once you run it, the file all.config will be created. You can edit this file to set options for each graph.
45 To apply the changes you made, you have to run netdata.start again.
46
47
48 ---
49
50 ## Installation by hand
51
52 ### download everything in a directory inside your web docs.
53 You don't need apache. Any web server able to provide static files will do the job fine.
54
55 ### Compile netdata
56 step into the directory you downloaded everything and compile netdata
57
58 ```sh
59 gcc -O3 -o netdata netdata.c
60 ```
61
62 ### run netdata
63 Run netdata and instruct it to create json files in the current directory.
64
65 ```sh
66 ./netdata -d -l 60 -u 1 -o "`pwd`"
67 ```
68  - -d says to go daemon mode
69  - -l 60 says to show 60 seconds of history
70  - -u 1 says to create json files every second
71  - -o sets the save path for the json files
72
73 You should now have one .json file per interface you have active, in the current directory.
74 All these files are updated once per second.
75
76 ### edit index.html
77 Set in index.html the interfaces you would like to monitor on the web page.
78
79 ** REMEMBER: there are 2 sections in index.html to edit. A javascript section and an HTML section. **
80
81
82 ### hit index.html from a web browser
83 Enjoy real time monitor web graphs for your interfaces.
84