Package Products :: Package ZenModel :: Module zenmib :: Class zenmib |
[hide private]
[frames] | no frames]

# Class zenmib

source code

                  object --+
                           |
    ZenUtils.CmdBase.CmdBase --+
                               |
    ZenUtils.ZenDaemon.ZenDaemon --+
                                   |
          ZenUtils.ZCmdBase.ZCmdBase --+
                                       |
                                      zenmib

Wrapper around the smidump utilities to load MIB files into the DMD tree.

Instance Methods | [hide private]
tuple of ( name, dependency object) |
map_file_to_dependents(self, mibfile) Scan the MIB file to determine what MIB trees the file is dependent on. | source code
map_mib_to_dependents(self, mib) | source code
DependencyMap |
dependencies(self, filenames) Create a dependency map for all MIB files. | source code
list of strings |
getDependencies(self, filename, depMap) smidump needs to know the list of dependent files for a MIB file in order to properly resolve external references. | source code
MIB object |
generate_python_from_mib(self, mibname, dependencies) Use the smidump program to convert a MIB into Python code" | source code
boolean |
load_mib(self, mibs, mibname, depmap) Attempt to load a MIB after generating its dependency tree | source code
main(self) Main loop of the program | source code
buildOptions(self) Command-line options | source code
Inherited from `ZenUtils.ZCmdBase.ZCmdBase`: `__init__`, `closeAll`, `closedb`, `findDevice`, `getConnection`, `getContext`, `getDataRoot`, `getDmdObj`, `login`, `logout`, `opendb`, `sigTerm`, `syncdb`, `zeoConnect` Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `becomeDaemon`, `becomeWatchdog`, `changeUser`, `niceDoggie`, `openPrivilegedPort`, `setupLogging`, `sighandler_USR1`, `watchdogCycleTime`, `watchdogMaxRestartTime`, `watchdogStartTimeout`, `writePidFile` Inherited from `ZenUtils.CmdBase.CmdBase`: `buildParser`, `checkLogpath`, `generate_configs`, `generate_xml_configs`, `generate_xml_table`, `getConfigFileDefaults`, `parseOptions`, `pretty_print_config_comment` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Variables | [hide private]
| MIB_MOD_ATTS = `'language', 'contact', 'description'`
Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `pidfile` Inherited from `ZenUtils.CmdBase.CmdBase`: `doesLogging`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### map_file_to_dependents(self, mibfile) | source code
Scan the MIB file to determine what MIB trees the file is dependent on. Parameters: `mibfile` (string) - MIB filename Returns: tuple of ( name, dependency object) dependency tree

### dependencies(self, filenames) | source code
Create a dependency map for all MIB files. Exit the program if we're missing any files. Parameters: `filenames` (list of strings) - names of MIB files to import Returns: DependencyMap dependency tree

### getDependencies(self, filename, depMap) | source code
smidump needs to know the list of dependent files for a MIB file in order to properly resolve external references. Parameters: `filename` (string) - name of MIB file to import `depMap` (DependencyMap) - dependency tree Returns: list of strings list of dependencies

### generate_python_from_mib(self, mibname, dependencies) | source code
Use the smidump program to convert a MIB into Python code" Parameters: `mibname` (string) - name of the MIB `dependencies` (list of strings) - list of dependent files Returns: MIB object the newly created MIB

### load_mib(self, mibs, mibname, depmap) | source code
Attempt to load a MIB after generating its dependency tree Parameters: `mibs` (list of strings) - filenames of the MIBs to load `mibname` (string) - name of the MIB `dependencies` (string) - list of dependent files Returns: boolean whether the MIB load was successful or not

### buildOptions(self) | source code
Command-line options Overrides: ZenUtils.ZCmdBase.ZCmdBase.buildOptions