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 7192485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:57:00+00:00 2026-05-28T19:57:00+00:00

Attempting to run a MIB based SNMP script and I running into an issue.

  • 0

Attempting to run a MIB based SNMP script and I running into an issue. It is unable to run the function Counter64 though I know that the module which contains that function is installed. the MIB module is automatically generated so I attempted to regenerate it once the missing module was installed, but it didn’t resolve the issue.

The code is as follows:

#!/usr/local/bin/python2.7

from pysnmp.smi import builder, view, error
from pysnmp.entity.rfc3413.oneliner import cmdgen

cmdGen = cmdgen.CommandGenerator()
mibBuilder = builder.MibBuilder()
mibSources = mibBuilder.getMibSources() + ( builder.DirMibSource( '/path/to/command/mibs', ), )
mibBuilder.setMibSources( *mibSources )
print mibBuilder.getMibSources()
mibBuilder.loadModules( 
    'NS-MIB-smiv2',
    )
mibView = view.MibViewController( mibBuilder )
errorIndication, errorStatus, errorIndex, \
                 varBindTable = cmdGen.nextCmd( 
    cmdgen.CommunityData( 'Name', 'Community' ),
    cmdgen.UdpTransportTarget( ( 'IP Address', 161 ) ),
    ( ( '', 'serverName' ), ),
    )

print varBindTable

I know the variables for the environment are correct as I can query them using man ually assigned OIDs without any problem. The Traceback I’m receiving is:

Traceback (most recent call last):

  File "./snmpcollectorexample.py", line 12, in <module>

    'NS-MIB-smiv2',

  File "/usr/lib/python2.7/site-packages/pysnmp-4.2.1-py2.7.egg/pysnmp/smi/builder.py", line 221, in loadModules

pysnmp.smi.error.SmiError: MIB module "/path/to/command/mibs/NS-MIB-smiv2.py" load error: name 'Counter64' is not defined

Doesn anyone have recommendations? Counter64 is a part of the pycopia-SMI Python module and I’ve confirmed that it is installed. But I’m unsure how to go about resolving this issue.

  • 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-05-28T19:57:01+00:00Added an answer on May 28, 2026 at 7:57 pm

    Located the issue. For some reason the build-pysnmp-mib wrapper when running my MIB through all the conversion commands was not adding the Counter64 entries into the mibBuilder.importSymbols(). Manually added it and it moved right along.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are attempting to only make available certain functions to be run based on
While attempting to link with QT 4.5 release, I run into this error message
I'm attempting to run an IronRuby script from C#: var runtime = IronRuby.Ruby.CreateRuntime(); runtime.ExecuteFile(ruby/foo.rb);
I've been attempting to run svnadmin pack on repos that were originally created with
I have a WebDriver test using the FirefoxDriver that I am attempting to run
In attempting to run ./manage.py runserver or shell or any other command for that
while attempting to run rake, I run into the following error: heroku rake db:migrate
I am attempting to run a Windows batch script nightly to pull a fresh
I am attempting to run a threaded socket server that handles multiple clients simultaneously.
I am attempting to run a program that will find a new value for

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.