Hello,
I am trying to work on a temperature script to check temperatures on my systems. Im trying to get the basics laid out first. So far i have a command:
/usr/sbin/prtpicl -v -c temperature-sensor # (must run as root)
This command kicks back alot of information but i only want the Sensor Name and Temperature from it. So i tried the command:
/usr/sbin/prtpicl -v -c temperature-sensor | grep Temperature
This kicks back all the temps from the sensors but no sensor names. Is there a way to grep the sensor name and also the temperature that it associates with or just grab the Front_panel sensor and temperature.
The above code is a rough layout of what is displayed for all sensors. So there is like 9 sensors in my workstations. So i dont know how to pull the temp out of the middle one lets say that relates to sensor 5.
I want my output to be like this
SensorName - Temperature
_frt_panel - 50
_side_pane - 75
If you run the command:
/usr/sbin/prtpicl -v -c temperature-sensor | grep Temperature
You get the following results
Temperature 54
Temperature 75
Temperature 53
Temperature 50
Temperature 48
Since the sensors have different names i cant grep that and the temperature that corresponds with it for example lets say Temperature 75 above is from frt_panel how do i pull that sensor and temp when the Temperature is the same wording as other sensors.