Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Export system temperature to variable Post 302219630 by jmakita on Tuesday 29th of July 2008 05:03:08 PM
Old 07-29-2008
Bug Resolved temperature in Unix servers.

That worked, thank you both!

I found perhaps a more streamlined approach than before.
Here is the final code. Using rsh, I also grabbed the temperatures of the other Unix servers in the room.

Thanks again for the help, it really pointed me in the right direction!

#! /bin/ksh
clear
echo
echo Current Server2 Temperature:
curt2=$(rsh -l mfg Server2 /sbin/sysconfig -q envmon env_current_temp |grep -v envmon |cut -b20-21)
fdeg2=$(echo "scale=2; ($curt2*9/5) +32" | bc -l)
kdeg2=$(echo "scale=2; ($curt2+273.15)" | bc -l)
echo "$curt2 Celsius $fdeg2 Fahrenheit $kdeg2 Kelvin"
echo
echo Current Server7 Temperature:
curt7=$(rsh -l mfg Server7 /sbin/sysconfig -q envmon env_current_temp |grep -v envmon |cut -b20-21)
fdeg7=$(echo "scale=2; ($curt7*9/5) +32" | bc -l)
kdeg7=$(echo "scale=2; ($curt7+273.15)" | bc -l)
echo "$curt7 Celsius $fdeg7 Fahrenheit $kdeg7 Kelvin"
echo
echo Current Server8 Temperature:
curt8=$(rsh -l mfg Server8 /sbin/sysconfig -q envmon env_current_temp |grep -v envmon |cut -b20-21)
fdeg8=$(echo "scale=2; ($curt8*9/5) +32" | bc -l)
kdeg8=$(echo "scale=2; ($curt8+273.15)" | bc -l)
echo "$curt8 Celsius $fdeg8 Fahrenheit $kdeg8 Kelvin"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Syntax to export any variable

How to export variables on a UNIX prompt. Please provide me syntax. Thanks in advance. Malay (5 Replies)
Discussion started by: malaymaru
5 Replies

2. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

3. Filesystems, Disks and Memory

Is it possible to re-export a exported NFS file system?

Hi... Is it possible to re-export a exported NFS file system? If no, Why? Let me know, if any further details are required about the question. Thanks in advance Adams:) (5 Replies)
Discussion started by: Adams Nave
5 Replies

4. Filesystems, Disks and Memory

Export a file system with write permissions

Hi, Is there a way we can export a file system with write permissions for only one user. For eg. we have many users on the network, but only user2 should have write permissions on the exported file system and for others it should be read-only. (7 Replies)
Discussion started by: jredx
7 Replies

5. Shell Programming and Scripting

Export Variable

How to export variable from one script to other? Can anybody give me syntax for that? Thanks (2 Replies)
Discussion started by: navi
2 Replies

6. Shell Programming and Scripting

Export variable

Hi I have a pass a variable from one script to another. Here are my scripts Script #1 ./profile #!/bin/sh export NAME="Hello" Script #2 ./test #!/bin/sh ./profile echo $NAME when I run ./test .. i am not getting anything .. why is that? (5 Replies)
Discussion started by: arex876
5 Replies

7. Shell Programming and Scripting

where does variable export to?

Hi, Unix Gurus, I have a problem need help. I have a script to generate environment variable code same as following: oracle_sid=abcd export oracle_sid when I execute this code with command ./script_nane it succeeded. when I try to find it with env command or echo $oracle_sid, it does not show... (5 Replies)
Discussion started by: ken002
5 Replies

8. Shell Programming and Scripting

help t export the variable from a particular file

Hello Guys, I need you help to do one task I have script which is actually doing to fetch the code of any repository in svn for e.g.:- I can use svn to checkout the repository but I want to checkout the repository for particular tag like svn co <url>/svn/repo/<tag-name> and this... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

9. Shell Programming and Scripting

Can't export variable

I am relatively new to exporting variables, and I just can't seem to make this count work. What I have is the following: TOTAL=$($IMAGELIST -backupid $IM -U |gawk '{print $5}' |tail -1)|gawk '{print $6}' RESTORED=$($BPDBJOBS -most_columns -jobid $JOBS |cut -f15 -d,) |gawk '{print $6}' export... (7 Replies)
Discussion started by: newbie2010
7 Replies

10. UNIX for Advanced & Expert Users

Need help export variable

Hi, Please find my code below. ps -xef | grep 14766 | awk 'BEGIN{X="java_home=";X="weblogic_home="} {for(i=1;i<=NF;i++){if($i ~ /-Dplatform\.home|java$/){split($i,P,"=");s=P?P:$i;print X""s}}}' echo "java_home="$java_home echo "weblogic_home="$weblogic_home Output: Why does... (3 Replies)
Discussion started by: mohtashims
3 Replies
APS(4)							   BSD Kernel Interfaces Manual 						    APS(4)

NAME
aps -- ThinkPad Active Protection System accelerometer SYNOPSIS
aps0 at isa? port 0x1600 DESCRIPTION
The aps driver provides support for several sensors found in some ThinkPad laptops. The sensors currently exposed via the envsys(4) interface are: Sensor Units Typical Use x-acceleration integer X-axis acceleration y-acceleration integer Y-axis acceleration x-variable integer Weighted X acceleration? y-variable integer Weighted Y acceleration? temperature 1 degC Unknown temperature temperature 2 degC Unknown temperature keyboard active boolean Keyboard activity mouse active boolean Mouse activity lid open boolean Lid state SEE ALSO
envsys(4), hpacel(4), thinkpad(4), envstat(8) HISTORY
The aps driver first appeared in OpenBSD 3.8 and was then ported to NetBSD 5.0. AUTHORS
The aps driver was written by Jonathan Gray <jsg@openbsd.org>. CAVEATS
Few issues can be mentioned. o The aps driver does not maintain state and subsequently does not take evasive action when it thinks the hard drive is in danger. Possi- ble actions would include spinning down the hard drive in case excessive tremor is detected by the sensors. o The Y axis on X40 and possibly other models seems to be inverted. It is unknown how to distinguish between different versions of the accelerometer to compensate for this in the driver at this time. o The sensor values are refreshed every 0.5 seconds. Because no protection measures are taken, this is unnecessary and may have a negative effect on battery life. o As IBM provides no documentation, it is not known what all the available sensors are used for. BSD
July 13, 2011 BSD
All times are GMT -4. The time now is 04:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy