Re: temperature



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



Relevant Pages

  • Re: 2.6.16-rc4: known regressions
    ... either with a command line argument, or with just the early bootup initrd ... Is there a way to tell the kernel about which is the root device other ... a loop with one second delay. ... echo -n "Waiting for root device to appear" ...
    (Linux-Kernel)
  • Re: [PHP] 2 errors I can not understand
    ... echo is not a function. ... multiple args is probably insignificant, ... and super-long loop... ... function isprime ...
    (php.general)
  • Re: Speaking of SONAR...
    ... I like the echo on the vocal, but I think it interferes with itself at ... The envelope can control most any ... you could have the delay be off (mix is ... Once you figure out automation and how to edit the ...
    (alt.guitar)
  • Re: Whats wrong the the logic in this code?
    ... ##echo $search here outputs the new value, ... ORDER BY '$sort' ASC"; ... You're problem is you are setting $q each time through the loop, then using it outside of the loop. ... If $search matched the last state in your list, you would get the value from your "then" clause. ...
    (comp.lang.php)
  • Re: Slow bash script
    ... getting only about one iteration per second in the while loop. ... It extracts md5sums from a 180k Packages file and makes an indices file. ... do echo "input line is " $inputline ...
    (Debian-User)