devel:blueprints:ipdevpoll
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:blueprints:ipdevpoll [2009/07/02 14:53] – klette | devel:blueprints:ipdevpoll [2012/05/07 11:26] (current) – fix url morten | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ipdevpoll design specification ====== | ====== ipdevpoll design specification ====== | ||
+ | |||
+ | **This page is currently being updated to match whats being developed. Dont trust this stuff just yet :-)** | ||
+ | |||
===== Introduction ===== | ===== Introduction ===== | ||
// | // | ||
Line 7: | Line 10: | ||
* Asynchronous SNMP polling, built with [[http:// | * Asynchronous SNMP polling, built with [[http:// | ||
* Plugin based architecture | * Plugin based architecture | ||
- | * Data persistence based on Twisted aDBI? (FIXME) | ||
==== Core application ==== | ==== Core application ==== | ||
- | The gDD core application has the following basic tasks: | + | The core application has the following basic tasks: |
* Schedule executing of jobs | * Schedule executing of jobs | ||
- | * Execute | + | * Execute |
- | * Handle rescheduling when a plugin signals that previous state has been invalidated | + | * Provide data persistence to plug-ins |
- | * Provide data persistence to plugins | + | |
- | Scheduling of jobs instead of individual plugins has been chosen to simplify the application due to the high level of dependency between some of the plugins. Each job defined in the the gDD configuration defines | + | Jobs are a group of plug-ins |
+ | NAV provide two jobs in the default configuration, | ||
+ | These provide a sane order for the plug-ins to run. The user may specify their own jobs and schedules | ||
+ | demanded by the python ConfigParser-module. | ||
+ | \\ | ||
+ | \\ | ||
+ | Example jobs.conf | ||
+ | <code ini> | ||
+ | [inventory] | ||
+ | interval: 60s | ||
+ | plugins: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
- | The previous version | + | One advantage |
==== Data ==== | ==== Data ==== | ||
- | Data storage will to a certain degree be modeled around | + | Data is provided through |
- | to a class-level array of initiated | + | |
- | | + | Shadow-classes are created in '' |
- | - Retrieve current data in db. | + | \\ |
- | - Update if necessary. | + | Example shadowclass specification |
- | - Flush global | + | <code python> |
+ | class Interface(Shadow): | ||
+ | __shadowclass__ = manage.Interface | ||
+ | __lookups__ = [(' | ||
+ | </ | ||
+ | |||
+ | The Shadow-class has two important attributes. ''< | ||
+ | which django model to mimic. This will make any instances | ||
+ | answers | ||
+ | on the shadowclass, | ||
+ | determining wheter to update an object | ||
+ | existing objects in the database the storage system first tries the primary key | ||
+ | field on the object. If the PK is None, the ''< | ||
+ | for the checking. The ''< | ||
+ | Tuples specifies combined lookups, while strings specifies single field | ||
+ | lookups. The different lookups are tried in the order they are defined in the | ||
+ | list. If we look at the example above, it will first try to get an existing | ||
+ | object with only the '' | ||
+ | first object in the lookup-list, a combined search for objects matching both | ||
+ | the '' | ||
+ | unsuccessful it goes on to the next lookup field. | ||
+ | |||
+ | There are two major " | ||
+ | multiple rows are returned an exception is raised. The second is primary key | ||
+ | lookups where the primary key is not an AutoField; if no rows are found when | ||
+ | using non-AutoField primary keys, a new object is created. If the field is an | ||
+ | AutoField however, and no rows are returned, an exception is raised. | ||
+ | |||
+ | Deletion of objects in the database is done if the shadowobject has its | ||
+ | '' | ||
+ | |||
+ | Once the job is done the storage | ||
+ | the shadow objects contained in '' | ||
+ | an instance are saved before the object it self. | ||
==== Plugins ==== | ==== Plugins ==== | ||
Line 69: | Line 118: | ||
- /iftable | - /iftable | ||
- iftable.py | - iftable.py | ||
+ | - test_iftable.py | ||
- collector.py | - collector.py | ||
- | - /test | ||
- | - tests.py | ||
- /vendor | - /vendor | ||
- cisco.py | - cisco.py | ||
+ | - test_cisco.py | ||
- alcatel.py | - alcatel.py | ||
+ | - test_alcatel.py | ||
- .. | - .. | ||
Line 140: | Line 190: | ||
* ModuleMon | * ModuleMon | ||
+ | |||
+ | === Implemented plugins === | ||
+ | |||
+ | Already implemented plugins can be found on [[devel: | ||
===== Database changes ===== | ===== Database changes ===== | ||
Line 157: | Line 211: | ||
The IF-MIB has no concept of an interface/ | The IF-MIB has no concept of an interface/ | ||
- | ===== Code ===== | + | ===== Status |
- | The mercurial repositories can be found at http:// | + | The first NAV release to include ipdevpoll was version 3.6. |
===== References ===== | ===== References ===== |
devel/blueprints/ipdevpoll.1246546385.txt.gz · Last modified: by klette