Faidon Liambotis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/279959
Change subject: nagios: use SNMP v2c for check_bgp
......................................................................
nagios: use SNMP v2c for check_bgp
This tells Net::SNMP to use v2c of the SNMP protocol for BGP queries (a
single-line fix).
This, in turn, automatically enables GETBULK commands with no further
code changes, which results in significant speedups proportional to the
number of peers and the latency between the monitoring host and the
router:
Before:
------
$ time ./check_bgp -c <secret> cr2-ulsfo.wikimedia.org
OK: host 'cr2-ulsfo.wikimedia.org', sessions up: 47, down: 0, shutdown: 0
real 0m15.763s
user 0m0.824s
sys 0m0.032s
After:
------
$ time ./check_bgp -c <secret> cr2-ulsfo.wikimedia.org
OK: host 'cr2-ulsfo.wikimedia.org', sessions up: 47, down: 0, shutdown: 0
real 0m1.261s
user 0m0.232s
sys 0m0.020s
Change-Id: I5646fc07f34fcec380d55e0933c84f376f0c8908
---
M modules/nagios_common/files/check_commands/check_bgp
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/59/279959/1
diff --git a/modules/nagios_common/files/check_commands/check_bgp
b/modules/nagios_common/files/check_commands/check_bgp
index c6d948c..6f9873d 100755
--- a/modules/nagios_common/files/check_commands/check_bgp
+++ b/modules/nagios_common/files/check_commands/check_bgp
@@ -8,7 +8,7 @@
# and fixed an undef var in an error string concat...
# This script still sucks, but this makes it barely work
# faidon - 2016-03-28 - set %uplinks to WMF's transits; removed
-# whois support
+# whois support; force SNMP v2c (enables GETBULK)
#
# check_bgpstate.pl - nagios plugin
#
@@ -139,7 +139,8 @@
($session, $error) = Net::SNMP->session(
-hostname => $hostname,
-community => $community,
- -port => $port
+ -port => $port,
+ -version => '2',
);
if (!defined($session)) {
--
To view, visit https://gerrit.wikimedia.org/r/279959
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5646fc07f34fcec380d55e0933c84f376f0c8908
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits