cant get cpu temperature in script

Hello

I'm having some trouble figuring this out. This is a RB5009

On the terminal:
/system health print
Columns: NAME, VALUE, TYPE

NAME VALUE TYPE

0 cpu-temperature 54 C

/system health get number=0
[nothing]

/system health get value-name=temperature (just to show that doesn't work)
input does not match any value of value-name

/system health get value-name=cpu-temperature
input does not match any value of value-name

Script:
:log info "$[/system identity get name] $[/system health print] testing";
outputs: router testing

How can get router temperature in a script?

Thank you

Have a read overhere: http://forum.mikrotik.com/t/voltage-monitoring-in-ros-v-7-and-send-message-to-telegram/168752/1

The correct syntax would have been /system/health get “cpu-temperature” value if the RouterOS programmers had made one thing uniform with everything else.

But since “cpu-temperature” is not already solved like other sections, [find where name=cpu-temperature] is needed.

So, the needed command line is:

{
    :local cputemp [/system/health get [find where name=cpu-temperature] value]
    :put $cputemp
}

REX:
How do I make the script appear in green letters like you do. Thanks for teaching.

Use the “code display” button

or manually…

script

Thank you Rex. I see it now.