Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
this works well for checking our bgp-speakers. it would be even nicer if the “-n” parameter could be ignored so only one command definition would be needed in case you have a different number of neighbors on some devices.
Also we had to fix one line:
last_output=`/bin/cat /tmp/check_bgp_all.$hostname|grep $neighbor`
changed to:
last_output=`/bin/cat /tmp/check_bgp_all.$hostname|grep $neighbor:`
the “:” is needed to match only exact neighbor IPs, we for example hat x.y.c.2 and x.y.c.20 as neighbors to one bgp-speaker therefore the grep without “:” made for some bad responses which lead to expr-errors later in the script.