Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:36:27+00:00 2026-06-02T16:36:27+00:00

i am using the following simple script: from pysnmp.entity.rfc3413.oneliner import cmdgen errorIndication, errorStatus, errorIndex,

  • 0

i am using the following simple script:

from pysnmp.entity.rfc3413.oneliner import cmdgen

errorIndication, errorStatus, errorIndex, \
varBindTable = cmdgen.CommandGenerator().bulkCmd(
            cmdgen.CommunityData('test-agent', 'public'),
            cmdgen.UdpTransportTarget(('IP.IP.IP.IP', 161)),
            0,
            1,
            (1,3,6,1,2,1,4,24,4,1,2,169,254)
        )

if errorIndication:
   print errorIndication
else:
    if errorStatus:
        print '%s at %s\n' % (
            errorStatus.prettyPrint(),
            errorIndex and varBindTable[-1][int(errorIndex)-1] or '?'
            )
    else:
        for varBindTableRow in varBindTable:
            for name, val in varBindTableRow:
                print '%s = %s' % (name.prettyPrint(), val.prettyPrint())

Using snmpwalk from command line to this device returns expected result. But
script returns No SNMP response received before timeout. If i omit this OID then everything works fine.
So the problem is in this OID

Here tcpdump stats:

/usr/sbin/tcpdump -nn -vv -s0 -A host HOST and udp

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

12:15:31.494920 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 77) IP.IP.IP.IP.47911 > IP.IP.IP.IP.161: [bad udp cksum 4b7d!]  { SNMPv2c { GetBulk(34) R=8993731  N=0 M=1 .1.3.6.1.2.1.4.24.4.1.2.169.254 } }
E..M..@.@.I..]<..]</.'...9.S0/.....public."....;.......0.0...+..........).~..

12:15:31.495666 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 98) IP.IP.IP.IP.161 > IP.IP.IP.IP.47911: [udp sum ok]  { SNMPv2c { GetResponse(55) R=8993731  .1.3.6.1.2.1.4.24.4.1.2.169.254.0.0.0.0.255.255.0.0.0.0.0=[inetaddr len!=4]0.0.255.255.0.0.0.0 } }
E..b..@.@.I..]</.]<....'.N.\0D.....public.7....;.......0)0'..+..........).~.............@.........

12:15:32.500226 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 77) IP.IP.IP.IP.47911 > IP.IP.IP.IP.161: [bad udp cksum 4b7d!]  { SNMPv2c { GetBulk(34) R=8993731  N=0 M=1 .1.3.6.1.2.1.4.24.4.1.2.169.254 } }
E..M..@.@.I..]<..]</.'...9.S0/.....public."....;.......0.0...+..........).~..

12:15:32.500624 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 98) IP.IP.IP.IP.161 > IP.IP.IP.IP.47911: [udp sum ok]  { SNMPv2c { GetResponse(55) R=8993731  .1.3.6.1.2.1.4.24.4.1.2.169.254.0.0.0.0.255.255.0.0.0.0.0=[inetaddr len!=4]0.0.255.255.0.0.0.0 } }
E..b..@.@.I..]</.]<....'.N.\0D.....public.7....;.......0)0'..+..........).~.............@.........

As we can see, device returns response .1.3.6.1.2.1.4.24.4.1.2.169.254.0.0.0.0.255.255.0.0.0.0.0=[inetaddr len!=4]0.0.255.255.0.0.0.0, but nothing happens and pysnmp just continue to try the value of this OID again and again.. snmpwalk recognizes this response as IP ADDRESS 0.0.255.255

Can you guys help me? Thanks in advance and sorry my english.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:36:29+00:00Added an answer on June 2, 2026 at 4:36 pm

    Your SNMP Agent seems to produce broken SNMP messages. While IPv4 address is four-octets long, your Agent reports eight-octets value.

    As per SNMP RFCs, pysnmp drops malformed SNMP messages and retries original request a few times in hope to get correct response.

    To make pysnmp working with specifically malformed IP address values you could patch its IpAddress class at runtime to make it taking just the four leading octets from a possibly longer initializer:

    >>> def ipAddressPrettyIn(self, value):
    ...   return origIpAddressPrettyIn(self, value[:4])
    ...
    >>> origIpAddressPrettyIn = v2c.IpAddress.prettyIn
    >>> v2c.IpAddress.prettyIn = ipAddressPrettyIn
    >>>
    >>> msg, rest = decoder.decode(wholeMsg, asn1Spec=v2c.Message())
    >>> print msg.prettyPrint()
    Message:
    version='version-2'
     community=public
     data=PDUs:
     response=ResponsePDU:
      request-id=6564368
      error-status='noError'
      error-index=0
      variable-bindings=VarBindList:
       VarBind:
        name=1.3.6.1.2.1.4.24.4.1.2.169.254.0.0.0.0.255.255.0.0.0.0.0
        =_BindValue:
         value=ObjectSyntax:
           application-wide=ApplicationSyntax:
           ipAddress-value=0.0.255.255
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following sliding div script: http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html Currently, the slidetoggle function is
I have the following simple script, which I am using to dynamically create the
I have the following simple Python script: import socket import ssl if __name__ ==
I'm using the following simple Go code to allocate a 3D array of size
My problem is a bit more complex than using the following simple JavaScript code:
I'm using MVC 4, EF 4.3 and the MVCScaffolding package. I have following simple
I am using the following function to create a simple accordion. The problem is
I am trying to download a file using simple java class using the following
I am trying to download a file using simple java class using the following
From the documentation for ggplot2's geom_tile() function, we have the following simple plot: #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.