How can I set an alarm for fan misfunction?
I noticed the following erroneous behaviour of my fan today:
Temperature of my notebook (Thinkpad X201) was rising to 80-85 deg C and there was no obvious reason for it. So, I checked the fan and noticed that despite the high temperature the fan was not turning.
I quickly ran sensors
and cat /proc/acpi/ibm/fan
and noticed that the fan speed was supposed to be 65xxx 1/min which is obviously not possible. A "normal" value is something between 2,000 and 5,000 1/min.
I might be totally wrong but I am assuming the fan was somehow stuck. (A restart of the notebook fixed it).
Long story short: How can I setup a script that alerts me if the fan speed exceeds a defined value (i.e. 10,000 rpm)? I want to be alert quickly when my fan fails...
If you run lm_sensors any exceeding of limits (max or min) will be logged to syslog. You can have a simple script that looks for these entries, use rsyslog to direct sensord output to a specific process that you forward by email etc. - lots of options. Usually you would have a management system like Nagios which monitors everything from system hardware, to diskspace, memory consumption etc. and you can use that to set and escalate alerts for the entire platform, the whole set of systems you have - instead of a daemon focuses on notifying you on an issue by issue basis.