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

# Class BatchDeviceLoader

source code

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

Base class wrapping around dmd.DeviceLoader

Instance Methods | [hide private]
__init__(self) Initializer that takes care of basic daemon options. | source code
list of dictionaries |
loadDeviceList(self, args=None) Read through all of the files listed as arguments and return a list of device entries. | source code
applyZProps(self, device, device_specs) Apply zProperty settings (if any) to the device. | source code
applyOtherProps(self, device, device_specs) Apply non-zProperty settings (if any) to the device. | source code
processDevices(self, device_list) Read the input and process the devices * create the device entry * set zproperties * model the device | source code
DMD device object |
getDevice(self, device_specs) Find or create the specified device | source code
buildOptions(self) Add our command-line options to the basics | source code
list of dictionaries |
parseDevices(self, data) From the list of strings in rawDevices, construct a list of device dictionaries, ready to load into Zenoss. | source code
dictionary |
parseDeviceEntry(self, line, defaults) Build a dictionary of properties from one line's input | source code
Inherited from `ZenUtils.ZCmdBase.ZCmdBase`: `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`

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

Method Details | [hide private]

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

### loadDeviceList(self, args=None) | source code
Read through all of the files listed as arguments and return a list of device entries. Parameters: `args` (list of strings) - list of filenames (uses self.args is this is None) Returns: list of dictionaries list of device specifications

### applyZProps(self, device, device_specs) | source code
Apply zProperty settings (if any) to the device. Parameters: `device` (DMD device object) - device to modify `device_specs` (dictionary) - device creation dictionary

### applyOtherProps(self, device, device_specs) | source code
Apply non-zProperty settings (if any) to the device. Parameters: `device` (DMD device object) - device to modify `device_specs` (dictionary) - device creation dictionary

### processDevices(self, device_list) | source code
    Read the input and process the devices
      * create the device entry
      * set zproperties
      * model the device

    @parameter device_list: list of device entries
    @type device_list: list of dictionaries

### getDevice(self, device_specs) | source code
Find or create the specified device Parameters: `device_specs` (dictionary) - device creation dictionary Returns: DMD device object device or None

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

### parseDevices(self, data) | source code
From the list of strings in rawDevices, construct a list of device dictionaries, ready to load into Zenoss. Parameters: `data` (list of strings) - list of strings representing device entries Returns: list of dictionaries list of parsed device entries

### parseDeviceEntry(self, line, defaults) | source code
Build a dictionary of properties from one line's input Parameters: `line` (string) - string containing one device's info `defaults` (dictionary) - dictionary of default settings Returns: dictionary parsed device entry

Class Variable Details | [hide private]

  ### sample_configs Value:
      """#
      # Example zenbatchloader device file
      #
      # This file is formatted with one entry per line, like this:
      #
      #  /Devices/device_class_name Python-expression
      #  hostname Python-expression
      #
      ...