/tool sms send and sms reply with the board voltage

I wanna make a script that.. after I send a sms a script will be ran , that is what I know to do, what I do not know to do is to make a script that will read


/system health get voltage

and then send a sms back to me with that value like:

/tool sms send usb1 “9909890908” message=“The voltage is $voltage”

any help will be apreciated

thx



did it my self

:local thisbox [/system identity get name]
:global voltage [/system health get voltage]
/tool sms send usb1 “89898989089” message=“$thisbox voltage is $voltage”}


the only problem is that I do not know how to get that value /10 because my voltage is lets say 16.3 volts… and I get a sms with the value 163

can someone help me here?

thx

voltage in scripts will be always reported in dekaVolts

however if you are not interested in very precise value you can use notation like this:

:put (12 / 10)

note the spaces

ok… I`ll try and come back with results :slight_smile:


thank you


I have tryed but I do not know where do I have to put the :put


what I found is this that is working:

:local thisbox [/system identity get name]
:global voltage [/system health get voltage]
:local message ($thisbox . " voltage is " . [:pick $voltage 0 2] . “.” . [:pick $voltage 2 3])
/tool sms send usb1 “687856785” message="To $message V "

I have found this in voltage monitor script from mikrotik users scripts

but if you can adapt the :put code to this so it will be into more simplier form I guess…it will be great

thx