SNMP icon indicating copy to clipboard operation
SNMP copied to clipboard

No message received from host.

Open dnl4 opened this issue 3 years ago • 7 comments

Hello, I constantly get the error of the first attached image. Is this is caused by CPU usage of the device, connection, or what? And how to avoid that? Is there any change on the device that I should do?

More details:

  • I'm trying to do a walk() on two distinct devices.
  • First device, I do a walk() through 800 Oids. The second, through 1700 Oids.
  • Both devices sometime fail with that error.
  • Using wireshark, I see that my server send a SNMP packet (getBulkRequest), but get no packet back (get-response).
  • I already tried with various maxRepetitions(), from 1 to 100.

image

screely-1639269036958

dnl4 avatar Dec 12 '21 00:12 dnl4

If you tell the walk to not use getBulk, does it still have the same issue? ie.: $walk->useGetBulk(false) before starting the loop.

ChadSikorra avatar Dec 12 '21 15:12 ChadSikorra

Had the same issue and $walk->useGetBulk(false) helped. Maybe device doesn't fully support bulk requests. I don't know exactly how it works.

decadence avatar Dec 12 '21 20:12 decadence

@dnl4 are you solved problem ? For me it seems that SnmpWalk function not work at all

jozefrebjak avatar Dec 14 '21 14:12 jozefrebjak

I have seen that happen before on some devices when retrieving a large number of OID's. If you have access to syslog on the servers/ hosts that are timing out take a look and see if it is making snmpd on the machine restart, or give a buffer error of some kind.

You could test putting in a speedbump such as a sleep(1) between each bulkGet and perhaps that will allow it to complete. If you hammer some devices, like cheaper Ausus AP routers, I have seen that happen, and had OK luck by slowing things down a little.

Guyverix avatar Dec 17 '21 23:12 Guyverix

I think part of the issue is that some devices respond to bulkGet requests quite differently, whether because of memory constraints or other issues. It's probably possible to handle this in a more sophisticated way in the walk to account for some of these cases. I imagine that's what the snmpwalk cli utility must do. Though haven't dug through it to see what specifically it is doing.

ChadSikorra avatar Dec 18 '21 16:12 ChadSikorra

At least we can add more info about useGetBulk in Exception message because it took some time before I realised that this issue exists due to bulk requests which is default behaviour.

decadence avatar Dec 18 '21 17:12 decadence

At least we can add more info about useGetBulk in Exception message because it took some time before I realised that this issue exists due to bulk requests which is default behaviour.

The problem there is that the error is very generic and the exception thrown is a network based exception that the SNMP host did not respond when it was supposed to. That could happen for all sorts of reasons. The best that could possibly be done is to catch the specific exception and re-throw it with an additional appended message suggesting the need to set useGetBulk to false.

ChadSikorra avatar Dec 27 '21 20:12 ChadSikorra