首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在超时之前未收到SNMP响应-包含非常基本的示例

在超时之前未收到SNMP响应-包含非常基本的示例
EN

Stack Overflow用户
提问于 2019-07-22 20:14:59
回答 2查看 478关注 0票数 0

我是新来的pysnmp。在读取来自snmplabs.com的文档时,我尝试了get_command代码,但得到的输出是在超时之前没有收到SNMP响应

正如在回答一些类似类型的问题时所提到的,我尝试在代码的开头添加下面提到的内容。

代码语言:javascript
运行
复制
from pysnmp import debug
debug.setLogger(debug.Debug('io', 'msgproc', 'secmod'))

完整的代码如下所示

代码语言:javascript
运行
复制
from pysnmp.hlapi import *
from pysnmp import debug

debug.setLogger(debug.Debug('io', 'msgproc', 'secmod'))

def getFunc(OID):
    errorIndication, errorStatus, errorIndex, varBinds = next(
        getCmd(SnmpEngine(),
               CommunityData('public', mpModel=0),
               UdpTransportTarget(('demo.snmplabs.com', 161)),
               ContextData(),
               ObjectType(ObjectIdentity('SNMPv2-MIB', OID, 0)))
    )

    if errorIndication:
        print(errorIndication)
    elif errorStatus:
        print('%s at %s' % (errorStatus.prettyPrint(),
                            errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
    else:
        for varBind in varBinds:
            print(' = '.join([x.prettyPrint() for x in varBind]))


if __name__ == "__main__":
    getFunc('sysName')

输出日志如下所示

代码语言:javascript
运行
复制
/usr/bin/python3.7 /home/syed/Pysnmp/manager_request.py
2019-07-22 17:40:17,572 pysnmp: running pysnmp version 4.4.9
2019-07-22 17:40:17,572 pysnmp: debug category 'io' enabled
2019-07-22 17:40:17,572 pysnmp: debug category 'msgproc' enabled
2019-07-22 17:40:17,572 pysnmp: debug category 'secmod' enabled
2019-07-22 17:40:18,394 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910941
2019-07-22 17:40:18,394 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:18,395 pysnmp: _sec2com: built securityName to communityName map, version 4: {(<SnmpAdminString value object at 0x7f9ce6c348d0 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6ac5198 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>, <ValueSizeConstraint object at 0x7f9ce6ac5160 consts 1, 32>> encoding utf-8 payload [s-6747094288003100596]>, <SnmpEngineID value object at 0x7f9ce6c34908 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]>, <SnmpAdminString value object at 0x7f9ce6c34978 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6ac52e8 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>, <ValueSizeConstraint object at 0x7f9ce6ac52b0 consts 0, 32>> encoding utf-8 payload []>): <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]>}
2019-07-22 17:40:18,395 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:18,395 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910941
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:18,395 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DD 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:18,395 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DD 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:19,398 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}
2019-07-22 17:40:19,399 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910942
2019-07-22 17:40:19,399 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:19,400 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:19,401 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910942
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:19,402 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DE 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:19,402 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DE 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:20,405 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}
2019-07-22 17:40:20,406 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910943
2019-07-22 17:40:20,407 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:20,408 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:20,408 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910943
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:20,409 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DF 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:20,410 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A DF 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:21,412 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}
2019-07-22 17:40:21,413 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910944
2019-07-22 17:40:21,414 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:21,415 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:21,415 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910944
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:21,416 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E0 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:21,417 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E0 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:22,419 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}
2019-07-22 17:40:22,420 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910945
2019-07-22 17:40:22,420 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:22,421 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:22,422 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910945
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:22,423 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E1 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:22,424 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E1 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:23,426 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}
2019-07-22 17:40:23,427 pysnmp: prepareOutgoingMessage: PDU request-id 7462641 replaced with unique ID 2910946
2019-07-22 17:40:23,428 pysnmp: prepareOutgoingMessage: using contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:23,429 pysnmp: generateRequestMsg: using community <OctetString value object at 0x7f9ce6c2e470 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ceb6fb1d0 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>> encoding iso-8859-1 payload [public]> for securityModel <SnmpSecurityModel value object at 0x7f9ce6c34d68 tagSet <TagSet object at 0x7f9ceb8cb2b0 tags 0:0:2> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6cfaa58 consts <ValueRangeConstraint object at 0x7f9ceb9202e8 consts -2147483648, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6aaf7f0 consts 0, 2147483647>, <ValueRangeConstraint object at 0x7f9ce6cfaa20 consts 1, 2147483647>> payload [1]>, securityName <SnmpAdminString value object at 0x7f9ce6c34dd8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf630 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf668 consts 0, 255>> encoding utf-8 payload [s-6747094288003100596]>, contextEngineId <SnmpEngineID value object at 0x7f9ce6aaf550 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6aaf710 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6aaf6d8 consts 5, 32>> encoding iso-8859-1 payload [0x80004fb8057379...642d453478901048]> contextName b''
2019-07-22 17:40:23,430 pysnmp: generateRequestMsg: Message:
 version=0
 community=public
 data=PDUs:
  get-request=GetRequestPDU:
   request-id=2910946
   error-status=noError
   error-index=0
   variable-bindings=VarBindList:
    VarBind:
     name=1.3.6.1.2.1.1.5.0
     value=ObjectSyntax:
      simple=SimpleSyntax:
       empty=






2019-07-22 17:40:23,431 pysnmp: sendMessage: outgoingMessage queued (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E2 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
2019-07-22 17:40:23,431 pysnmp: handle_write: transportAddress <SnmpUDPAddress value object at 0x7f9ce62034a8 tagSet <TagSet object at 0x7f9ceb7ce748 tags 0:0:4> subtypeSpec <ConstraintsIntersection object at 0x7f9ce6c34940 consts <ValueSizeConstraint object at 0x7f9ceb6fb198 consts 0, 65535>, <ValueSizeConstraint object at 0x7f9ce6c34b38 consts 6, 6>> encoding iso-8859-1 payload [0.0.0.0/0]> -> ('104.236.166.95', 161) outgoingMessage (42 octets) 
00000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A0 1B 02 
00016: 03 2C 6A E2 02 01 00 02 01 00 30 0E 30 0C 06 08 
00032: 2B 06 01 02 01 01 05 00 05 00
No SNMP response received before timeout
2019-07-22 17:40:24,434 pysnmp: StatusInformation: {'errorIndication': RequestTimedOut('No SNMP response received before timeout')}

Process finished with exit code 0
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-07-23 17:45:01

service现在可用了!谢谢你的提醒!

另一种可能更快的提醒维护人员或任何操作问题的方法是打开一个针对snmplabs的GitHub issue

票数 0
EN

Stack Overflow用户

发布于 2019-07-22 21:36:35

确实如此

代码语言:javascript
运行
复制
% snmpwalk -v 1 -c public demo.snmplabs.com 
Timeout: No Response from demo.snmplabs.com

免费的东西可以在任何时候被关闭。试一试

代码语言:javascript
运行
复制
% snmpwalk -v 1 -c public snmp.live.gambitcommunications.com system
SNMPv2-MIB::sysDescr.0 = STRING: Cisco Internetwork Operating System Software ..IOS (tm) RSP Software (RSP-JSV56I-M), Version 12.1(7), RELEASE SOFTWARE (fc1)..Copyright (c) 1986-2001 by cisco Systems, Inc...Compiled Fri 23-Feb-01 05:14 by kellythw
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.1.46
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1086624532) 125 days, 18:24:05.32
SNMPv2-MIB::sysContact.0 = STRING: support@gambitcomm.com
SNMPv2-MIB::sysName.0 = STRING: cisco-7513
SNMPv2-MIB::sysLocation.0 = STRING: 
SNMPv2-MIB::sysServices.0 = INTEGER: 78
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57145853

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档