I will try to get all the useful links to threads to look at when some script is needed, that is not yet in wiki or is in wiki, just to get them not buried under loads other posts.
Check time of the post, to make some link to RouterOS version these where created for.
thank you janisk. It also useful to mention the RouterOS version that the script work with because sometimes I found old scripts for v2.9 and they don’t work with v4.14
in that case take CLI script editor (inside RouterOS) and edit script in there. Most of the syntax changes can be caught using that. F5 to refresh highlighting.
Hi guys
Why the scrip does not work?!
set[/ip route find dst 0.0.0.0] gateway 10.0.0.1
this command mentioned in wiki.mikrotik: http://wiki.mikrotik.com/wiki/Manual:Tools/Netwatch
after enter the command, notting happen and the default route doesn’t change.
I want to write a script to change the default route gateway.
I don’t know where to post this but this is by far the best place to post it. Basically what the script does is that it will check for dynamic leases on my dhcp server, take their mac addresses and check it against firewall filter. If it’s not there it will add it and drop everything that’s coming from those mac addresses. I’m using this to prevent users from using my internet bandwidth without prior permission and they just happen to know my wireless key from a colleague.
Hallo,
i made this simple script in order to backup daily the router settings and usermanager database, using sd-card as buffer in order to reduce router nand’s use.
It is especially useful when yuo plan to enlarge usermanager database until gigabyte size, making backup into router’s nand not more possible.
I’ll write also another script to “rebuild” database and logs every week, to reduce backup’s size.
This script will erase always the same two files, in order to have always the last good version in ftp.
#automated System
:log info message=System_Export_started;
:local exportname ([/system identity get name].“.rsc”);
:local UMname ([/system identity get name].“.umb”);
export compact file=micro-sd/exportSy.rsc;
/tool user-manager database save name=micro-sd/backupUM.umb;
:log info message=System_Export_finished;
Here’s one I just wrote to centrally push new (beta) firmwares to our CAPsMAN managed Wireless system in a batch:
/system script
add name=pushupdate policy=ftp,read,write,policy,test,winbox,password,sniff,sensitive,api source="
:foreach i in=[/ip firewall address-list find list=accesspoints] do={
[/tool fetch address=[/ip firewall address-list get $i address] mode=ftp user=login password=password src-path=updates/wireless-fp-6.13rc7-mipsbe.npk dst-path=wireless-fp-6.13rc7-mipsbe.npk upload=yes];
[/tool fetch address=[/ip firewall address-list get $i address] mode=ftp user=login password=password src-path=updates/routeros-mipsbe-6.13rc7.npk dst-path=routeros-mipsbe-6.13rc7.npk upload=yes];
[/tool fetch address=[/ip firewall address-list get $i address] mode=ftp user=login password=password src-path=updates/reboot.rsc dst-path=reboot.auto.rsc upload=yes];
}I have all the Access Points in the address list “accesspoints”.
The filenames are hard coded on purpose to keep an eye on the versions.
The reboot.rsc script looks like this:
:file remove reboot.auto.rsc
:log warning “Firmware upgrade initiated”
:delay 1s
:system reboot…(Warnings and errors are logged to disk, everything else to memory only, this is why I issue a warning).
In case anything goes wrong, I have a downgrade script with 6.12 in place as well.
The reboot script then invokes /system package downgrade instead of reboot.
Looking to edit my Voltage report script I have been using, currently it is set to send email of report daily at 11pm, I am trying to change to 8am but I have been getting negative hour results such as -1 -2 -3 etc. I made two changes and am going to see what happens tomorrow but if you know of simple way to fix please let me know- below is the script I been using from the site (2 scripts). I am not script smart but am trying to figure some of this out, just would like reports at 8am rather than 11pm
I changed a line below from 23 - $x to 08 + $x in hopes to get positive numbers
Did you get your voltage monitoring script to work on 6.33.5?
I also have a similar votage monitoring script to yours, i have it working great on 6.29,
but i cannot get it to work on any version higher than 6.30…
Here is my script:
#set lowvoltalarm to desired alarm voltage in tenths of a volt. 125 = 12.5v
:global lowvoltalarm 200
:global highvoltalarm 280
:global highvolt
:global lowvolt
:global starttime
:global hivolttime
:global lovolttime
:global vh
:local thisbox [/system identity get name]
:global voltage [/system health get voltage]
:local thistime [/system clock get time]
:local thisdate [/system clock get date]
:local thishour [:pick $thistime 0 2]
:local emessage ($thisbox . " voltage is: " . [:pick $voltage 0 2] . “.” . [:pick $voltage 2 3])
:if ([:len $lowvolt] < 1) do={:set lowvolt 999; :set highvolt 0}