Script for monitoring HP server CPU temperature

Source: Internet
Author: User
Tags hp server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.