1sensord(8)                Linux System Administration               sensord(8)
2
3
4

NAME

6       sensord - Sensor information logging daemon.
7

SYNOPSIS

9       sensord [ options ] [ chips ]
10
11

DESCRIPTION

13       Sensord  is  a daemon that can be used to periodically log sensor read‐
14       ings from hardware health-monitoring chips to  syslog(3)  or  a  round-
15       robin database (RRD) and to alert when a sensor alarm is signalled; for
16       example, if a fan fails, a temperature limit is exceeded, etc.
17
18       Sensord knows about certain chips, and outputs nicely  formatted  read‐
19       ings  for  them;  but  it  can  also display the information of unknown
20       chips, as long as libsensors(3) knows about them.
21

OPTIONS

23       -i, --interval time
24              Specify the interval between scanning  for  sensor  alarms;  the
25              default is to scan every minute.
26
27              The  time should be specified as a raw integer (seconds) or with
28              a suffix `s' for seconds, `m' for minutes or `h' for hours;  for
29              example, the default interval is `60' or `1m'.
30
31              Specify  an interval of zero to suppress scanning explicitly for
32              alarms.
33
34       -l, --log-interval time
35              Specify the interval between logging all  sensor  readings;  the
36              default is to log all readings every half hour.
37
38              The time is specified as before; e.g., `30m'.
39
40              Specify  an interval of zero to suppress logging of regular sen‐
41              sor readings.
42
43       -t, --rrd-interval time
44              Specify the interval between logging all sensor  readings  to  a
45              round-robin  database;  the default is to log all readings every
46              five minutes if a round-robin database is configured.
47
48              The time is specified as before; e.g., `5m'.
49
50       -T, --rrd-no-average
51              Specify that the round-robin database should not be averaged.
52
53
54       -r, --rrd-file file
55              Specify a round-robin database into  which  to  log  all  sensor
56              readings;  e.g.,  `/var/log/sensord.rrd'.  This database will be
57              created if it does not exist. By default, no  round-robin  data‐
58              base is used.
59
60              See the section ROUND ROBIN DATABASES below for more details.
61
62       -c, --config-file file
63              Specify a libsensors(3) configuration file. If no file is speci‐
64              fied, the name `sensors.conf' is used.
65
66              If the sensors configuration name does not contain  a  directory
67              separator,  the  following  paths  are  searched  for  the file:
68              `/etc',      `/usr/lib/sensors',       `/usr/local/lib/sensors',
69              `/usr/lib', `/usr/local/lib'.
70
71       -p, --pid-file file
72              Specify what PID file to write; the default is to write the file
73              `/var/run/sensord.pid'. You should always  specify  an  absolute
74              path here. The file is removed when the daemon exits.
75
76       -f, --syslog-facility facility
77              Specify  the syslog(3) facility to use when logging sensor read‐
78              ings and alarms; the default is to use local4.
79
80              Other possibile facilities include local0 through local7, daemon
81              or user.
82
83       -g, --rrd-cgi directory
84              Prints  out  a  sample  rrdcgi(1) CGI script that can be used to
85              display graphs of recent sensor information in a Web  page,  and
86              exits.  You  must  specify  the  world-writable,  Web-accessible
87              directory where the graphs should  be  stored;  the  CGI  script
88              assumes  that this will be accessed under the `/sensord/' direc‐
89              tory on the Webserver. See the  section  ROUND  ROBIN  DATABASES
90              below for more details.
91
92       -a, --load-average
93              Include  the  load  average in the RRD database. You should also
94              specify this flag when you create the CGI script.
95
96       -d, --debug
97              Prints a small amount of additional debugging information.
98
99       -h, --help
100              Prints a help message and exits.
101
102       -v, --version
103              Displays the program version and exits.
104

CHIPS

106       To restrict the devices that  are  scanned  by  this  daemon,  you  may
107       optionally  specify  a  list  of  chip names. By default, all available
108       chips are scanned.
109
110       A typical chip name would be `w83782d-*' (you may want  to  escape  the
111       `*'  for your shell) which would scan any W83782D chips on any bus. See
112       sensors.conf(5) for more details. Another option is to simply not  load
113       the sensor modules for chips in which you have no interest.
114

SIGNALS

116       Upon  receipt  of  a  SIGTERM  (see  signal(7) for details) this daemon
117       should gracefully shut down.
118

LOGGING

120       All messages from this daemon are logged to syslog(3) under the program
121       name  `sensord'  and  facility  local4, or whatever is specified on the
122       command line.
123
124       Regular sensor readings are logged  at  the  level  info.   Alarms  are
125       logged  at the level alert.  Inconsequential status messages are logged
126       at the minimum level, debug, when debugging is enabled.
127
128       You can use an appropriate `/etc/syslog.conf' file to direct these mes‐
129       sages  in a useful manner. See syslog.conf(5) for full details, however
130       the following is a sample configuration:
131
132              # Sample syslog.conf entries
133              *.info;...;local4.none;local4.warn  /var/log/messages
134              local4.info                        -/var/log/sensors
135              local4.alert                        /dev/console
136              local4.alert                        *
137
138       The first line ensures that regular  sensor  readings  do  not  clutter
139       `/var/log/messages';  we  first say `local4.none' to eliminate informa‐
140       tional messages; then `local4.warn' to enable warnings and  above.  The
141       second  line  says to log all regular sensor readings to `/var/log/sen‐
142       sors'; the leading hyphen `-' means that this file is not flushed after
143       every  message.  The  final two lines ensure that alarms are printed to
144       the system console as well as to all connected users  (in  addition  to
145       `/var/log/messages' and `/var/log/sensors').
146

LOG ROTATION

148       On  a typical system with a good sensor chip, expect about 2KB per sen‐
149       sor reading in the log file. This works out at about 3MB per month. You
150       should be rotating your syslog files anyway, but just to be sure you'll
151       want to use something like logrotate(8) or equivalent. You  might,  for
152       example, want an entry in `/etc/logrotate.d/syslog' containing:
153
154              # Sample logrotate.d entry
155              /var/log/sensors {
156                  postrotate
157                      /usr/sbin/killall -HUP syslogd
158                  endscript
159              }
160
161       Note, of course, that you want to restart syslogd(8) and not sensord(8)
162

ALARMS

164       Alarms  generally  indicate  a  critical  condition; for example, a fan
165       failure or an unacceptable temperature or voltage. However, some sensor
166       chips  do  not  support alarms, while others are incorrectly configured
167       and may signal alarms incorrectly.
168
169       Sometimes, uninteresting alarms  (e.g.,  chassis  intrusion  detection)
170       will  be  repeated  continuously.  You  can  configure libsensors(3) to
171       ignore unwanted sensor reading such as these  by  placing  an  `ignore'
172       entry  in  the appropriate chip-specific section of the sensors.conf(5)
173       configuration file.
174
175       For example, I have the following entry:
176
177              # Sample /etc/sensors.conf entry
178              chip "w83782d-*"
179                  ignore "alarms"
180
181       In this case, `alarms' was the sensor label reported  in  the  relevant
182       sensor log message.
183
184       Alternatively, you may be able to reset the alarm with your BIOS.
185

BEEPS

187       If  you  see  `(beep)'  beside any sensor reading, that just means that
188       your system is configured to issue an audio warning  from  the  mother‐
189       board if an alarm is signalled on that sensor.
190

ROUND ROBIN DATABASES

192       Sensord(8)  provides  support  for  storing sensor readings in a round-
193       robin database. This may be a useful alternative to  the  use  of  sys‐
194       log(3).
195
196       Round-robin  databases  are constant-size databases that can be used to
197       store, for example, a week's worth of sensor readings. Subsequent read‐
198       ings  stored  in  the  database will overwrite readings that are over a
199       week old. This capability is extremely useful because it allows  useful
200       information  to  be  stored in an easily-accessible manner for a useful
201       length of time, without the burden of ever-growing log files.
202
203       The rrdtool(1) utility and its associated  library  provide  the  basic
204       framework  for  the  round-robin database beneath sensord(8).  In addi‐
205       tion, the rrdcgi(1) and rrdgraph(1) utilities provide support for  gen‐
206       erating graphs of these data for display in a Web page.
207
208       If  you  wish to use the default configuration of round-robin database,
209       which holds one week of sensor readings at five-minute intervals,  then
210       simply start sensord(8) and specify where you want the database stored.
211       It will automatically be created and  configured  using  these  default
212       parameters.
213
214       If you wish readings to be stored for a longer period, or want multiple
215       readings to be averaged into each database entry, then you  must  manu‐
216       ally  create  and  configure  the  database before starting sensord(8).
217       Consult the rrdcreate(1) manual for details.  Note  that  the  database
218       must  match  exactly the names and order of sensors read by sensord(8).
219       It is recommended that you create the default  database  and  then  use
220       rrdinfo(1) to obtain this information, and/or rrdtune(1) to change it.
221
222       After  creating  the round-robin database, you must then configure your
223       Web server to display the sensor information.  This  assumes  that  you
224       have  a Web server preconfigured and functioning on your machine.  Sen‐
225       sord(8) provides a command-line option --rrd-cgi to  generate  a  basic
226       CGI  script to display these graphs; you can then customize this script
227       as desired.  Consult the rrdcgi(1) manual for details. This CGI  script
228       requires a world-writable, Web-accessible directory into which to write
229       the graphs that it generates.
230
231       An example of how to set up  Web-accessible  graphs  of  recent  sensor
232       readings follows:
233
234              sensord --log-interval 0 \
235                --load-average \
236                --rrd-file /var/log/sensord.rrd
237
238       Here,  we  start  sensord(8)  and  configure  it to store readings in a
239       round-robin database; note that we disable logging of  sensor  readings
240       to syslog(3), and enable logging of the load average.
241
242              mkdir /var/www/sensord
243              chown www-data:staff /var/www/sensord
244              chmod a=rwxs /var/www/sensord
245
246       Here,  we  create  a  world-writable, Web-accessible directory in which
247       graphs will be stored; we set the ownership  and  permissions  on  this
248       directory  appropriately.  You  will have to determine the location and
249       ownership that is appropriate for your machine.
250
251              sensord --load-average \
252                --rrd-file /var/log/sensord.rrd \
253                --rrd-cgi /var/www/sensord \
254                > /usr/lib/cgi-bin/sensord.cgi
255              chmod a+rx /usr/lib/cgi-bin/sensord.cgi
256
257       Here, we create a CGI script that will display sensor readings from the
258       database.   You  must specify the location of the round-robin database,
259       the location of the directory where the images should  be  stored,  and
260       whether you want the load average displayed. The --rrd-cgi command-line
261       parameter causes sensord(8) to display a suitable CGI script on  stdout
262       and  then  to  exit.  You will need to write this script to the CGI bin
263       directory of your Web server, and edit the script if the  image  direc‐
264       tory you chose is not the `/sensord/' directory of your Web server.
265
266       Finally,  you  should be able to view your sensor readings from the URL
267       `http://localhost/cgi-bin/sensord.cgi'.
268

MODULES

270       It is expected that all required sensor modules  are  loaded  prior  to
271       this  daemon  being  started. This can either be achieved with a system
272       specific module loading scheme (e.g., listing the required  modules  in
273       the file `/etc/modules' under Debian) or with explicit modprobe(1) com‐
274       mands in an init script before loading the daemon.
275
276       For example, a `sensord' initialization  script  might  contain  (among
277       others) the following commands:
278
279              # Sample init.d scriptlet
280              echo -n "Loading AMD756 module: "
281              modprobe i2c-amd756 || { echo Fail. ; exit 1 ; }
282              echo OK.
283              echo -n "Loading W83781D module: "
284              modprobe w83781d || { echo Fail. ; exit 1 ; }
285              echo OK.
286              echo -n "Starting sensord: "
287              daemon sensord
288
289       Ignore  the  platform-specific shell functions; the general idea should
290       be fairly clear.
291

ERRORS

293       Errors encountered by this daemon are logged to syslogd(8) after  which
294       the daemon will exit.
295

BUGS

297       Round-robin  database  support  doesn't cope with multiple sensor chips
298       having duplicate sensor labels.
299

FILES

301       /etc/sensors.conf
302              The  system-wide  libsensors(3)  configuration  file.  See  sen‐
303              sors.conf(5) for further details.
304       /etc/syslog.conf
305              The  system-wide  syslog(3) / syslogd(8) configuration file. See
306              syslog.conf(5) for further details.
307

CONFORMING TO

309       lm_sensors-2.x
310

SEE ALSO

312       sensors.conf(5)
313

AUTHORS

315       Sensord was written by Merlin Hughes <merlin@merlin.org>. Chip-specific
316       formatting  code  was  ripped  from  sensors which was written by Frodo
317       Looijaard <frodol@dds.nl>. Basics of round-robin databases were  misap‐
318       propriated from Mark D. Studebaker.
319
320
321
322                                 October 2007                       sensord(8)
Impressum