Created
November 2, 2014 23:55
-
-
Save asealey/e618ea97e702a91077f5 to your computer and use it in GitHub Desktop.
Fix for snmp.py from Splunk SNMP Modular input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 792a36d6dd4352471ea8886c8b4e65deee515cce Mon Sep 17 00:00:00 2001 | |
From: Adam Sealey <asealey@gmail.com> | |
Date: Sun, 2 Nov 2014 15:12:16 -0800 | |
Subject: [PATCH] Fixing snmp.py for snmpv3 exceptions (treating as tuples when | |
they shouldn't be | |
--- | |
snmp_ta/bin/snmp.py | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
diff --git a/snmp_ta/bin/snmp.py b/snmp_ta/bin/snmp.py | |
index cc14dc5..36177f3 100644 | |
--- a/snmp_ta/bin/snmp.py | |
+++ b/snmp_ta/bin/snmp.py | |
@@ -244,9 +244,9 @@ def v3trapCallback(snmpEngine,stateReference,contextEngineId, contextName,varBin | |
server = "" | |
( transportDomain,transportAddress ) = snmpEngine.msgAndPduDsp.getTransportInfo(stateReference) | |
try: | |
- server = "%s" % transportAddress | |
- trap_metadata += 'notification_from_address = "%s" ' % (transportAddress) | |
- trap_metadata += 'notification_from_domain = "%s" ' % (transportDomain) | |
+ server = "%s" % transportAddress[0] | |
+ trap_metadata += 'notification_from_address = "%s" ' % (transportAddress[0]) | |
+ trap_metadata += 'notification_from_domain = "%s" ' % (transportDomain[0]) | |
except: # catch *all* exceptions | |
e = sys.exc_info()[1] | |
logging.error("Exception resolving source address/domain of the trap: %s" % str(e)) | |
-- | |
2.1.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment