| 1 | .\" Copyright 1999-2002 Merlin Hughes <merlin@merlin.org> |
|---|
| 2 | .\" sensord is distributed under the GPL |
|---|
| 3 | .\" |
|---|
| 4 | .\" Permission is granted to make and distribute verbatim copies of this |
|---|
| 5 | .\" manual provided the copyright notice and this permission notice are |
|---|
| 6 | .\" preserved on all copies. |
|---|
| 7 | .\" |
|---|
| 8 | .\" Permission is granted to copy and distribute modified versions of this |
|---|
| 9 | .\" manual under the conditions for verbatim copying, provided that the |
|---|
| 10 | .\" entire resulting derived work is distributed under the terms of a |
|---|
| 11 | .\" permission notice identical to this one |
|---|
| 12 | .\" |
|---|
| 13 | .\" Since the Linux kernel and libraries are constantly changing, this |
|---|
| 14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no |
|---|
| 15 | .\" responsibility for errors or omissions, or for damages resulting from |
|---|
| 16 | .\" the use of the information contained herein. The author(s) may not |
|---|
| 17 | .\" have taken the same level of care in the production of this manual, |
|---|
| 18 | .\" which is licensed free of charge, as they might when working |
|---|
| 19 | .\" professionally. |
|---|
| 20 | .\" |
|---|
| 21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
|---|
| 22 | .\" the source, must acknowledge the copyright and authors of this work. |
|---|
| 23 | .\" |
|---|
| 24 | .TH sensord 8 "October 2007" "lm-sensors 3" "Linux System Administration" |
|---|
| 25 | .SH NAME |
|---|
| 26 | sensord \- Sensor information logging daemon. |
|---|
| 27 | .SH SYNOPSIS |
|---|
| 28 | .B sensord [ |
|---|
| 29 | .I options |
|---|
| 30 | .B ] [ |
|---|
| 31 | .I chips |
|---|
| 32 | .B ] |
|---|
| 33 | |
|---|
| 34 | .SH DESCRIPTION |
|---|
| 35 | .B Sensord |
|---|
| 36 | is a daemon that can be used to periodically log sensor readings from |
|---|
| 37 | hardware health-monitoring chips to |
|---|
| 38 | .BR syslog (3) |
|---|
| 39 | or a round-robin database (RRD) |
|---|
| 40 | and to alert when a sensor alarm is signalled; for example, if a |
|---|
| 41 | fan fails, a temperature limit is exceeded, etc. |
|---|
| 42 | |
|---|
| 43 | .SH OPTIONS |
|---|
| 44 | .IP "-i, --interval time" |
|---|
| 45 | Specify the interval between scanning for sensor alarms; the default is to |
|---|
| 46 | scan every minute. |
|---|
| 47 | |
|---|
| 48 | The time should be specified as a raw integer (seconds) or with a suffix |
|---|
| 49 | `s' for seconds, `m' for minutes or `h' for hours; for example, the |
|---|
| 50 | default interval is `60' or `1m'. |
|---|
| 51 | |
|---|
| 52 | Specify an interval of zero to suppress scanning explicitly for alarms. |
|---|
| 53 | .IP "-l, --log-interval time" |
|---|
| 54 | Specify the interval between logging all sensor readings; the default is |
|---|
| 55 | to log all readings every half hour. |
|---|
| 56 | |
|---|
| 57 | The time is specified as before; e.g., `30m'. |
|---|
| 58 | |
|---|
| 59 | Specify an interval of zero to suppress logging of regular sensor |
|---|
| 60 | readings. |
|---|
| 61 | .IP "-t, --rrd-interval time" |
|---|
| 62 | Specify the interval between logging all sensor readings to a round-robin |
|---|
| 63 | database; the default is to log all readings every five minutes |
|---|
| 64 | .B if |
|---|
| 65 | a round-robin database is configured. |
|---|
| 66 | |
|---|
| 67 | The time is specified as before; e.g., `5m'. |
|---|
| 68 | .IP "-T, --rrd-no-average" |
|---|
| 69 | Specify that the round-robin database should not be averaged. |
|---|
| 70 | |
|---|
| 71 | .IP "-r, --rrd-file file" |
|---|
| 72 | Specify a round-robin database into which to log all sensor readings; |
|---|
| 73 | e.g., `/var/log/sensord.rrd'. This database will be created if it does |
|---|
| 74 | not exist. By default, no round-robin database is used. |
|---|
| 75 | |
|---|
| 76 | See the section |
|---|
| 77 | .B ROUND ROBIN DATABASES |
|---|
| 78 | below for more details. |
|---|
| 79 | .IP "-c, --config-file file" |
|---|
| 80 | Specify a |
|---|
| 81 | .BR libsensors (3) |
|---|
| 82 | configuration file. If no file is specified, the libsensors default |
|---|
| 83 | configuration file is used. |
|---|
| 84 | |
|---|
| 85 | .IP "-p, --pid-file file" |
|---|
| 86 | Specify what PID file to write; the default is to write the file |
|---|
| 87 | `/var/run/sensord.pid'. You should always specify an absolute path |
|---|
| 88 | here. The file is removed when the daemon exits. |
|---|
| 89 | .IP "-f, --syslog-facility facility" |
|---|
| 90 | Specify the |
|---|
| 91 | .BR syslog (3) |
|---|
| 92 | facility to use when logging sensor readings and alarms; the default is |
|---|
| 93 | to use |
|---|
| 94 | .IR daemon . |
|---|
| 95 | |
|---|
| 96 | Other possible facilities include |
|---|
| 97 | .IR local0 |
|---|
| 98 | through |
|---|
| 99 | .IR local7 , |
|---|
| 100 | and |
|---|
| 101 | .IR user . |
|---|
| 102 | .IP "-g, --rrd-cgi directory" |
|---|
| 103 | Prints out a sample |
|---|
| 104 | .BR rrdcgi (1) |
|---|
| 105 | CGI script that can be used to display graphs of recent sensor information |
|---|
| 106 | in a Web page, and exits. You must specify the world-writable, Web-accessible |
|---|
| 107 | directory where the graphs should be stored; the CGI script assumes that |
|---|
| 108 | this will be accessed under the `/sensord/' directory on the Webserver. See |
|---|
| 109 | the section |
|---|
| 110 | .B ROUND ROBIN DATABASES |
|---|
| 111 | below for more details. |
|---|
| 112 | .IP "-a, --load-average" |
|---|
| 113 | Include the load average in the RRD database. You should |
|---|
| 114 | also specify this flag when you create the CGI script. |
|---|
| 115 | .IP "-d, --debug" |
|---|
| 116 | Prints a small amount of additional debugging information. |
|---|
| 117 | .IP "-h, --help" |
|---|
| 118 | Prints a help message and exits. |
|---|
| 119 | .IP "-v, --version" |
|---|
| 120 | Displays the program version and exits. |
|---|
| 121 | .SH CHIPS |
|---|
| 122 | To restrict the devices that are scanned by this daemon, you may |
|---|
| 123 | optionally specify a list of chip names. By default, all available |
|---|
| 124 | chips are scanned. |
|---|
| 125 | |
|---|
| 126 | A typical chip name would be `w83782d-*' (you may want to escape the |
|---|
| 127 | `*' for your shell) which would scan any W83782D chips on any bus. See |
|---|
| 128 | .BR sensors.conf (5) |
|---|
| 129 | for more details. Another option is to simply not load the sensor |
|---|
| 130 | modules for chips in which you have no interest. |
|---|
| 131 | .SH SIGNALS |
|---|
| 132 | Upon receipt of a SIGTERM (see |
|---|
| 133 | .BR signal (7) |
|---|
| 134 | for details) this daemon should gracefully shut down. |
|---|
| 135 | |
|---|
| 136 | Upon receipt of a SIGHUP, this daemon will rescan the kernel interface |
|---|
| 137 | for chips and features, and reload the libsensors configuration file. |
|---|
| 138 | .SH LOGGING |
|---|
| 139 | All messages from this daemon are logged to |
|---|
| 140 | .BR syslog (3) |
|---|
| 141 | under the program name `sensord' and facility |
|---|
| 142 | .IR daemon , |
|---|
| 143 | or whatever is specified on the command line. |
|---|
| 144 | |
|---|
| 145 | Regular sensor readings are logged at the level |
|---|
| 146 | .IR info . |
|---|
| 147 | Alarms are logged at the level |
|---|
| 148 | .IR alert . |
|---|
| 149 | Inconsequential status messages are logged at |
|---|
| 150 | the minimum level, |
|---|
| 151 | .IR debug , |
|---|
| 152 | when debugging is enabled. |
|---|
| 153 | |
|---|
| 154 | You can use an appropriate `/etc/syslog.conf' |
|---|
| 155 | file to direct these messages in a useful manner. See |
|---|
| 156 | .BR syslog.conf (5) |
|---|
| 157 | for full details. Assuming you set the logging facility to local4, |
|---|
| 158 | the following is a sample configuration: |
|---|
| 159 | .IP |
|---|
| 160 | .nf |
|---|
| 161 | # Sample syslog.conf entries |
|---|
| 162 | *.info;...;local4.none;local4.warn /var/log/messages |
|---|
| 163 | local4.info -/var/log/sensors |
|---|
| 164 | local4.alert /dev/console |
|---|
| 165 | local4.alert * |
|---|
| 166 | .fi |
|---|
| 167 | .PP |
|---|
| 168 | The first line ensures that regular sensor readings do not clutter |
|---|
| 169 | `/var/log/messages'; we first say `local4.none' to eliminate |
|---|
| 170 | informational messages; then `local4.warn' to enable warnings and |
|---|
| 171 | above. The second line says to log all regular sensor readings to |
|---|
| 172 | `/var/log/sensors'; the leading hyphen `-' means that this file |
|---|
| 173 | is not flushed after every message. The final two lines ensure |
|---|
| 174 | that alarms are printed to the system console as well as |
|---|
| 175 | to all connected users (in addition to `/var/log/messages' and |
|---|
| 176 | `/var/log/sensors'). |
|---|
| 177 | .SH LOG ROTATION |
|---|
| 178 | On a typical system with a good sensor chip, expect about 2KB per sensor |
|---|
| 179 | reading in the log file. This works out at about 3MB per month. You |
|---|
| 180 | should be rotating your syslog files anyway, but just to be sure you'll |
|---|
| 181 | want to use something like |
|---|
| 182 | .BR logrotate (8) |
|---|
| 183 | or equivalent. You might, for example, want an entry in |
|---|
| 184 | `/etc/logrotate.d/syslog' containing: |
|---|
| 185 | .IP |
|---|
| 186 | .nf |
|---|
| 187 | # Sample logrotate.d entry |
|---|
| 188 | /var/log/sensors { |
|---|
| 189 | postrotate |
|---|
| 190 | /usr/sbin/killall -HUP syslogd |
|---|
| 191 | endscript |
|---|
| 192 | } |
|---|
| 193 | .fi |
|---|
| 194 | .PP |
|---|
| 195 | Note, of course, that you want to restart |
|---|
| 196 | .BR syslogd (8) |
|---|
| 197 | and not |
|---|
| 198 | .BR sensord (8) |
|---|
| 199 | . |
|---|
| 200 | .SH ALARMS |
|---|
| 201 | Alarms generally indicate a critical condition; for example, a fan |
|---|
| 202 | failure or an unacceptable temperature or voltage. However, some |
|---|
| 203 | sensor chips do not support alarms, while others are incorrectly |
|---|
| 204 | configured and may signal alarms incorrectly. |
|---|
| 205 | |
|---|
| 206 | Note that some drivers may lack support for alarm reporting |
|---|
| 207 | even though the chips they support do have alarms. As of Linux 2.6.23, |
|---|
| 208 | many drivers still don't report alarms in a format suitable for |
|---|
| 209 | libsensors 3. |
|---|
| 210 | |
|---|
| 211 | .SH BEEPS |
|---|
| 212 | If you see `(beep)' beside any sensor reading, that just means that |
|---|
| 213 | your system is configured to issue an audio warning from the |
|---|
| 214 | motherboard if an alarm is signalled on that sensor. |
|---|
| 215 | .SH ROUND ROBIN DATABASES |
|---|
| 216 | .BR Sensord (8) |
|---|
| 217 | provides support for storing sensor readings in a round-robin |
|---|
| 218 | database. This may be a useful alternative to the use of |
|---|
| 219 | .BR syslog (3). |
|---|
| 220 | |
|---|
| 221 | Round-robin databases are |
|---|
| 222 | constant-size databases that can be used to store, for example, |
|---|
| 223 | a week's worth of sensor readings. Subsequent readings stored |
|---|
| 224 | in the database will overwrite readings that are over a week |
|---|
| 225 | old. This capability is extremely useful because it allows |
|---|
| 226 | useful information to be stored in an easily-accessible |
|---|
| 227 | manner for a useful length of time, without the burden of |
|---|
| 228 | ever-growing log files. |
|---|
| 229 | |
|---|
| 230 | The |
|---|
| 231 | .BR rrdtool (1) |
|---|
| 232 | utility and its associated library provide the basic framework for |
|---|
| 233 | the round-robin database beneath |
|---|
| 234 | .BR sensord (8). |
|---|
| 235 | In addition, the |
|---|
| 236 | .BR rrdcgi (1) |
|---|
| 237 | and |
|---|
| 238 | .BR rrdgraph (1) |
|---|
| 239 | utilities provide support for generating graphs of these data for |
|---|
| 240 | display in a Web page. |
|---|
| 241 | |
|---|
| 242 | If you wish to use the default configuration of round-robin |
|---|
| 243 | database, which holds one week of sensor readings at five-minute |
|---|
| 244 | intervals, then simply start |
|---|
| 245 | .BR sensord (8) |
|---|
| 246 | and specify where you want the database stored. It will automatically |
|---|
| 247 | be created and configured using these default parameters. |
|---|
| 248 | |
|---|
| 249 | If you wish readings to be stored for a longer period, or want multiple |
|---|
| 250 | readings to be averaged into each database entry, then you must |
|---|
| 251 | manually create and configure the database before starting |
|---|
| 252 | .BR sensord (8). |
|---|
| 253 | Consult the |
|---|
| 254 | .BR rrdcreate (1) |
|---|
| 255 | manual for details. Note that the database must match exactly the |
|---|
| 256 | names and order of sensors read by |
|---|
| 257 | .BR sensord (8). |
|---|
| 258 | It is recommended that you create the default database and then use |
|---|
| 259 | .BR rrdinfo (1) |
|---|
| 260 | to obtain this information, and/or |
|---|
| 261 | .BR rrdtune (1) |
|---|
| 262 | to change it. |
|---|
| 263 | |
|---|
| 264 | After creating the round-robin database, you must then configure |
|---|
| 265 | your Web server to display the sensor information. This assumes that |
|---|
| 266 | you have a Web server preconfigured and functioning on your machine. |
|---|
| 267 | .BR Sensord (8) |
|---|
| 268 | provides a command-line option |
|---|
| 269 | .BR --rrd-cgi |
|---|
| 270 | to generate a basic CGI script to |
|---|
| 271 | display these graphs; you can then customize this script as desired. |
|---|
| 272 | Consult the |
|---|
| 273 | .BR rrdcgi (1) |
|---|
| 274 | manual for details. This CGI script requires a world-writable, Web-accessible |
|---|
| 275 | directory into which to write the graphs that it generates. |
|---|
| 276 | |
|---|
| 277 | An example of how to set up Web-accessible graphs of recent sensor readings |
|---|
| 278 | follows: |
|---|
| 279 | .IP |
|---|
| 280 | .nf |
|---|
| 281 | sensord --log-interval 0 \\ |
|---|
| 282 | --load-average \\ |
|---|
| 283 | --rrd-file /var/log/sensord.rrd |
|---|
| 284 | .fi |
|---|
| 285 | .PP |
|---|
| 286 | Here, we start |
|---|
| 287 | .BR sensord (8) |
|---|
| 288 | and configure it to store readings in a round-robin database; note |
|---|
| 289 | that we disable logging of sensor readings to |
|---|
| 290 | .BR syslog (3), |
|---|
| 291 | and enable logging of the load average. |
|---|
| 292 | .IP |
|---|
| 293 | .nf |
|---|
| 294 | mkdir /var/www/sensord |
|---|
| 295 | chown www-data:staff /var/www/sensord |
|---|
| 296 | chmod a=rwxs /var/www/sensord |
|---|
| 297 | .fi |
|---|
| 298 | .PP |
|---|
| 299 | Here, we create a world-writable, Web-accessible directory in which |
|---|
| 300 | graphs will be stored; we set the ownership and permissions on this |
|---|
| 301 | directory appropriately. You will have to determine the location and |
|---|
| 302 | ownership that is appropriate for your machine. |
|---|
| 303 | .IP |
|---|
| 304 | .nf |
|---|
| 305 | sensord --load-average \\ |
|---|
| 306 | --rrd-file /var/log/sensord.rrd \\ |
|---|
| 307 | --rrd-cgi /var/www/sensord \\ |
|---|
| 308 | > /usr/lib/cgi-bin/sensord.cgi |
|---|
| 309 | chmod a+rx /usr/lib/cgi-bin/sensord.cgi |
|---|
| 310 | .fi |
|---|
| 311 | .PP |
|---|
| 312 | Here, we create |
|---|
| 313 | a CGI script that will display sensor readings from the database. |
|---|
| 314 | You must specify the location of the round-robin database, the |
|---|
| 315 | location of the directory where the images should be stored, |
|---|
| 316 | and whether you want the load average displayed. The |
|---|
| 317 | .BR --rrd-cgi |
|---|
| 318 | command-line parameter causes |
|---|
| 319 | .BR sensord (8) |
|---|
| 320 | to display a suitable CGI script on |
|---|
| 321 | .BR stdout |
|---|
| 322 | and then to exit. You will need to write this script to the CGI |
|---|
| 323 | bin directory of your Web server, |
|---|
| 324 | and edit the script if the image directory you chose is not the |
|---|
| 325 | `/sensord/' directory of your Web server. |
|---|
| 326 | |
|---|
| 327 | Finally, you should be able to view your sensor readings from |
|---|
| 328 | the URL `http://localhost/cgi-bin/sensord.cgi'. |
|---|
| 329 | .SH MODULES |
|---|
| 330 | It is expected that all required sensor modules are loaded prior to |
|---|
| 331 | this daemon being started. This can either be achieved with a system |
|---|
| 332 | specific module loading scheme (e.g., listing the required modules |
|---|
| 333 | in the file `/etc/modules' under Debian) or with explicit |
|---|
| 334 | .BR modprobe (1) |
|---|
| 335 | commands in an init script before loading the daemon. |
|---|
| 336 | |
|---|
| 337 | For example, a `sensord' initialization script might |
|---|
| 338 | contain (among others) the following commands: |
|---|
| 339 | .IP |
|---|
| 340 | .nf |
|---|
| 341 | # Sample init.d scriptlet |
|---|
| 342 | echo -n "Loading AMD756 module: " |
|---|
| 343 | modprobe i2c-amd756 || { echo Fail. ; exit 1 ; } |
|---|
| 344 | echo OK. |
|---|
| 345 | echo -n "Loading W83781D module: " |
|---|
| 346 | modprobe w83781d || { echo Fail. ; exit 1 ; } |
|---|
| 347 | echo OK. |
|---|
| 348 | echo -n "Starting sensord: " |
|---|
| 349 | daemon sensord |
|---|
| 350 | ... |
|---|
| 351 | .fi |
|---|
| 352 | .PP |
|---|
| 353 | Ignore the platform-specific shell functions; the general idea |
|---|
| 354 | should be fairly clear. |
|---|
| 355 | .SH ERRORS |
|---|
| 356 | Errors encountered by this daemon are logged to |
|---|
| 357 | .BR syslogd (8) |
|---|
| 358 | after which the daemon will exit. |
|---|
| 359 | .SH BUGS |
|---|
| 360 | Round-robin database support doesn't cope with |
|---|
| 361 | multiple sensor chips having duplicate sensor labels. |
|---|
| 362 | .SH FILES |
|---|
| 363 | .I /etc/sensors3.conf |
|---|
| 364 | .br |
|---|
| 365 | .I /etc/sensors.conf |
|---|
| 366 | .RS |
|---|
| 367 | The system-wide |
|---|
| 368 | .BR libsensors (3) |
|---|
| 369 | configuration file. See |
|---|
| 370 | .BR sensors.conf (5) |
|---|
| 371 | for further details. |
|---|
| 372 | .RE |
|---|
| 373 | .I /etc/syslog.conf |
|---|
| 374 | .RS |
|---|
| 375 | The system-wide |
|---|
| 376 | .BR syslog (3) |
|---|
| 377 | / |
|---|
| 378 | .BR syslogd (8) |
|---|
| 379 | configuration file. See |
|---|
| 380 | .BR syslog.conf (5) |
|---|
| 381 | for further details. |
|---|
| 382 | .RE |
|---|
| 383 | |
|---|
| 384 | .SH SEE ALSO |
|---|
| 385 | sensors.conf(5) |
|---|
| 386 | .SH AUTHORS |
|---|
| 387 | .B Sensord |
|---|
| 388 | was written by Merlin Hughes <merlin@merlin.org>. Basics of round-robin |
|---|
| 389 | databases were misappropriated from Mark D. Studebaker. |
|---|