voltage moniroting

need a script that send me email or sms when voltage is below 20V
how can it be done ?
thanks

Hello

this is one I use for monitoring temperature. Just modify it to check voltage instead. It also logs the values to the log file.

Of course change the email settings to suit.

:log info ([/system health get temperature])
:if ([/system health get temperature] > 38) do={/tool e-mail send to="your_email@somewhere" subject=[/system identity get name] body="High Temp Alarm. Current temperature is: $[/system health get temperature]"}

You will need to set and test the settings in Tools → email before emails will be sent.

Hmmmm, ok and after I add this script in terminal where i can found it if i want to remove ?
Thanks …
Best regards

this mean if voltage above 38 the RouterBoard will send me email ?

yes that is correct.

I chose 38 degrees as an arbitrary value as a high temp value. Of course if you have a 24V supply, you would change the value to something less than 24.

I forgot to mention to setup a schedule to run the script regularly.

system → scheduler

I ran my script every 30mins.

Yes Thanks, but one more thing I need,
which smtp server you use ?
Thanks.

I use the SMTP server provided by my email hosting service. They have config details for authenticated SMTP.

Have a look at trying to use google SMTP. There should be enough info on google to find out how to do it.