This is the first part in a series of articles about writing an SSH-based ZenPack from scratch, the SSH ZenPack Development Tutorial Series. This follows the development of the Mac OS X ZenPack.
The 0.1 release of this ZenPack provides OS and HW version modeling for the status page. To start development, I created a ZenPacks.community.OSX directory with the other Community ZenPacks I'd checked out from Subversion. I looked at the LinuxMonitor ZenPack and referred to the How to Create an SSH ZenPack and How To Add a Test to an SSH Monitoring Zenpack articles for reference.
For the first version I wanted to add a modeler plugin and tests to run against it. The uname_a.py is the modeling plugin, it pulls the uname, hardware and OS type and the serial number. It populates the device Status page and is a good start for seeing the interaction between modeling and the devices.
To this end I created the standard directory structure of consisting of the following files:
For using this ZenPack:
- To build the ZenPack: make ZenPacks.community.OSX
- Install the ZenPack
- zopectl restart
- Browse to the newly created /Server/SSH/OSX device class
- Click on the zProperties and the zCollectorPlugins
- You can run the unit tests against with: runtests --type unit ZenPacks.community.OSX
Add an OSX device to the /Server/SSH/OSX device class with the zCommandUsername and zCommandPassword set or the zKeyPath
- Model the device
- Navigate to the status page: