Community discussions

MikroTik App
 
NickOlsen
Member Candidate
Member Candidate
Topic Author
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Interface log status script

Wed Sep 24, 2008 10:20 pm

Simple script but I have no idea how to do it.
Basically I would like a script that watches a certain interface and just logs it if it goes down (no link).

Can anybody make me this script?
I take it that netwatch would be used.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Interface log status script

Thu Sep 25, 2008 8:06 am

/tool netwatch add host=x.x.x.x down-script={ :log info "Link is down"; } up-script={ :log info "Link is UP"; } 
 
User avatar
jorj
Member
Member
Posts: 397
Joined: Mon Mar 12, 2007 4:34 pm
Location: /dev/null

Re: Interface log status script

Tue Oct 07, 2008 4:07 pm

/tool netwatch add host=x.x.x.x down-script={ :log info "Link is down"; } up-script={ :log info "Link is UP"; } 
This works if the ip address x.x.x.x you are watching is ONLY available trough that interface.
In routers with multiple interfaces, that may have different routes to a specified ip, this might not work. Not necesarily.

Who is online

Users browsing this forum: Mosfet and 41 guests