Community discussions

MikroTik App
 
DuncanCT
newbie
Topic Author
Posts: 28
Joined: Thu May 24, 2018 1:28 pm

'Find' in ROS7

Thu Aug 25, 2022 12:36 pm

This is from 'MQTT with script scenario' from here... 'https://help.mikrotik.com/docs/pages/vi ... d=41680915'

The script contains this section...
# Health is a bit iffy since '/system health' does not have 'find' in ROS6
:local health [/system health print as-value]
:local supplyVoltage 0
:local boardTemp 0
:foreach entry in=$health do={
    :if ($entry->"name" = "voltage") do={:set $supplyVoltage ($entry->"value")}
    :if ($entry->"name" = "board-temperature1") do={:set $boardTemp ($entry->"value")}
}

I am looking for some clarity on the "Health is a bit iffy since '/system health' does not have 'find' in ROS6". Is this script written to be backwards compatible with ROS6? Can it be improved if being used with ROS7?

Thanks in advance.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: 'Find' in ROS7

Thu Aug 25, 2022 2:05 pm

Who is online

Users browsing this forum: No registered users and 23 guests