Advertisement
Guest User

MIKROTIK MONITORAGGIO BATTERIA

a guest
Sep 13th, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. #set lowvoltalarm to desired alarm voltage in tenths of a volt. 125 = 12.5v
  2. :global lowvoltalarm 115
  3. :global highvoltalarm 140
  4. :global highvolt
  5. :global lowvolt
  6. :global starttime
  7. :global hivolttime
  8. :global lovolttime
  9. :global vh
  10. :local thisbox [/system identity get name]
  11. :global voltage [/system health get voltage]
  12. :local thistime [/system clock get time]
  13. :local thisdate [/system clock get date]
  14. :local thishour [:pick $thistime 0 2]
  15. :local emessage ($thisbox . " voltage is: " . [:pick $voltage 0 2] . "." . [:pick $voltage 2 3])
  16. :if ([:len $lowvolt] < 1) do={:set lowvolt 999; :set highvolt 0}
  17.  
  18. # set your email address in the next line
  19. :if ($voltage <= $lowvoltalarm) do={/tool e-mail send to="hhhhh0@hotmail.it" subject="$thisbox FORD - Tensione Batteria Bassa" body=$emessage}
  20. :delay 10s
  21. :if ($voltage <= $lowvoltalarm) do={/system shutdown}
  22. :if ($voltage >= $highvoltalarm) do={/tool e-mail send to="hhhhh@hotmail.it" subject="$thisbox Sovratensione Batteria" body=$emessage}
  23. :if ($voltage > $highvolt) do={:set highvolt $voltage; :set hivolttime ($thistime . " " . $thisdate)}
  24. :if ($voltage < $lowvolt) do={:set lowvolt $voltage; :set lovolttime ($thistime . " " . $thisdate)}
  25. :if ([:len $vh] > 0) do={:set vh ([:toarray $voltage] + $vh)} else={:set vh [:toarray $voltage]}
  26. :if ([:len $starttime] < 1) do={:set starttime ($thistime . " " . $thisdate)}
  27. :if ($thishour = "23") do={:execute voltreport}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement