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

# Class BatchDeviceDumper

source code

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

Base class

Instance Methods | [hide private]
__init__(self, *args, **kwargs) Initializer that takes care of basic daemon options. | source code
bool |
_prepRoot(self) initializes and verify the device root and prune options properly | source code
_emitProps(self, obj) Returns string of object local zProperties, cProperties and "setter" properties suitable for ZenBatchLoader | source code
tuple of strings |
_emitDev(self, dev) Returns a device and its zProperties in strings appropriate for ZenBatchLoader | source code
tuple of strings |
_emitOrg(self, org) Returns a device organizer with its type and local properties | source code
int |
_backtraceOrg(self, outFile, obj) Recurse upward from a device emitting parent DeviceClasses if not already emitted | source code
int |
listLSGOTree(self, outFile, branch) Recurse through the Locations, Systems and Groups trees printing out Organizers with properties return number of Devices emitted | source code
makeRegexMatcher(self) | source code
chooseDevice(self, root, matcher=None) | source code
dict |
listDeviceTree(self, outFile, branch=None) Recurse through the Devices tree printing out Organizers and Devices with properties return number of Devices emitted | source code
buildOptions(self) Add our command-line options to the basics | source code
run(self) Run the batch device dump | source code
printHeader(self, outFile) | source code
printTrailer(self, outFile, foundLSGO, foundDevices) | source code
Inherited from `ZenUtils.ZCmdBase.ZCmdBase`: `closeAll`, `closedb`, `findDevice`, `getConnection`, `getContext`, `getDataRoot`, `getDmdObj`, `login`, `logout`, `opendb`, `sigTerm`, `syncdb`, `zodbConnect` Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `audit`, `becomeDaemon`, `becomeWatchdog`, `changeUser`, `convertSocketOption`, `logname`, `niceDoggie`, `openPrivilegedPort`, `setupLogging`, `sighandler_USR1`, `watchdogCycleTime`, `watchdogMaxRestartTime`, `watchdogStartTimeout`, `writePidFile` Inherited from `ZenUtils.ZenDaemon.ZenDaemon` (private): `_sigUSR1_called` Inherited from `ZenUtils.CmdBase.CmdBase`: `buildParser`, `checkLogpath`, `generate_configs`, `generate_xml_configs`, `generate_xml_table`, `getConfigFileDefaults`, `getGlobalConfigFileDefaults`, `getParamatersFromConfig`, `loadConfigFile`, `parseOptions`, `pretty_print_config_comment`, `validateConfigFile`

Class Variables | [hide private]
| sample_configs = `"`...``
Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `pidfile` Inherited from `ZenUtils.CmdBase.CmdBase`: `doesLogging`

Method Details | [hide private]

### __init__(self, *args, **kwargs) (Constructor) | source code
Initializer that takes care of basic daemon options. Creates a PID file. Overrides: ZenUtils.CmdBase.CmdBase.__init__

### _prepRoot(self) | source code
initializes and verify the device root and prune options properly Returns: bool was initialization successful

### _emitProps(self, obj) | source code
Returns string of object local zProperties, cProperties and "setter" properties suitable for ZenBatchLoader Parameters: `obj` (ZenModelRM) - a Device or DeviceClass (or perhaps Location later) Returns: string containing local zProperties as documented in above sample @rtype str

### _emitDev(self, dev) | source code
Returns a device and its zProperties in strings appropriate for ZenBatchLoader Parameters: `dev` (Device) - Device object to emit Returns: tuple of strings strings containing device name and list of Device-local zProperties and cProperties

### _emitOrg(self, org) | source code
Returns a device organizer with its type and local properties Parameters: `org` (DeviceOrganizer) - DeviceOrganizer to emit Returns: tuple of strings strings containing the device organizer name, type and properties

### _backtraceOrg(self, outFile, obj) | source code
Recurse upward from a device emitting parent DeviceClasses if not already emitted Parameters: `outFile` (file or other object with .write() method that is simillar) - file object to which output is written `dev` (Device or DeviceClass) - Device/DeviceClass for whom we emit parent Organizer paths Returns: int number of DeviceClasses emitted

### listLSGOTree(self, outFile, branch) | source code
Recurse through the Locations, Systems and Groups trees printing out Organizers with properties return number of Devices emitted Parameters: `outFile` (file or other object with .write() method that is simillar) - output object to which we write output `branch` (DeviceOrganizer) - object reference to current tree branch (only used for recursion, should be called with None) Returns: int number of Locations, Systems or Groups dumped

### listDeviceTree(self, outFile, branch=None) | source code
Recurse through the Devices tree printing out Organizers and Devices with properties return number of Devices emitted Parameters: `outFile` (file or other object with .write() method that is simillar) - output object to which we write output `branch` (DeviceClass (or perhaps DeviceOrganizer at worst)) - object reference to current tree branch (only used for recursion, should be called with None) Returns: dict number of leaf Devices and DeviceClasses dumped

### buildOptions(self) | source code
Add our command-line options to the basics Overrides: ZenUtils.CmdBase.CmdBase.buildOptions

Class Variable Details | [hide private]

  ### sample_configs Value:
      """#
      # zenbatchdump run on host zenoss41 on date 2011-10-16 16:34:23.569920
      # with --root=Devices/Server/Linux
      # To load this Device dump file, use:
      #   zenbatchload <file>

      '/Locations'
      ...