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

Add agent support #6

Open
vincentbernat opened this issue Mar 14, 2012 · 1 comment
Open

Add agent support #6

vincentbernat opened this issue Mar 14, 2012 · 1 comment

Comments

@vincentbernat
Copy link
Owner

Currently, snimpy only implements a manager. Adding agent support would be nice. At first, constant values could be registered to the agent with the exact same syntax than with the manager :

a = Agent()
a.ifDescr[2] = "eth0"
a.ifDescr[3] = "eth1"
a.ifInOctets[2] = 54548754
a.ifInOctets[3] = 0
a.serve()

Then, we could attach functions. When attached to a table object, they will be provided with the appropriate index.

def randomValue(ifindex):
   if ifindex in range(2,6):
      return random.randint(0, 1 << 32 - 1)
   return None

a = Agent()
a.ifDescr[2] = "eth0"
a.ifDescr[3] = "eth1"
a.ifDescr[4] = "eth2"
a.ifDescr[5] = "eth3"
a.ifInOctets = randomValue
a.ifOutOctets = randomValue

Later, we could add write support too!

@vincentbernat
Copy link
Owner Author

And of course, full agent or AgentX support!

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