Questions tagged [gosnmp]

GoSNMP is an SNMP client library fully written in Go.

GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv2c or SNMPv3. Builds are tested against linux/amd64 and linux/386.

For more information, see the project's home page.

7 questions
1
vote
0 answers

How do I fetch node details from parsed mib using golang gosmi library based on oid received in snmp trap

I have parsed mib using Parser from https://github.com/sleepinggenius2/gosmi package in golang and stored the modules from mib files with below code: package main import ( "fmt" "os" "path/filepath" …
1
vote
1 answer

What's a better way to create go structs for unmarshalling the following yaml file?

I'm unmarshalling a yaml file snmp.yml. and I was wondering if I could get suggestions on creating better structs. This is what I have for now, but I'm guessing the structs I'm creating for Metric is fine but the SNMPyaml needs better restructuring…
1
vote
1 answer

Converting datetime OctetString to human readable string in GoLang

How to convert Datetime Octetstring to ASCII. I read through one of the example in python netsnmp but still not able to solve it. This is what I received from gosnmp as slice of []uint8 [7 224 1 28 20 5 42 0 43 0 0] or Go-syntax representation of…
James Sapam
  • 16,036
  • 12
  • 50
  • 73
0
votes
2 answers

Why would an snmpwalk request made using gosnmp timeout after 29 seconds?

I am using gosnmp to walk snmp interface tables, 1.3.6.1.2.1.2.2.1 and 1.3.6.1.2.1.31.1.1.1. There is a big variance in the time required to complete this task, I assume this depends on the load on both computers and network congestion. In tests…
toddw
  • 81
  • 8
0
votes
1 answer

SNMP reading from an OID with three libraries gives different execution times

I already used easysnmp to read SNMP OIDs, but I chose pysnmp library now because easysnmp did not support asyncio archtecture in Python3. The considered issue is that,pysnmp is too slower than other libraries: pysnmp: from pysnmp.hlapi import…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
0
votes
1 answer

gosnmp get octetstring from SNMP PDU

I am trying to get the OctetString value from an SNMP PDU returned by the gosnmp package. Even the bytes would suffice. Here is my code: package snmp_abstract import ( "github.com/soniah/gosnmp" "time" "log" "os" …
ChaChaPoly
  • 1,811
  • 5
  • 17
  • 39
0
votes
1 answer

Object name instead of OID in GoSNMP

Is it possible to return Object name instead of OID using gosnmp For eg: Instead of ".1.3.6.1.2.1.25.2.3.1.1.1": { "type": "2", "val": "1" }, How can i get: "hrStorageIndex": { "type": "2", "val": "1" …
James Sapam
  • 16,036
  • 12
  • 50
  • 73