Ver Feed RSS

Magal

Netwatch, ferramenta para monitoramento de máquinas

Avalie este Post de Blog

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



http://www.mustnofee.com/images/stories/monitoring.JPG

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[/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 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.

MustNoFee

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

Categorias
Não Categorizado

Comentários


+ Enviar Comentário