| 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://oss.oetiker.ch/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 /sys 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 | - Edit the top of the Makefile. Do NOT skip this step. |
|---|
| 49 | The defaults will probably not work for you. |
|---|
| 50 | Here are the defaults: |
|---|
| 51 | Cron user |
|---|
| 52 | USER=httpd |
|---|
| 53 | Path to rrdtool and rrdcgi |
|---|
| 54 | RRDPATH=/usr/bin |
|---|
| 55 | Place to install sens_update_rrd script |
|---|
| 56 | BINPATH=/usr/local/bin |
|---|
| 57 | Place to store the database |
|---|
| 58 | RRDDIR=/var/lib/sensors-rrd |
|---|
| 59 | Place to put the cgi script and the graphs |
|---|
| 60 | APACHE=/usr/local/apache/htdocs |
|---|
| 61 | APACHDIR=$(APACHE)/senspix |
|---|
| 62 | The sensor device in your system |
|---|
| 63 | (isa recommended over i2c if both are available) |
|---|
| 64 | SENSDEV=hwmon0 (look in /sys/class/hwmon) |
|---|
| 65 | - make |
|---|
| 66 | - (as root) make install, which does the following. |
|---|
| 67 | If you don't want it to do this, install by hand!!! |
|---|
| 68 | Creates a database |
|---|
| 69 | Installs the data gathering script |
|---|
| 70 | Installs the CGI script in your web server |
|---|
| 71 | - Manually add the following line to the crontab for |
|---|
| 72 | the user specified above, which will call the data gathering |
|---|
| 73 | script every 5 minutes (adjust paths as necessary) |
|---|
| 74 | */5 * * * * /usr/local/bin/sens_update_rrd /var/lib/sensors-rrd/sensors.rrd hwmon0 |
|---|
| 75 | - Load http://localhost/senspix/sens_day.cgi in your web browser |
|---|
| 76 | to test |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | TROUBLESHOOTING |
|---|
| 80 | --------------- |
|---|
| 81 | RRD problems: See the RRD documentation |
|---|
| 82 | |
|---|
| 83 | Cron problems: check the cron logs, maybe your cron format |
|---|
| 84 | is different or you need to signal the cron daemon? |
|---|
| 85 | |
|---|
| 86 | Unused sensors: remove appropriate sections from sens_*.cgi.in |
|---|
| 87 | and remake and install. |
|---|
| 88 | |
|---|
| 89 | Sensor scaling factors incorrect (in3-in6): Edit lines in |
|---|
| 90 | sens_*.cgi.in that start |
|---|
| 91 | 'CDEF:' to change the scale factor. |
|---|
| 92 | |
|---|
| 93 | CGI problems: Check the apache logs. If CGI is not enabled for |
|---|
| 94 | the directory add a .htaccess file to the directory |
|---|
| 95 | including the line |
|---|
| 96 | Options ExecCGI |
|---|
| 97 | |
|---|
| 98 | Removing the "RRDTOOL / TOBI OETIKER" tag in RRD graphs: |
|---|
| 99 | Comment out the line |
|---|
| 100 | gator(gif, (int) im->xgif-5, 5); |
|---|
| 101 | in src/rrd_graph.c in the RRD package. |
|---|