Ver Feed RSS


Netwatch, ferramenta para monitoramento de máquinas

Avalie este Post de Blog

Mikrotik tem uma ferramenta para monitoramento de máquinas, é o Netwatch.

Picture from

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[/color][/color] 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
In firewall nat I make this rule :

/ip firewall nat add chain=dstnat scr-address=! protocol=tcp dst-port=80 action=dst-nat to-addresses= 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= 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.


Atualizado 07-12-2008 em 14:51 por Magal

Não Categorizado


+ Enviar Comentário

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L