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

OPTIONS

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

CHIPS

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

SIGNALS

109       Upon receipt of a SIGTERM  (see  signal(7)  for  details)  this  daemon
110       should gracefully shut down.
111
112       Upon  receipt of a SIGHUP, this daemon will rescan the kernel interface
113       for chips and features, and reload the libsensors configuration file.
114

LOGGING

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

LOG ROTATION

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

ALARMS

161       Alarms generally indicate a critical  condition;  for  example,  a  fan
162       failure or an unacceptable temperature or voltage. However, some sensor
163       chips do not support alarms, while others  are  incorrectly  configured
164       and may signal alarms incorrectly.
165
166       Note that some drivers may lack support for alarm reporting even though
167       the chips they support do have alarms. As of Linux 2.6.23, many drivers
168       still don't report alarms in a format suitable for libsensors 3.
169
170

BEEPS

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

ROUND ROBIN DATABASES

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

MODULES

255       It is expected that all required sensor modules  are  loaded  prior  to
256       this  daemon  being  started. This can either be achieved with a system
257       specific module loading scheme (e.g., listing the required  modules  in
258       the file `/etc/modules' under Debian) or with explicit modprobe(1) com‐
259       mands in an init script before loading the daemon.
260
261       For example, a `sensord' initialization  script  might  contain  (among
262       others) the following commands:
263
264              # Sample init.d scriptlet
265              echo -n "Loading AMD756 module: "
266              modprobe i2c-amd756 || { echo Fail. ; exit 1 ; }
267              echo OK.
268              echo -n "Loading W83781D module: "
269              modprobe w83781d || { echo Fail. ; exit 1 ; }
270              echo OK.
271              echo -n "Starting sensord: "
272              daemon sensord
273
274       Ignore  the  platform-specific shell functions; the general idea should
275       be fairly clear.
276

ERRORS

278       Errors encountered by this daemon are logged to syslogd(8) after  which
279       the daemon will exit.
280

BUGS

282       Round-robin  database  support  doesn't cope with multiple sensor chips
283       having duplicate sensor labels.
284

FILES

286       /etc/sensors3.conf
287       /etc/sensors.conf
288              The  system-wide  libsensors(3)  configuration  file.  See  sen‐
289              sors.conf(5) for further details.
290       /etc/syslog.conf
291              The  system-wide  syslog(3) / syslogd(8) configuration file. See
292              syslog.conf(5) for further details.
293
294

SEE ALSO

296       sensors.conf(5)
297

AUTHORS

299       Sensord was written by Merlin  Hughes  <merlin@merlin.org>.  Basics  of
300       round-robin databases were misappropriated from Mark D. Studebaker.
301
302
303
304lm-sensors 3                     October 2007                       sensord(8)
Impressum