Sponsored Content
Full Discussion: Test temperature and alert
Top Forums Shell Programming and Scripting Test temperature and alert Post 303023759 by tomislav91 on Friday 21st of September 2018 05:15:28 PM
Old 09-21-2018
It gives me

Quote:
bash get_cpu_temp.sh
44.55
get_cpu_temp.sh: line 25: [: tc: integer expression expected
Oh no, it's greater than 90 !
this is a part of code
Code:
tc=$(echo "scale=2;(5/9)*($avg_cpu_temp-32)"|bc)
echo $tc
if [ "tc" -le "90" ]
then
        echo "Less than or equal to 90, so that's OK"
        exit 0
else
        echo "Oh no, it's greater than 90 !"
        exit 1
fi

 

9 More Discussions You Might Find Interesting

1. HP-UX

temperature records

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

temperature monitor

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

CPU temperature

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

Hard Drive Temperature?

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

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

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

CPU Temperature Details

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

MAKING A SCRIPT FOR TEMPERATURE

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

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

reading temperature again and ipmitool

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
LM75(4) 						   BSD Kernel Interfaces Manual 						   LM75(4)

NAME
lm75 -- lm75 i2c digital temperature sensor driver SYNOPSIS
device iic device iicbus device lm75 DESCRIPTION
The lm75 driver provides access to sensor data and configuration over the iicbus(4). It provides an easy and simple way to check the functionality of an i2c bus as it provides read and write access to the lm75 configuration register. The access to lm75 data is made via the sysctl(8) interface: dev.lm75.0.%desc: LM75 temperature sensor dev.lm75.0.%driver: lm75 dev.lm75.0.%location: addr=0x49 dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75 dev.lm75.0.%parent: iicbus3 dev.lm75.0.temperature: 27.1C dev.lm75.0.thyst: 75.0C dev.lm75.0.tos: 80.0C dev.lm75.0.faults: 1 dev.lm75.0.mode: comparator dev.lm75.0.polarity: active-low dev.lm75.0.shutdown: 0 dev.lm75.%d.temperature Is the read-only value of the current temperature read by the sensor. dev.lm75.%d.thyst Sets the hysteresis temperature. Once the temperature gets over the overtemperature shutdown value (tos) it needs to drop below the hysteresis temperature to disable the output (interrupt) pin again. dev.lm75.%d.tos Sets the overtemperature shutdown value. Once the temperature gets over this value the output pin will be enabled. The way the output (interrupt) pin works, depends on the mode configuration. dev.lm75.%d.faults Is the number of faults that must occur consecutively to activate the interrupt (output) pin. It can be set to 1, 2, 4, and 6. dev.lm75.%d.mode Sets the operation mode for the sensor interrupt pin. It can be set to 'comparator' (default) or 'interrupt'. dev.lm75.%d.polarity Sets the polarity of the sensor interrupt pin. It can be set to 'active-low' (default) or 'active-high'. Please note that the output pin is an open-drain output and it needs a proper pull-up resistor to work. dev.lm75.%d.shutdown When set to '1' it shuts down the sensor. The temperature conversion stops but the sensor remains with its i2c bus active, i.e., it can be woken up by setting this option to '0' again. Please check the lm75 datasheet for more details. When used together with snmp_lm75(3) it allows the monitoring of lm75 temperature data over SNMP. The lm75 driver supports both the low and the high resolution models. The low resolution model (lm75) provides a 9 bit output with the LSB representing 0.5C. The high resolution model (lm75a) provides an 11 bit output with the LSB representing 0.125C. The driver tries to auto-detect the lm75 model, but the detection of some lm75 clones may not work reliably. On a device.hints(5) based system, like MIPS, these values are configurable for lm75: hint.lm75.%d.at Is the iicbus(4) you are attaching to. hint.lm75.%d.addr Is the lm75 i2c address on the iicbus(4). On a FDT(4) based system, like ARM, the DTS part for a lm75 device usually looks like: i2c { ... lm750 { compatible = "national,lm75"; i2c-address = <0x49>; }; }; Where: compatible Should always be set to "national,lm75". i2c-address The i2c-address property indicates which i2c address the lm75 is wired at. lm75 temperature sensors can be wired to 8 different addresses, allowing up to 8 sensors on the same iicbus(4). SEE ALSO
snmp_lm75(3), fdt(4), iic(4), iicbus(4), sysctl(8) HISTORY
The lm75 driver first appeared in FreeBSD 11.0. AUTHORS
The lm75 driver and this manual page were written by Luiz Otavio O Souza <loos@FreeBSD.org>. BSD
May 11, 2014 BSD
All times are GMT -4. The time now is 07:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy