Monitoring Machine with Mikrotik

Monitoring

Picture from Administrator.org

 

Mikrotik has a tool to monitoring another machine and when the machine is down or up, we can running script. This tool is netwatch.

Netwatch monitors state of hosts on the network. It does so by sending ICMP pings to the list of specified IP addresses. For each entry in netwatch table you can specify IP address, ping interval and console scripts.

The main advantage of netwatch is it's ability to issue arbitrary console commands on host state changes. If we want use this tool, we must install the advanced-tools.

Example :

I had external proxy server, ip address is 192.168.100.2

In firewall nat I make this rule :

/ip firewall nat add chain=dstnat scr-address=!192.168.100.2 protocol=tcp dst-port=80 action=dst-nat to-addresses=192.168.100.2 comment="RedirectToProxy"

 

First make script on system script :

For Proxy is down :

/system script add name=ProxyDown source={:log info "Proxy DOWN"; /ip firewall nat set [find comment="RedirectToProxy"] disabled=yes}

For Proxy is up :

/system script add name=ProxyUp source={:log info "Proxy UP"; /ip firewall nat set [find comment="RedirectToProxy"] disabled=no}

 

Then we must set on tool netwatch :

/tool netwatch add host=192.168.100.2 interval=10m up-script=ProxyUp down-script=ProxyDown

 

It's done.

Now every 10 minutes, mikrotik will check proxy server status, if status is down, then mikrotik will run script ProxyDown and when the proxy server is up again, mikrotik will run script ProxyUp.

You can use this tool for another reason, like swicthing gateway or anything else.

 

Comments  

 
0 # 2010-12-07 19:23
Where is admin?!
Hih you hear me??
Reply | Reply with quote | Quote
 
 
0 # 2010-12-07 21:41
Hi...
Can i help you?
Reply | Reply with quote | Quote
 
 
0 # 2011-05-08 15:12
So drunk...
Oh..

No mattyer
Reply | Reply with quote | Quote
 
 
0 # 2011-05-10 12:23
So qrazy..
Mmm..

Doesnt matter
Reply | Reply with quote | Quote
 
 
0 # 2011-06-10 14:30
Road to the Truth can be found at the following address: truenewworld.com
(attention, it is not the ad of the site - it is the ad of the Truth).
Reply | Reply with quote | Quote
 
 
0 # 2011-07-05 08:16
grafhic.pharmacific.ws/.../...


Use Latisse vs smartlash once a day. Application LATISSE more than once a day does not accelerate the growth of eyelashes and not increase the effect of the drug.
Reply | Reply with quote | Quote
 
 
0 # 2011-08-03 03:12
- scammer
Do not trust him!
Reply | Reply with quote | Quote
 
 
0 # 2011-09-29 23:58
Download Xrumer 7.0 Elite is possible here : google.com
write a private message or ICQ 92195553
Reply | Reply with quote | Quote
 
 
0 # 2011-10-11 20:00
I need some help. I want to make some project but I have a problem: please give me somebody some links of the websites where I can make my website for free. I really appreciate any help.
Reply | Reply with quote | Quote
 
 
0 # 2011-11-01 16:42
Road to the Truth can be found at the following address: truenewworld.com
(Attention! It is not the ad of the site - it is the ad of the Truth).
Reply | Reply with quote | Quote
 
 
0 # Sackganciak 2011-11-26 08:19
Start watching HD TV online
Reply | Reply with quote | Quote
 
 
0 # humanneigor 2011-12-01 07:37
Why was the biblical fruit of knowledge forbidden?
It’s obvious that this story from the Old Testament was not about the ripeness
of divine fruits, but about the spiritual maturity of the man himself. Only a spiritually
mature mankind can learn the Truth – that is what the Bible conveys in a metaphorical manner.
The Knowledge of the Truth is a sign of spiritual maturity and that’s why only
the Knowledge of the Truth entitles one to the Symbol of the Truth, which is an
Ancient Contact Symbol that will prove to you that we are not alone in the Universe.
The path to the Truth can be found at: truenewworld.com
Reply | Reply with quote | Quote
 
 
0 # gumanetigor 2011-12-03 12:19
Road to the Truth can be found at the following address: truenewworld.com
(Attention! It is not the ad of the site - it is the ad of the Truth).
Reply | Reply with quote | Quote
 
 
0 # unloanulume 2011-12-04 08:25
this is a really interesting website. glad to be a part of it! can you check out my website when you get a chance? debt consolidation companies
Reply | Reply with quote | Quote
 
 
0 # Reynoso 2011-12-24 18:18
Gday everyone,

Just got my first iphone and genuinely enjoy it, although that's a different story. The idea is, I would like to try out some of those iphone casino games and simply need ideas about where to start. I realize, I may easily Google and bing all sorts of things, nevertheless I prefer to get some ideas from you.

The question is, which type of iphone casino would you strongly recommend? I know you can find the ones that you will need to download for playing and the ones that can be used without the saving. So which ones could you recommend as a more rewarding solution? I would also appreciate it if you guys give your reasons and maybe examples.

Just in case it is important: my iphone is iphone 4s and I intend to play for real money.

Cheers.
Reply | Reply with quote | Quote
 
 
0 # drellaDap 2011-12-29 09:34
Как вскрыть флеш игры, игра принц персии антология.
Reply | Reply with quote | Quote
 
 
0 # igorokwey 2011-12-31 06:04
Truth is the door into the New World.
Road to Truth starts here - apwey.net78.net
Reply | Reply with quote | Quote
 
 
0 # Sami 2012-01-04 05:51
can u help me please.
I need a rule i netwatch if it's possible to writ it down.
I want a router to check the ping on other router with a specific IP address like 192.169.28.7, if ping exceed 100ms or destination host unreachable, or time out for more then 5 min I want the router to reboot it self.
Reply | Reply with quote | Quote
 
 
0 # NatashaPek 2012-01-14 11:21
How download X-Rumer 7.0.10 Elite??
Give me URL please!
Reply | Reply with quote | Quote
 
 
0 # Luciano 2012-01-27 14:57
Provides fully-integrated top forex trading platform for savvy forex traders and beginners. Brokerage services of all kinds.
Reply | Reply with quote | Quote
 

Add comment

Thanks for your comment


Security code
Refresh

Copyright © 2012 MustNoFee
This blog is 1.485 days since Jan, 12 2008