| 1 | OVERVIEW |
|---|
| 2 | -------- |
|---|
| 3 | This directory contains shell and cgi scripts which maintain a |
|---|
| 4 | database of sensor data and generate web pages containing |
|---|
| 5 | graphs of sensor data. |
|---|
| 6 | |
|---|
| 7 | The RRD (Round Robin Database) package is REQUIRED. |
|---|
| 8 | Get this package from |
|---|
| 9 | http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ |
|---|
| 10 | |
|---|
| 11 | A web server with CGI support is required. |
|---|
| 12 | |
|---|
| 13 | We have provided these scripts because the RRD package, |
|---|
| 14 | while simple to build and install, is rather difficult |
|---|
| 15 | to configure to store and display data. |
|---|
| 16 | |
|---|
| 17 | RRD, together with lm_sensors and these scripts, provide the |
|---|
| 18 | following advantages: |
|---|
| 19 | - True round-robin (constant-size) database |
|---|
| 20 | - On-the-fly graph generation with CGI scripts |
|---|
| 21 | - Multiple data views using single database |
|---|
| 22 | - Automatic time stamping, interpolation of missing data, |
|---|
| 23 | large data dropouts (during machine downtime) correctly |
|---|
| 24 | shown on graphs |
|---|
| 25 | |
|---|
| 26 | If you are looking for something a little simpler, |
|---|
| 27 | that does not require RRD, try ../tellerstats. |
|---|
| 28 | |
|---|
| 29 | The RRD scripts read /proc entries and do not use libsensors. |
|---|
| 30 | Therefore the scale factors in /etc/sensors.conf are not used, |
|---|
| 31 | and you may have to change the scale factors in the cgi scripts. |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | WARNING! |
|---|
| 35 | -------- |
|---|
| 36 | The 'make install' script tries to make it easy for you but |
|---|
| 37 | makes a lot of assumptions about your cron and web setup. |
|---|
| 38 | If you have any concerns, do NOT run make install, and |
|---|
| 39 | install the items by hand instead. |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | INSTALLATION INSTRUCTIONS |
|---|
| 43 | ------------------------- |
|---|
| 44 | |
|---|
| 45 | - Make and install lm_sensors. Get it working (run 'sensors') |
|---|
| 46 | before you try this! |
|---|
| 47 | - Get RRD, make and install it |
|---|
| 48 | - cd /usr/local; ln -s rrdtool-x.y.z rrdtool |
|---|
| 49 | - cd back to here |
|---|
| 50 | - Edit the top of the Makefile. Do NOT skip this step. |
|---|
| 51 | The defaults will probably not work for you. |
|---|
| 52 | Here are the defaults: |
|---|
| 53 | Cron user |
|---|
| 54 | USER=httpd |
|---|
| 55 | Path to rrdtool and rrdcgi |
|---|
| 56 | RRDPATH=/usr/local/rrdtool/bin |
|---|
| 57 | Place to install sens_update_rrd script |
|---|
| 58 | BINPATH=/usr/local/bin |
|---|
| 59 | Place to store the database |
|---|
| 60 | RRDDIR=/var/lib/sensors-rrd |
|---|
| 61 | Place to put the cgi script and the graphs |
|---|
| 62 | APACHE=/usr/local/apache/htdocs |
|---|
| 63 | APACHDIR=$(APACHE)/senspix |
|---|
| 64 | The sensor device in your system |
|---|
| 65 | (isa recommended over i2c if both are available) |
|---|
| 66 | SENSDEV=w83781d-isa-0290 (2.4 kernel - look in /proc/sys/dev/sensors) |
|---|
| 67 | SENSDEV=0-0290 (2.6 kernel - look in /sys/i2c/bus/devices) |
|---|
| 68 | - make |
|---|
| 69 | - (as root) make install, which does the following. |
|---|
| 70 | If you don't want it to do this, install by hand!!! |
|---|
| 71 | Creates a database |
|---|
| 72 | Installs the data gathering script |
|---|
| 73 | Installs the CGI script in your web server |
|---|
| 74 | - Manually add the following line to the crontab for |
|---|
| 75 | the user specified above, which will call the data gathering |
|---|
| 76 | script every 5 minutes (adjust paths as necessary) |
|---|
| 77 | */5 * * * * /usr/local/bin/sens_update_rrd /var/lib/sensors-rrd/sensors.rrd w83781d-isa-0290 |
|---|
| 78 | - Load http://localhost/senspix/sens_day.cgi in your web browser |
|---|
| 79 | to test |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | TROUBLESHOOTING |
|---|
| 83 | --------------- |
|---|
| 84 | RRD problems: See the RRD documentation |
|---|
| 85 | |
|---|
| 86 | Cron problems: check the cron logs, maybe your cron format |
|---|
| 87 | is different or you need to signal the cron daemon? |
|---|
| 88 | |
|---|
| 89 | Unused sensors: remove appropriate sections from sens_*.cgi.in |
|---|
| 90 | and remake and install. |
|---|
| 91 | |
|---|
| 92 | Sensor scaling factors incorrect (in3-in6): Edit lines in |
|---|
| 93 | sens_*.cgi.in that start |
|---|
| 94 | 'CDEF:' to change the scale factor. |
|---|
| 95 | |
|---|
| 96 | CGI problems: Check the apache logs. If CGI is not enabled for |
|---|
| 97 | the directory add a .htaccess file to the directory |
|---|
| 98 | including the line |
|---|
| 99 | Options ExecCGI |
|---|
| 100 | |
|---|
| 101 | Removing the "RRDTOOL / TOBI OETIKER" tag in RRD graphs: |
|---|
| 102 | Comment out the line |
|---|
| 103 | gator(gif, (int) im->xgif-5, 5); |
|---|
| 104 | in src/rrd_graph.c in the RRD package. |
|---|