Re: temperature
- From: Damir Delija <ddelija@xxxxxxxxxxxxxx>
- Date: Thu, 10 Aug 2006 07:04:39 +0200
On Wed, Aug 09, 2006 at 01:27:42PM -0700, Bill Verzal wrote:
Run /usr/lpp/diagnostics/bin/uesensor -l
If it is supported on your system, it will show you environmental sensors.
BV
you can start temp monitoring
to see what is going on
there is no uesensor class in RMC but
you can use my old script published in sysadmin magazine
#!/usr/bin/ksh
#############################################################
#Sri 20 Stu 2002 13:37:24
#PBZ HR
#temp monitoring script
#version 0.0.1-D
#
#Author: Damir Delija ddelija@xxxxxx
#############################################################
# FILE NAME: temperature
# FILE DESCRIPTION: crontab tester based on bb-scripts
#
# RETURN VALUE DESCRIPTION:
# 0 sucess
# 1 failure
#
# EXTERNAL PROCEDURES CALLED:
#
# OPERATIONS
#
# this is based on standard df-k monitors from various sources
# script just control if there is limit violation
#
# CONTROL
# there is no control
#
# USAGE add into crontab and configure parameters
#
# QUIRCS
# if machine is in LPAR mode this not works
#
############################################################
#Revison history
#0.0.1-D just working with usensors
############################################################
export PATH=/bin:/usr/local/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/sbin
BASEDIR=/rootop
CONFDIR=$BASEDIR
LOGDIR=$BASEDIR/logs
##########################################################
# testing and creating directories nesecarry
# for script operation
##########################################################
for d in $CONFDIR $LOGDIR
do
if test ! -d "$d"
then
mkdir -p $d || exit 1
fi
done
#############################################################
#work files
#############################################################
HOST=$(hostname)
#############################################################
#logs and event data
#in DF last df-k data is stored
#############################################################
DF=$LOGDIR/temp
#############################################################
#event, or two last messages cretaed
#############################################################
EV=$LOGDIR/event.temp
EVO=$LOGDIR/event.temp.old
#############################################################
#Notification info
#############################################################
#if LOGFILE exists message is automatically added to it
LOGFILE=$LOGDIR/$HOST.temp.log
#email where report is sent
DFADMIN=root
#logger syslog level to log message
SYSLOG="notice"
#to dump message on stdout
ECHO="echo"
#to send snmptrap -just for future use
SNMPTRAP=""
#BigBrother
BB="echo"
BBDISP=" ..."
######################################################
#sennsor control command on AIX
#f there is no capability exit
######################################################
SENS="/usr/lpp/diagnostics/bin/uesensor"
test -x $SENS || exit 2
######################################################
# MAXTEMP - value for alarm
######################################################
MAXTEMP=36
######################################################
#set the message and global action variable
#if ACTION is > 0 it means do action
######################################################
MESSAGE="$HOST :"
ACTION=0
MM="$MESSAGE"
#real data collection
$DF#snashot of the status ... just FS and data percentage,
################################################
#walk trough df and test conditions
#FS loop
################################################
$SENS -a| while read token index status val lcode
do
MM=$MM" $lcode $val"
if test "$token" -eq 3 -a "$val" -gt "$MAXTEMP"
then
ACTION=1
MESSAGE=$MESSAGE"\n $lcode $val"
fi
done
######################################################
# end of the tempread loop
######################################################
#patch for mandatory logging
logger "TEMPERATURE $MM"
echo "ENVSTATUS $MM"
######################################################
#store the latest event and one previous
######################################################
test -f "$EV" && mv "$EV" "$EVO"
touch "$EVO"
echo "$MESSAGE" > "$EV"
#EVENTS are same - no sending messages just to AVOID flodding
diff "$EV" "$EVO" > /dev/null 2>&1 && exit 0
#if loop because of posible case later ...
if [ "$ACTION" -gt 0 ]
then
######################################################
#notification
#if there is email adress send email
#if syslog do syslog
#if echo dump on the screen
######################################################
#remove \n form subjet line outlook problem ..
SUBJECT=$(echo "$MESSAGE"| sed 's/\\n/ /g')
if test -n "$SYSLOG"
then
logger -p"$SYSLOG" "TEMPERATURE $SUBJECT"
fi
if test -n "$LOGFILE"
then
{
date
echo "$MESSAGE"
echo "###############################"
} >> "$LOGFILE"
fi
#use printf to expand \n in message old trick ..
if test -n "$DFADMIN"
then
printf "$MESSAGE" ""| mail -s "TEMPERATURE OVER LIMIT $MAXTEMP C $SUBJECT" "$DFADMIN"
fi
if test -n "$ECHO"
then
date
echo "$MESSAGE"
echo "###############################"
fi
fi
###################################################
#end of fi loop
###################################################
exit 0
# end temperature
- References:
- temperature
- From: Dave Zarnoch
- Re: temperature
- From: Bill Verzal
- temperature
- Prev by Date: Ranbir Singh is Out of the Office
- Next by Date: Re: How do you set up a X server on AIX?
- Previous by thread: Re: temperature
- Next by thread: Mounting a Windows Share
- Index(es):
Relevant Pages
|
|