Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

SSH ZenPack Development Tutorial 3

VERSION 2  Click to view document history
Created on: May 10, 2010 6:14 PM by Matt Ray - Last Modified:  May 10, 2010 7:48 PM by Matt Ray

This is the third in a series of articles about writing an SSH-based ZenPack from scratch, the SSH ZenPack Development Tutorial Series.  This series follows the development of the Mac OS X ZenPack.


 

The 0.3 release of this ZenPack adds support for modeling the software inventory for the Software tab with the zenoss.cmd.osx.software modeler plugin and tests to go with it.  The software.py modeler has a process method that iterates over the command output (which tries reduce the amount of content across the wire and to strip out the '©' since it isn't an ascii symbol and makes parsing more difficult).  There are 2 helper methods for parsing the date and manufacturer.  The parse_date method would greatly take advantage of the datetime.strptime method, but this isn't supported until Python 2.5.  The parse_manufacturer  method makes some short-cut assumptions about matching to reduce the complexity of the rules, but essentially it has many special cases to cover to pull out the manufacturers.

 

The directory structure has been updated, with changes marked in green:

*unless noted, the __init__.py files are empty

 

For using this ZenPack:

  1. Download the ZenPack from the Mac OS X page or to build the ZenPack: make ZenPacks.community.OSX
  2. Install the ZenPack
  3. zopectl restart; zenhub restart
  4. Browse to the newly created /Server/SSH/OSX device class
  5. Click on the zProperties and the zCollectorPlugins
    Screen shot 2010-05-10 at 6.31.55 PM.png
  6. You can run the unit tests against with: runtests ZenPacks.community.OSX
  7. Add an OSX device to the /Server/SSH/OSX device class with the zCommandUsername and zCommandPassword set or the zKeyPath

  8. Model the device
    Screen shot 2010-05-10 at 6.30.22 PM.png
  9. Navigate to the Software tab:
    Screen shot 2010-05-10 at 3.35.56 PM.png
    Comments (0)