I would like to automatically shut down (with ssh command) my NAS server when the voltage on my 2011UAS-2HnD goes below 11.5V
I can do it from the winbox, but I would like to write a script that would do this automatically.
anyone?
Still on the 2011UAS-2HnD add an scheduler and interval (here 5 seconds) set to you what you want:
add disabled=no interval=5s name=ShutdownOnUndervoltage on-event=":if ([/system health get voltage] < 115) do={/system shutdown};" policy=\
reboot,read,write,policy,test,sniff,romon start-date=jan/01/1970 start-time=00:00:00
I made it easy, copy and paste the code into the terminal windows of Winbox. Please check it if all is right.
I either expressed myswlf incorrectly, or you didn’t understand me ![]()
I know how to turn off RB at low power. What I want to achieve this is when the voltage drops I want to connect from my rb2011 to my NAS server via ssh, and turn off this server so it will not work on the battery.
I can log in via SSH and power it off, but can I add this script to the scheduler? Ssh connection is waiting for password - how to pass it in the scheduler script?
Does SSH here does not support by certificate??
Does: https://forum.mikrotik.com/posting.php?mode=quote&f=9&p=301291
I try to log in to ma NAS server (Synology DSM 5.2-5644) i don;t see oprion to generate publick ssh key. ![]()
Never looked at doing this, however I am intrigued by it.
I do believe you would have to handle the authentication with certs.
What NAS are you using?
its my old pc with XPEnoboot.
Pasting links does no always works so I am going to point you two the Wiki for a start:
To complete it from the Mikrotik and get around the script looking for a password, you would need to import a cert for your NAS
If it was me, I would have PRTG monitor your Mikrotik via SNMP, and then when it records the voltage go below your threshold, call a shutdown script on your NAS.
What is the application here? UPS?