hi @ all,
has anyone done this ? having the voltage monitored via script and send an email to an admin if the voltage is over or below a certain value ? i don’t have much of a clue about scripting, thats why i am asking.
regards
Jan
hi @ all,
has anyone done this ? having the voltage monitored via script and send an email to an admin if the voltage is over or below a certain value ? i don’t have much of a clue about scripting, thats why i am asking.
regards
Jan
This is an excellent question, can RouterOS give us the data of input volts on RB’s WRAP’s etc?
RB333 shows voltage, but RB532(& A) always show 0v. I think only RB112 can show temp as well.
Well if you Run an RB33 And it can monitor the voltage, Yes i do beleive that you can make a script and send it in the e-mail letting you know you only have like 25 % of a battery left. Or whatever percent you wish… Im not sure if i could make the script but maybe MRZ can.. Im just pretty sure it is possible, as long as you can go into your terminal and do a /print and get the Percentage you should beable to send that prinout in an e-mail. You just have to configure the script correctly… -Jordan
Where does the RB333 show this information?
I believe you have to have a Power Backup unit hooked up, and the serial cable connected to the routerboard for you to get this Information. If you look in the manual it has something about these, It is on the very bottom. You have to have that certain package and everything right, and you can monitor your Backup power source Percentage of battery left.. May be wrong. Its just what i heard. -Jordan
/system health print
Maybe this solve it for you ?
/system health
:if ([get voltage]<200) do={/tool e-mail send to="abc@abc.no" subject="low voltage" from="333 board x"} else {:log info "voltage ok"}
This scripts sends a warning if the volt drops under 20 (200 value)
-email server must be set before script runs
Maybe this solve it for you ?
/system health :if ([get voltage]<200) do={/tool e-mail send to="abc@abc.no" subject="low voltage" from="333 board x"} else {:log info "voltage ok"}This scripts sends a warning if the volt drops under 20 (200 value)
-email server must be set before script runs
Told you it was possible.
I beleive you have to have a set: server or set [resolve] to direct to the smtp server or e-mail server… -Jordan
Yeah I changed it a bit to make it abit better:
/system health
:if ([get voltage]<200) do={/tool e-mail send server=x.x.x.x to=your@email.no subject=[/system identity get name] from="routerboard" body=("Low voltage. Current voltage is :".[/system health get voltage])} else {:log info "Voltage is ok."}
where x.x.x.x = ip to your smtp server.
Then just make a scheduler to run the script whenever you want it to.. You could do /10 to after get voltage, but then it will be shown without decimals. ie it would say 19 even if voltage was 19.9. The from email address may be changed to match you to address
that email script is cool. i have realized the whole thing in a different way. i have nagios polling the voltage via snmp and give an alarm via email and sms if the voltage is out of normal values. that work fine for me.
Jan
that email script is cool. i have realized the whole thing in a different way. i have nagios polling the voltage via snmp and give an alarm via email and sms if the voltage is out of normal values. that work fine for me.
Jan
Hi snoozer, can u share the script?
When I implement this script and run it I keep getting an error message in the log:
system e-mail error - Error sending e-mail: abnormal termination (timeout)
The script I am using is:
/system health
:if ([get voltage]<110) do={/tool e-mail send server=x.x.x.x to=winbox@myisp.com subject=[/system identity get name] from=“myRB@myisp.com” body=(“Low voltage. Current voltage is :”.[/system health get voltage])} else {:log info “Voltage is ok.”}
I want the board to let me know if power drops below 11V, I am running it on an alternative energy site with 12V batteries.
It is not an error with the mail server as I alreday have the box mailing me a backup file once a week, also it is an RB433 rather then an RB333 which the script was originally written for but I wouldn’t have thought that would make a difference.
Can anyone see what I am doing wrong???
(I do actually have my mail server address in in place of the x.x.x.x but don’t really want to post its address!)
Thanks
Sounds like the timeout is the email server not responding.
BTW, here is my script in the wiki:
http://wiki.mikrotik.com/wiki/Monitor_input_voltage_on_RB333/433AH
You might be able to use parts of it.
Can anyone tell me how to run a voltage monitor script and send the output to a readable file or to the mikrotik logs. The reason is I cannot get the clients email to work from this radio.
thanks
Rob
Your ISP should have an email “smart host” that will relay email from their ip set. Call and ask. I have one. So does Cox Communications (one of my providers). Use that as your email server in the setup in the MikroTik box. Then your email should go out ok.
its more to do with the customers network and me not having control to sort this out. I just need a command to run on their RB433 that will show the voltage input to the board in either a log or on the screen when I run the command manually.
ta
Rob
You can save this script as “voltlog”, then schedule it to run every hour. Puts the voltage in the log instead of email. Only works with RB units that have voltage monitor (RB333, RB433AH, etc.).
:global voltage [/system health get voltage]
:local emessage ("Voltage is " . [:pick $voltage 0 2] . "." . [:pick $voltage 2 3])
:log info $emessage
Is there a script that will get the voltage from an RB433 as this script does not give a value.
thanks
Rob
The RB433 does not have voltage monitor. ![]()
I have asked repeatedly for this feature in the 433. Maybe RouterBoard does not realize how many challenges are caused by bad power. This feature makes it SO EASY to troubleshoot these problems that others blame on the hardware/OS.
PS: Are you reading this normis?