Skip to content

Instantly share code, notes, and snippets.

@risdenk
Last active April 22, 2022 18:16
Show Gist options
  • Save risdenk/3b6de0a10c11eb62eab6241a777b6351 to your computer and use it in GitHub Desktop.
Save risdenk/3b6de0a10c11eb62eab6241a777b6351 to your computer and use it in GitHub Desktop.
udm wan failover check

https://community.ui.com/questions/UDM-Pro-1-7-1-WAN-Failover-false-positives/6d01f376-c1f2-4d73-8291-8772b2e3483f

ssh root@192.168.1.1 "grep -F 'ubios-udapi-server: ubios-udapi-server: wanFailover: eth8 is' /var/log/messages* | cut -d':' -f 2- | sort | tail" 2>/dev/null

example output:

Jun 14 20:08:19 UDM-Pro user.info ubios-udapi-server: ubios-udapi-server: wanFailover: eth8 is down: {"alarm":true,"dns_alarm":0,"id":"eth8","lat_avg":14933,"loss_pct":21.052600860595703,"std_dev":1399,"type":"wanFailover"}
Jun 14 20:08:19 UDM-Pro user.info ubios-udapi-server: ubios-udapi-server: wanFailover: no change (eth8: down, eth9: down+off)


Jun 14 20:13:29 UDM-Pro user.info ubios-udapi-server: ubios-udapi-server: wanFailover: eth8 is up: {"alarm":false,"dns_alarm":0,"id":"eth8","lat_avg":34592,"loss_pct":5.0,"std_dev":79903,"type":"wanFailover"}
Jun 14 20:13:29 UDM-Pro user.info ubios-udapi-server: ubios-udapi-server: wanFailover: using table 201 (eth8: up, eth9: down+off)

history of failures:

ssh root@192.168.1.1 "grep -F 'ubios-udapi-server: ubios-udapi-server: wanFailover: eth8 is' /var/log/messages* | cut -d':' -f 2- | sort" 2>/dev/null | grep -F 'is down' | cut -d ':' -f 1 | sort | uniq -c
      1 Jun 10 17
      1 Jun 10 21
      1 Jun 11 04
      1 Jun 11 18
      1 Jun 11 20
      1 Jun 11 23
      1 Jun 12 08
      1 Jun 12 12
      1 Jun 12 23
      1 Jun 13 06
      1 Jun 13 17
      3 Jun 14 02
      1 Jun 14 08
      7 Jun 14 14
      1 Jun 14 20
      1 Jun 14 23

check dpinger:

ps aux | grep -F dpinger
12440 root     grep -F dpinger
23850 root     /usr/bin/dpinger -f -i eth8 -B IP_ADDRESS -s 60s -d 1 -t 86400s -u /run/dpinger-eth8-monitor-0.sock ping.ubnt.com
23852 root     /usr/bin/dpinger -f -i eth8 -B IP_ADDRESS -s 3s -d 1 -D 1500m -L 20 -l 2s -C /usr/bin/wan-failover-script -n 8.8.8.8 -n 8.8.4.4 -t 60s -u /run/dpinger-eth8-monitor-1.sock ping.ubnt.com

change from ping.ubnt.com -> 192.168.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment