Fancontrol is a project mainly written in PERL and SHELL, it's free.
Fan controller for my Lenovo ThinkPad notebook
My experimental Perl 5 script to controll Lenovo ThinkPad T410s (SSD disc) fan speed/rpm/noise.
See https://github.com/mj41/fancontrol/blob/master/examples.txt
You need to add allow experimental ACPI feature. Add line options thinkpad_acpi fan_control=1 somewhere in /etc/modprobe.d/...
See for more help
Be cafefull. Absolutly no warrantly.