Help with Temperature Script (Starting

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.

Thanks in advance.

Please show us the output you have as well as the output you need

We may then be able to help you to parse the output to get the intended result

If you run

/usr/sbin/prtpicl -v -c temperature-sensor #   (must run as root) 

You get output like this

sensor1 (temperature-sensor, 00000000)
:_frt_panel (00000000)
:Label: cpu0-sensor
:XX
:XX
:Temperature 54
sensor2 (temperature-sensor, 00000000)
:_side_panel (00000000)
:Label: cpu0-sensor
:XX
:XX
:Temperature 75

Repeats with all sensors

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.

Could you please

  1. Give an example of output with more than one sensore

  2. Provide a consistent example (the output you gave in your example has nothing to do with the output given above ) did you mean :

_frt_panel - 54

?