09-21-2018
Hi,
I'd just included that as a demonstration of how if works, really, so you could get an idea of what you need to do in your own code. So rather than directly using my example script, you'd adapt it and write your own if statement in your script to test the value of your temperature variable, after your script had set it.
So looking at your provided code, your could write an if statement at the end to test the value of the tc variable (assuming that's correct, and it does contain just a single integer that is the number you want to test). If the variable tc isnt' the right one then you'd use whatever variable contains the CPU temperature as an integer, and do the if tests on that.
If that doesn't work then if you can provide an example of the code you've written and what goes wrong when you run it, I'd be happy to help further in debugging and we can take things from there.
9 More Discussions You Might Find Interesting
1. HP-UX
I'm fairly new to hpux, so this is what i've been trying to figure out. Is it possible to get any logs on hpux that would indicate if the system, cpu, or other hardware components reached above normal or critical temperatures?
Thanks,
-K (0 Replies)
Discussion started by: uzerx
0 Replies
2. SCO
Is there command in sco unixware 7.1.3 from which i can find the temperature of the system/hardware.
Something equivalent to prtdiag in solaris maybe
thanks (1 Reply)
Discussion started by: gsb81
1 Replies
3. Solaris
Hi all
I have a SUN V480 server with 4 processores and I've noticed that the temperature for 2 of the 4 processers are quite high (63 degrees Celsius).
Does anyone know what the operating temperatures of the Sparc CPU's are? I'm not getting any warning messages yet, but I want to resolve the... (3 Replies)
Discussion started by: soliberus
3 Replies
4. Filesystems, Disks and Memory
Hi,
I just set up a raid Z array in solaris xpress and I notice that the drives feel pretty damn hot. I use speedfan to monitor the temperatures of the hard drives in XP. Is there a similar program for solrais? I assume there would be since the drives all have temp sensors in them, but I... (2 Replies)
Discussion started by: ciscocbee
2 Replies
5. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
6. Solaris
How to get a CPU temperature and current power consumption in T5220 server both from system controller and Operating system. I need details by cores. Thanks in advance. (13 Replies)
Discussion started by: fugitive
13 Replies
7. UNIX for Dummies Questions & Answers
People hello to everybody exist a way to do a script for view the temperature. I have
Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-8 on an i686
THANk YOU FOR YOUR TIME. (4 Replies)
Discussion started by: enkei17
4 Replies
8. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
9. Solaris
some say '/usr/sfw/bin/ipmitool' can be used to read temperature. has anyone tried it? what options should be used? (1 Reply)
Discussion started by: orange47
1 Replies
LEARN ABOUT DEBIAN
mrtg-sensors
MRTG-SENSORS(1) MRTG helper utilities MRTG-SENSORS(1)
NAME
mrtg-sensors - Returns data from lm-sensors
SYNOPSIS
mrtg-sensors [-m multiplier] chip label [chip label]
DESCRIPTION
mrtg-sensors uses the lm-sensors library to query various system sensors for information such as temperature, fan speed, etc. The output is
written in a form useful as input for the mrtg utility.
Up to two pairs of chips and labels may be specified. The first is used for the incoming data value in mrtg, while the second is used for
the outgoing data value. Of course, they need not correspond to incoming or outgoing data, that is merely what mrtg expects.
"chip" is the name of the chip to query, and "label" is the label of the piece of information that should be queried from the given chip.
sensors(1) can be used to look up all available chips and labels on your system.
Wildcards may be used in chip names, but only the first matching chip will be queried.
If you use the special name "dummy" as a chip name, nothing will be queried, and a value of zero will be sent to mrtg.
-m is the multiplier to be used in the output. The default multiplier is 1. Note that you may find it more useful to use sensors.conf(5) to
set global multipliers for sensors.
EXAMPLES
mrtg-sensors dummy dummy adm9240-* fan2
Get the speed of fan #2 from the adm9240 chip.
mrtg-sensors -m 0.5 adm9240-* fan1 adm9240-* fan2
Get the speeds of both fan #1 and fan #2, halfing both.
mrtg-sensors -m 2 dummy dummy adm9240-* temp
Get the cpu termerature, and double it.
SEE ALSO
sensors(1)
sensors.conf(5)
AUTHOR
mrtg-sensors was written by Joey 'no pseudo-code' Hess <joeyh@debian.org>.
mrtgutils 0.1 2001-03-04 MRTG-SENSORS(1)