Script for monitoring HP Server CPU temperature:
#!/bin/bash
Name= ' hostname '
ip= '/sbin/ifconfig eth0 | grep "inet addr" | awk-f[: ""]+ ' {print $4} '
Date= ' Date +%m%d%y '
date2= ' Date +%h:%m '
Num= '/usr/sbin/dmidecode | Grep-i ' Serial number ' | Head-n 1 '
Cpu1= '/sbin/hpasmcli-s ' Show temp ' | grep cpu#2 | awk-f[: "]+ ' {print $} ' | Cut-b 1-2 '
Cpu2= '/sbin/hpasmcli-s ' Show temp ' | grep cpu#3 | awk-f[: "]+ ' {print $} ' | Cut-b 1-2 '
Cpu3=60
If [$ (echo) $CPU 1 > $CPU 3 "| BC)-eq 1] | | [$ (echo "$CPU 2 > $CPU 3" | BC)-EQ 1]
Then
/usr/bin/touch/log/cpu/hot.log
/bin/echo "$Name ($IP) CPU1 is $CPU 1 C and CPU2 are $CPU 2 C at $Date 2" >/log/cpu/hot.log
/usr/bin/mail-s "$Name ($IP) Load is $Load" [email protected] </log/load/$Date. Log
Fi
This article is from the "Linux" blog, so be sure to keep this source http://yangzhiming.blog.51cto.com/4849999/1701323
Script for monitoring HP server CPU temperature