Lire la température d’un serveur

, par  Olivier Duquesne aka DaffyDuke

Sur une Netra X1 / SunFire V100 ....

 Installer la LOM (Lights Out Management), ce sont les trois packages SUNWlomm , SUNWlomr & SUNWlomu disponibles sur le cd additionnel de Sun Solaris .
 Rebooter pour créer le device /dev/lom (reboot -- -r)
 Puis lire la LOM :

lom -t
System Temperature Sensors:
 1        Enclosure 27 degC : warning 67 degC : shutdown 72 degC
System Over-temperature Sensors:
 1             CPU status=ok

D’autres options sont disponibles pour voir l’état des CPUs, des ventilateurs et de l’eventlog

[daffy@admin ~/etc]$ ./read_lom hostname
11/20/2005 08:11:58 host reset
11/15/2005 12:06:36 host reset
04/24/2005 12:38:09 host reset
12/29/2004 20:11:50 host power off
12/29/2004 20:11:40 host power on
09/21/2004 11:32:36 host power off
09/21/2004 11:28:34 host power on
1/18/2006 18:15:11 GMT LOM time reference
01/19/2006 00:40:43 host reset
1/19/2006 8:56:26 GMT LOM time reference
========================================
LOMlite alarm states:
Alarm1=off
Alarm2=off
Alarm3=on
Fault LED=off
========================================
Fans:
1 OK speed 72%
========================================
Supply voltages:
 1               5V status=ok
 2              3V3 status=ok
 3             +12V status=ok
 4         VDD core status=ok
System status flags (circuit breakers):
 1             USB0 status=ok
 2             USB1 status=ok
 3              SCC status=ok
========================================
System Temperature Sensors:
 1        Enclosure 27 degC : warning 67 degC : shutdown 72 degC
System Over-temperature Sensors:
 1             CPU status=ok
========================================

read_lom est un petit shell à moi qui permet d’afficher la date du jour de l’évènement au lieu de +643j21h etc ...

Sur une Netra T1 105 / AC 200

Dommage, la sonde de température n’est pas fournie. Néanmoins, la commande LOM détaillée ci-dessus donne tout de même quelques informations non négligeables :

lwinf1101:root} lom -a
PSUs:
1 OK

Fans:
1 OK speed 95%
2 OK speed 92%
3 OK speed 94%

LOMlite configuration settings:
serial escape character=#
serial event reporting=off
alarm3 mode=user controlled
firmware version=2.1
firmware checksum=7ca3
product revision=0.0
product ID=Netra t1 105

LOMlite Event Log:
 Fault LED OFF
 wdog trig
 Fault LED ON
 power off
 power on
 power off
 power on
 power off
 power on
 Fault LED OFF
first fatal error
 Fan 1 failed

LOMlite alarm states:
Alarm1=off
Alarm2=off
Alarm3=on
Fault LED=off

LOMlite watchdog (ASR) settings:
Watchdog=on
Hardware reset=off
Timeout=40 s

C’est clairement dit, pas de degré à lire ici :

lwinf1101:root} lom -t
Temperature monitoring not supported by this device

Et pourtant, l’info est renseignée dans l’eeprom , zarbi non ?

lwinf1101:root} eeprom
[...]
shutdown-temperature=74
warning-temperature=69
[...]

Sur un DL-380 G4 et autres serveurs HP/Compaq

 Installer hpasm (rpm disponible depuis le site hp.com) :
Description : The hp System Health Application and Insight Management Agents package provides extended capabilities to ProLiant Servers. These capabilities include monitoring of temperature thresholds, fan, processor and memory failures. Should a parameter be out of normal operating conditions, the Linux operating system will be automatically shutdown. The hp Advanced Server Management Application(hpasmd) is the interface to the Advanced Server Management (ASM) ASIC. This application will work with both the ProLiant ASM (0x0E11A0F1) and the ProLiant iLO Advance Server Management (0x0E11B203) ASICs. The hpasmd also provides an interface so other software can log events to the hp ProLiant Integrated Management Log (IML).
hp Server, Storage and Foundation Agents for Linux provide a full spectrum of management data. This package includes the Server Standard Equipment and Health Agent for hp Servers. It also contains the hp Web Agent. This information is available using the hp Insight Manager Console, any Internet browser, or other management applications using SNMP.
 Il n’est pas nécessaire de rebooter mais il faut démarrer le démon hpasm :

[root@mwinf1801 ~]# /etc/init.d/hpasm start
   Starting Proliant System Health Monitor (hpasmd):
Starting Foundation Agents (cmafdtn): cmathreshd cmahostd cmapeerd
   Starting Threshold agent (cmathreshd):
   Starting Host agent (cmahostd):
   Starting SNMP Peer (cmapeerd):

Starting Server Agents (cmasvr): cmastdeqd cmahealthd
   Starting Standard Equipment agent (cmastdeqd):
   Starting Health agent (cmahealthd):

Starting Storage Agents (cmastor): cmaeventd cmaidad cmafcad cmaided cmascsid
   Starting Storage Event Logger (cmaeventd):
   Starting IDA agent (cmaidad):
   Starting FCA agent (cmafcad):
   Starting IDE agent (cmaided):
   Starting SCSI agent (cmascsid):

hpasm:  Server Management is enabled

La définition des modules se trouve dans le fichier /opt/compaq/cma.conf .
 Pour lire l’information, il faut utiliser le client HP :

[root@mwinf1801 ~]# hpasmcli -s "show temp"

Sensor   Location              Temp       Threshold
------   --------              ----       ---------
#0        SYSTEM_BD             -          -
#1        PROCESSOR_ZONE       34C/93F    62C/143F
#2        CPU#1                37C/98F    80C/176F
#3        I/O_ZONE             37C/98F    60C/140F
#4        CPU#2                40C/104F   80C/176F
#5        POWER_SUPPLY_BAY     28C/82F    53C/127F

On peut lire l’Eventlog avec la commande

[root@mwinf1801 ~]#hpasmcli -s "show iml"
Event: 0 Added: 08/26/2004 00:03
CAUTION: POST Messages - POST Error: 1785-Drive Array not Configured.

Event: 1 Added: 05/18/2005 15:45
CAUTION: POST Messages - POST Error: 1726-Drive Array - Array Accelerator Memory Size Change Detected.

Event: 2 Added: 05/18/2005 15:45
CAUTION: POST Messages - POST Error: 1794-Drive Array - Array Accelerator Battery Charge Low.

Event: 3 Added: 05/20/2005 06:20
CRITICAL: ASR - ASR Detected by System ROM.

Sur une machine quelconque sous Linux

 La solution, c’est l’ACPI (Advanced Configuration and Power Interface), sous Debian : apt-get install acpi acpid
 Il faut ensuite charger les modules kernels pour gérer la thempérature (modprobe thermal). On peut en charger d’autres , en démarrant le démon acpid :

daffy@colerpia:~$ sudo /etc/init.d/acpid start
Loading ACPI modules:
    battery
    ac
    processor
    button
    fan
    thermal
Starting Advanced Configuration and Power Interface daemon: 


 Pour lire ensuite les information :

daffy@colerpia:~$ acpi -t
     Thermal 1: ok, 51.0 degrees C

D’autres informations sont disponibles suivant le firmware, les possibilités du kernel, la gestion de la carte mère de la machine :

daffy@colerpia:~$ acpi -V
     Battery 1: charged, 100%, rate information unavailable.
     Thermal 1: ok, 50.0 degrees C
  AC Adapter 1: on-line


 L’avantage de Linux, c’est le système de fichier virtuel /proc (exemple) :

daffy@colerpia:~$ more /proc/acpi/thermal_zone/TZN0/*
::::::::::::::
/proc/acpi/thermal_zone/TZN0/cooling_mode
::::::::::::::
cooling mode:            active
::::::::::::::
/proc/acpi/thermal_zone/TZN0/polling_frequency
::::::::::::::
<polling disabled>
::::::::::::::
/proc/acpi/thermal_zone/TZN0/state
::::::::::::::
state:                   ok
::::::::::::::
/proc/acpi/thermal_zone/TZN0/temperature
::::::::::::::
temperature:             49 C
::::::::::::::
/proc/acpi/thermal_zone/TZN0/trip_points
::::::::::::::
critical (S5):           90 C
passive:                 80 C: tc1=4 tc2=3 tsp=100 devices=0xcf7ee560
active[0]:               70 C: devices=0xcf67ce60

Apendix

 Sur les vieilles machines, l’ACPI ne fonctionne pas, c’est alors l’APM (Advanced Power Management). Les informations de température ne sont alors pas disponibles :

daffy@ebola:~$ apm --verbose
APM BIOS 1.2 (kernel driver 1.16ac)
On-line, no system battery

 D’autres outils de monitoring de la gestion de l’énergie sont disponible, notamment pour les disques durs IDE , avec hdparm

daffy@ebola:~$ sudo hdparm -t /dev/hde

/dev/hde:
 Timing buffered disk reads:   68 MB in  3.09 seconds =  22.03 MB/sec

daffy@ebola:~$ sudo hdparm -i /dev/hde

/dev/hde:

 Model=QUANTUM FIREBALLP LM20.5, FwRev=A35.0700, SerialNo=884013362901
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=32256, SectSize=21298, ECCbytes=4
 BuffType=DualPortCache, BuffSize=1900kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=40132503
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 *udma4
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: ATA/ATAPI-5 T13 1321D revision 1:  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5

 * signifies the current active mode

Ou encore les lsmensors , mais si quelqu’un arrive à faire marcher ça , qu’il me fasse signe :-)


Discussions à la une

Sujet Dernier message
epingle Le script read_lom 0 , par Olivier Duquesne aka DaffyDuke
epingle Lire la température d'un serveur 0 , par greg
Forum sur abonnement

Pour participer à ce forum, vous devez vous enregistrer au préalable. Merci d’indiquer ci-dessous l’identifiant personnel qui vous a été fourni. Si vous n’êtes pas enregistré, vous devez vous inscrire.

ConnexionS’inscriremot de passe oublié ?

Publications Derniers articles publiés