Hi,
Im running two servers in my local network.This script below works fine - so when the SERVER1 running on 192.168.0.249 is down, it will enable NAT rule to the SERVER2 and disable NAT rule to SERVER1. When the SERVER1 is up again, it will enable NAT rule to the SERVER1 and disable NAT rule to SERVER2.
:if ([/ping 192.168.0.249 count=5]=0) \
do={:log info "SERVER1 is DOWN"; /ip firewall nat set [find comment="SERVER1"] disabled=yes; /ip firewall nat set [find comment="SERVER2"] disabled=no} \
else={:log info "SERVER1 is UP"; /ip firewall nat set [find comment="SERVER1"] disabled=no; /ip firewall nat set [find comment="SERVER2"] disabled=yes};
But the problem is that every 5sec my logs are getting flooded by:
script,info SERVER1 is DOWN
system,info nat rule changed by someuser
system,info nat rule changed by someuser
Is there any elegant solution that logs above will be generated only when failover take place?
I was trying to search it and tried many solutions but nothing worked for me.
Many thanks