adding logging of sensors
[psensor.git] / src / server / description.txt
1 [DESCRIPTION]
2
3 /psensor-server is a/
4
5 It provides a JSON Web service which can be used by psensor(1) to
6 monitor remotely the hardware sensors of a computer.
7
8 It can provide information about:
9   * the temperature of the motherboard and CPU sensors (using lm\-sensors).
10   * the temperature of the Hard Disk Drives (using hddtemp).
11   * the rotation speed of the fans (using lm\-sensors).
12
13 It is also possible to connect to the psensor\-server with a browser, a
14 simple Web page is displaying the sensors information and the CPU
15 usage.
16
17 The URL http://hostname:3131/api/1.0/sensors/[id] returns a JSON
18 object containing all information about a sensor. [id] is the uniq
19 identifier of the sensor.
20
21 Here is an example of the JSON object of type 'sensor':
22
23 { "id": "lmsensor acpitz\-virtual\-0 temp1", 
24   "name": "temp1", 
25   "type": 257, 
26   "min": 47.800000, 
27   "max": 60.800000,
28   "measures": [ { "value": 47.800000, "time": 1311374873 },
29                 { "value": 49.800000, "time": 1311374878 },
30                 { "value": 49.800000, "time": 1311374883 } ],
31   "last_measure": { "value": 49.800000, "time": 1311374883 }
32 }
33
34 Fields of the type 'sensor':
35
36    * id: the uniq identifier of the sensor.
37    * name: a humean readable name of the sensor (might not be uniq).
38    * type: the type of sensor. Look at src/lib/psensor.h for the
39      different types.
40    * min: the minimal value of the sensor.
41    * max: the maximal value of the sensor.
42    * measures: all measures of the sensor.
43    * last_measure: the last value of the sensor.
44    * time: the time of a measure as the number of seconds since
45      1970/01/01.
46
47 The URL http://hostname:3131/api/1.0/sensors returns a JSON array
48 containing all JSON objects of type 'sensor'.
49
50 psensor\-server can be stopped by sending an HTTP
51 request with the URL 'http://hostname:port/api/1.0/server/stop'.
52
53 [SENSOR LOG FILE]
54
55 Sensors can be logged using the \-\-sensor-log-file option.
56
57 It is using a text format, each line is terminated with a NEWLINE
58 char.
59
60 The first line is: I,%D,%V
61
62 %D is the starting time of the log expressed as the number of seconds
63 since EPOC.
64
65 %V is the version of psensor-server.
66
67 Following lines gives the ordered list of sensors: S,%I
68
69 %I is the uniq identifier of the sensor.
70
71 Then, the values of all sensors are written: M,%D,%V...
72
73 %D is the number of seconds elapsed since the starting time of the
74 log.
75
76 %V... is the list separated by a comma of the current value of all
77 sensors. The ordering is the same than the list of sensor identifiers.
78 The value is expressed as a float.
79
80 [WARNING]
81
82 psensor\-server does not provide any way to restrict the connection to
83 the HTTP server, worst, no effort has been made against malicious HTTP
84 attacks.  You should make the psensor\-server port available only to a
85 network or computer you trust by using the usual network security
86 tools of the system (for example, iptables(8) ).
87
88 [SEE ALSO]
89
90 psensor(1), sensors(1), sensors\-detect(8)