Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Faircloth authored Dec 17, 2021
2 parents 0fde096 + 6a7ddfe commit 398f3ae
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/splunk-connect-for-snmp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.0.4-beta.1
version: 1.0.5
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.4-beta.1"
appVersion: "1.0.5"
#
dependencies:
- name: mongodb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ spec:
value: {{ include "splunk-connect-for-snmp.mongo_uri" . }}
- name: LOG_LEVEL
value: {{ .Values.worker.logLevel | default "INFO" }}
- name: UDP_CONNECTION_TIMEOUT
value: {{ .Values.worker.udpConnectionTimeout | default "1" | quote }}
- name: MIB_SOURCES
value: "http://{{ printf "%s-%s" .Release.Name "mibserver" }}/asn1/@mib@"
- name: MIB_INDEX
Expand Down
2 changes: 2 additions & 0 deletions docs/gettingstarted/sc4snmp-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ traps:
worker:
# replicas: Number of replicas for worker container should two or more
#replicaCount: 2
# udpConnectionTimeout: timeout in seconds for SNMP operations
#udpConnectionTimeout: 5
logLevel: "DEBUG"
scheduler:
logLevel: "INFO"
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "splunk-connect-for-snmp"
version = "1.0.4-beta.1"
version = "1.0.5"
description = ""
authors = ["rfaircloth-splunk <[email protected]>"]
license = "Apache-2.0"
Expand Down
3 changes: 1 addition & 2 deletions splunk_connect_for_snmp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
#


__version__ = "1.0.4-beta.1"

__version__ = "1.0.5"
4 changes: 3 additions & 1 deletion splunk_connect_for_snmp/snmp/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
from splunk_connect_for_snmp.snmp.const import AuthProtocolMap, PrivProtocolMap
from splunk_connect_for_snmp.snmp.exceptions import SnmpActionError

UDP_CONNECTION_TIMEOUT = int(os.getenv("UDP_CONNECTION_TIMEOUT", 1))


def getSecretValue(
location: str, key: str, default: str = None, required: bool = False
Expand All @@ -55,7 +57,7 @@ def getSecretValue(
def getSecurityEngineId(logger, ir: InventoryRecord, snmpEngine: SnmpEngine):
observerContext = {}

transportTarget = UdpTransportTarget((ir.address, ir.port))
transportTarget = UdpTransportTarget((ir.address, ir.port), timeout=UDP_CONNECTION_TIMEOUT)

# Register a callback to be invoked at specified execution point of
# SNMP Engine and passed local variables at execution point's local scope
Expand Down
3 changes: 2 additions & 1 deletion splunk_connect_for_snmp/snmp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MONGO_URI = os.getenv("MONGO_URI")
MONGO_DB = os.getenv("MONGO_DB", "sc4snmp")
CONFIG_PATH = os.getenv("CONFIG_PATH", "/app/config/config.yaml")
UDP_CONNECTION_TIMEOUT = int(os.getenv("UDP_CONNECTION_TIMEOUT", 1))

logger = get_task_logger(__name__)

Expand Down Expand Up @@ -238,7 +239,7 @@ def dowork(self, address: str, walk: bool = False, profiles: List[str] = None):
authData = GetAuth(logger, ir, self.snmpEngine)
contextData = getContextData(logger, ir)

transport = UdpTransportTarget((ir.address, ir.port))
transport = UdpTransportTarget((ir.address, ir.port), timeout=UDP_CONNECTION_TIMEOUT)

metrics = {}
retry = False
Expand Down

0 comments on commit 398f3ae

Please sign in to comment.