- CheckMates
- :
- Products
- :
- Quantum
- :
- Security Gateways
- :
- Oneliner to compare routes between two cluster mem...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oneliner to compare routes between two cluster members
Running into "get interfaces with topology" feature problem recently due to route mismatch on cluster members prompted me to write a quick one-liner to compare routes with least possible effort.
It must be noted for example simplicity I used SNMP V1 with public community (which is not advisable in production) so update command snmp part in red accordingly. Also it does require that SNMP port is open on Sync interface (IPs from cphaprob stat output)
For example below I added a dummy 1.1.1.1/32 route to FW1
[Expert@fw1:0]# i=0; cphaprob stat | egrep ^[1,2] | sed 's/(local)//' | awk '{print $2}'| while read line; do let i++; snmpwalk -c public -v 1 $line IP-FORWARD-MIB::inetCidrRouteIfIndex.ipv4 | awk -F\" '{print $2, $4, substr($3,2,2)}' > fw.$i; done; if [ `diff -q fw.1 fw.2 | wc -l` -gt 0 ]; then diff fw.1 fw.2; else echo "Routes OK"; fi
2d1
< 1.1.1.1 10.3.81.67 32
NormaL output would be
[Expert@fwfran1:0]# i=0; cphaprob stat | egrep ^[1,2] | sed 's/(local)//' | awk '{print $2}'| while read line; do let i++; snmpwalk -c public -v 1 $line IP-FORWARD-MIB::inetCidrRouteIfIndex.ipv4 | awk -F\" '{print $2, $4, substr($3,2,2)}' > fw.$i; done; if [ `diff -q fw.1 fw.2 | wc -l` -gt 0 ]; then diff fw.1 fw.2; else echo "Routes OK"; fi
Routes OK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great solution Kaspar!
It's a useful tip when Cloning Groups are not in use. For cluster enviroments the best is configure a Cloning Group that follows ClusterXL to sync all routing related parameters.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
absolutely (about cloning groups) but there are some reasons that I'm not able to discuss here why we are not doing it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because of egrep ^[1,2]
this only works for clusters consisting of two members only.
Because of snmpwalk -c public -v 1
this only works with insecurely configured SNMP.
Because SNMPv3 is standard I recommend to update this one-liner to work with stattest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Danny that's why I wrote: It must be noted for example simplicity I used SNMP V1 with public community (which is not advisable in production) 🙂
It was more of an idea that can be replicated in specific environment accordingly. Not everything has be served on silver plate 🙂 it's good to engage our little grey cells as the famous Poirot said 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
could be extended for VSX devices using a loop 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since VSX routes are pushed from Mgmt, they "should" the same on all cluster members, else topology push would fail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not make it a part of a ToolBox collection?
