Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependency error? #109

Open
Rojin-dumre opened this issue Jan 6, 2023 · 0 comments
Open

Circular dependency error? #109

Rojin-dumre opened this issue Jan 6, 2023 · 0 comments

Comments

@Rojin-dumre
Copy link

Rojin-dumre commented Jan 6, 2023

I have this code, when i try to run it i get 'ImportError: cannot import name 'walk' from 'puresnmp' (/home/rojin/.local/lib/python3.10/site-packages/puresnmp/init.py)'

from pysnmp.hlapi import *

from puresnmp import walk

IP = "10.10.10.254"
COMMUNITY = 'public'
OID = '1.3.6.1.2.1.2.2.1.2'

for row in puresnmp.walk(IP, COMMUNITY, OID):
    print(row)

IP = "10.10.10.254"
COMMUNITY = 'public'
OID = '1.3.6.1.2.1.2.2.1.8'

for row in walk(IP, COMMUNITY, OID):
    print(row)
    
#Indiviaual Reason on Switch/Router

g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.2.1.2.2.1.2.10113')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Indiviaual Reason on Switch/Router

g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.2.1.2.2.1.2.10113')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Reboot Reason on Switch/Router
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.2.1.2.0')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))

#System Uptime on Switch/Router
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.2.1.1.3.0')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))

#Power Value
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.9.13.1.5.1.3.1006')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))

#FAN Value
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.9.13.1.4.1.3.1007')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))

#System Temperature Value
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.9.13.1.3.1.3.1008')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Monitoring CPU on Switch/Router
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.2.1.58.0')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Monitoring Memory on Switch/Router
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.4.1.9.9.48.1.1.1.6.1')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Version Detail of Switch/Router
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.2.1.1.1.0')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))


#Total Number of Interfaces/Vlan
g = getCmd(
    SnmpEngine(), CommunityData('public'), UdpTransportTarget(
        ('10.10.10.254', 161)), ContextData(), ObjectType(
            ObjectIdentity('1.3.6.1.2.1.2.1.0')))
errorIndication, errorStatus, errorIndex, varBinds = next(g)
for varBind in varBinds:
    print(' = '.join([x.prettyPrint() for x in varBind]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant