Good job, jpor!
I learning about a new tool, and this one's especially timely because I've got an H50 that's about to be moved to a computer room with HVAC that I'm not 100% confident in.
Playing around with it, I think you'll find that you can avoid all of that grepping and cutting with the following:
kount=`/usr/lpp/diagnostics/bin/uesensor -t 3 -i 0 -v`
In case the arguments need to be different on your machine, here's how I found them for mine:
Code:
/usr/lpp/diagnostics/bin#./uesensor -a
3 0 11 30 P2
3 1 11 29 P2
9001 0 11 1410 F1
9001 1 11 1440 F2
9001 2 11 1350 F3
9001 3 11 1470 F4
9001 4 11 1770 F5
9001 5 11 1710 F6
9001 6 11 1440 F7
9002 0 11 5032 P2
9002 1 11 3427 P2
9002 2 11 5032 P2
9002 3 11 12077 P2
9002 4 11 -11767 P2
9004 0 11 3 P2
9004 1 11 3 P2
/usr/lpp/diagnostics/bin#./uesensor -?
./uesensor: illegal option -- ?
Usage: uesensor -l | -a
uesensor -t token -i index [-v]
Using the commands terminology, the first column is token, the second is index, the third is status (prints without -v flag), the fourth is value (prints with -v flag), and fifth is location (only prints with -l or -a flags.)
By comparing the "-l" output to the "-a" ouput, you should be able to find the proper arguments to plug into the "-t token -i index -v" command for your machine and particular temperature sensor.
Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L