最近使用snmp的snmpwalk命令,获取数据时有事会出现timeout信息,想弄明白这个timeout时间是多长,就看了snmpwalk的源码,看了一知半解,没有找出来设置这个timeout的地方,有大神知道这个timeout是多少秒吗?
找到了,看官网的man文档才明白,就是在这设置的。以下:
-r retries
Specifies the number of retries to be used in the requests. The default is 5.
-t timeout
Specifies the timeout in seconds between retries. The default is 1. Floating point numbers can be used to specify fractions of seconds.
snmpwalk命令后加-t参数试试,比如:
-t 0.5
表示超时时间为3秒,即0.5*6,snmp的默认超时时间为6秒