0

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 against V1 devices I get a timeout after 29 seconds. Is this because one of the getnext requests that compose the snmpwalk command exceeds the timeout? Is there a way to distinguish calling a busy device and one of many getnext request fails (want a longer timeout) from calling a dead device (want a shorter timeout). After timeout in the middle of snmpwalk, is only the last getnext retried? I assume that gosnmp's snmpwalk wraps the standard snmpwalk. Do the Retries and Timeout fields just map to the -r and -t command line parameters? These are logs from three successive tests against the same device.

{"Elapsed Time":28596.288132,"time":"2021-10-11T18:24:14-04:00","message":"testSnmpWalk succeeded"}

{"error":"request timeout (after 0 retries)","Elapsed Time":29571.202639,"time":"2021-10-11T18:43:37-04:00","message":"testSnmpWalk failed"}

{"Elapsed Time":14645.645597,"time":"2021-10-11T18:44:40-04:00","message":"testSnmpWalk succeeded"}

toddw
  • 81
  • 8
  • There is no such thing as "standard snmpwalk". There are many (dozens?) of implementations. The first solution to your problem would be to try at least a couple of them to see if the problem lies in gosnmp (and your use of it) or the device. There are too many points of failure to diagnose. The next would be to use wireshark or any other packet capture program to diagnose the messages on the wire. – Gambit Support Oct 12 '21 at 16:36
  • I was referring to net-SNMP as the standard. This was incorrect. – toddw Dec 01 '21 at 19:51

2 Answers2

0

My solution was to use exec.Cmd to call net-SNMP. There was some work to pipe and parse the results, but I am pleased with the performance.

toddw
  • 81
  • 8
-1

It can be due to manufacturers implement. You can switch off inline SNMP as a solution . There are many more ways to solve

  • I would not qualify this your remark as an answer. A comment with such content would be OK but nothing more. – kostix Oct 12 '21 at 16:40
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 13 '21 at 01:20