Chaining OIDStores in TwistedSNMP (Today's little side project...)


TwistedSNMP has a mechanism called an OIDStore, which allows you to define the values to be returned from a (server-side) agent. At the moment, these are quite simplistic creations, basically either a bisect-sorted list or a BSDDB btree database (the OIDStore must be ordered, which is why a simple dictionary wouldn't work).

That works fine for simple testing, where you can readily specify the entire data-set for each test, but what I'd like to do is to be able to compose the data-sets by composing different OIDStores, so that one part of the Agent is serviced by, e.g. a "calculated" OIDStore, while another would be static values in memory, and another BSDDB-based.

I've started work on that, but I'm not really happy with it. So far it tends to make the architecture of an OIDStore far more complex, mostly because of corner cases where two OIDStores are loaded that happen to overlap, and the fact that the most common use case is actually to use an OIDStore to specify a table, which would most readily be handled by simply specifying a root OID. That's easy to code, but doesn't readily fit in to a model where multiple tables are handled by a single sub-OIDStore.

Anyway, think I've pounded on it enough for one night. I'm going to let the magic of sleep waft the best design to me.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.