#!/usr/bin/perl ################################################## # # # Legge i valori dai sensori della Motherboard # # e li visualizza sullo schermo # # # ################################################## # Leggo i valori dei sensori dalla scheda madre open (BOARD, "cat /proc/sys/dev/sensors/lm78-i2c-0-2d/temp /proc/sys/dev/sensors/lm78-i2c-0-2d/fan2 /proc/sys/dev/sensors/lm78-i2c-0-2d/in* |"); ($Max, $Crit, $Temp) = split / /, ; printf ("Temperatura : %d° C %s\n", $Temp, ($Temp < $Crit) ? "OK" : "ALLARME"); ($Min, $Vel) = split / /, ; printf ("Ventola : %d RPM %s\n", $Vel, ($Vel > $Min) ? "OK" : "ALLARME"); ; # VCore 1, non usato ; # VCore 2, non usato ($Min, $Max, $Ten) = split / /, ; printf ("+3.3V : +%.2f V %s\n", $Ten, ($Ten>$Min && $Ten<$Max) ? "OK" : "ALLARME"); ($Min, $Max, $Ten) = split / /, ; printf ("+5V : +%.2f V %s\n", $Ten*1.68, ($Ten>$Min && $Ten<$Max) ? "OK" : "ALLARME"); ($Min, $Max, $Ten) = split / /, ; printf ("+12V : +%.2f V %s\n", $Ten*3.8, ($Ten>$Min && $Ten<$Max) ? "OK" : "ALLARME"); ($Min, $Max, $Ten) = split / /, ; printf ("-12V : -%.2f V %s\n", $Ten*3.4768, ($Ten>$Min && $Ten<$Max) ? "OK" : "ALLARME"); ($Min, $Max, $Ten) = split / /, ; printf ("-5V : -%1.2f V %s\n", $Ten*1.5049, ($Ten>$Min && $Ten<$Max) ? "OK" : "ALLARME"); close(BOARD);