Developer's Guide

  • Docs Home
  • Community Home

Zenoss Developer's Guide for 2.4

This work is licensed under a Creative Commons Attribution Share Alike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/; or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.

The Zenoss logo is a registered trademark of Zenoss, Inc. Zenoss and Open Enterprise Management are trademarks of Zenoss, Inc. in the U.S. and other countries.

Flash is a registered trademark of Adobe Systems Incorporated.

Java is a registered trademark of Sun Microsystems, Inc.

Linux is a registered trademark of Linus Torvalds.

Oracle and the Oracle logo are registered trademarks of the Oracle Corporation.

SNMP Informant is a trademark of Garth K. Williams (Informant Systems, Inc.).

Sybase is a registered trademark of Sybase, Inc.

Tomcat is a trademark of the Apache Software Foundation.

Windows is a registered trademark of Microsoft Corporation in the United States and other countries.

All other companies and products mentioned are trademarks and property of their respective owners.


Table of Contents

1. Introduction
1. Overview
1.1. Model
1.2. Availability
1.3. Events
1.4. Performance
2. Detailed Architecture
2.1. User Layer
2.2. Data Layer
2.3. Collection and Control Service Layer
2. Getting Started
1. Working with the Source Code
1.1. Getting the Source Code
1.1.1. Getting Subversion for the Appliance
1.2. Keeping up-to-date with your checked-out code
1.3. Getting Patches
1.4. Style Guidelines
1.4.1. Docstrings
1.5. Generating Diffs for new Fixes
1.6. Submitting a Fix
2. Development Toolchain Requirements
2.1. Appliance
3. Programming Techniques
3.1. Calling Methods Using REST
3.1.1. How to Call Methods Using REST
3.1.2. Sending an Event
3.2. Miscellaneous Notes
3.2.1. pkg_resources
3.2.2. urllib2 Workarounds
4. zendmd: Command-line Access to the Device Management Database (DMD)
5. Programming Documentation
5.1. Python
5.2. Zenoss API
5.3. Other Resources
5.4. Contributing to the Documentation
3. ZenPacks
1. Overview
2. Creating a ZenPack
2.1. ZenPack Names
2.2. Specifying Dependencies
2.3. Locating ZenPack Source Outside of Zenoss
2.4. Community ZenPack Subversion Access
3. ZenPack Structure and Contents
4. Developing the ZenPack
4.1. Base ZenPack Class
4.2. Storing Objects in the ZODB
4.3. Providing DataSource classes
4.4. Performance Template Checklist
4.4.1. Data Sources
4.4.2. Data Points
4.4.3. Thresholds
4.4.4. Graph Definitions
4.4.5. Graph Points
4.5. Providing Performance Collector Plugins
4.6. Providing Daemons
4.7. setuptools and the zenpacksupport
5. Building and Distributing ZenPacks
5.1. Migrating between versions
5.2. Converting older ZenPacks to ZenPack eggs
6. Development Mode
6.1. Source ZenPacks
6.2. Converting .eggs to Development Mode
7. Where to Get More Information
4. Zenoss Data Stores
1. Zope Object Database (ZODB)
2. MySQL Event database
2.1. Connecting to the Database
2.2. MySQL in 60 Seconds
3. Python Pickle Files
4. Round-Robin Database
5. Events
1. Understanding an Event Entry
1.1. Event Design
2. Sending an Event
3. Adding an Event Class
3.1. Add to ZenEventClasses
3.2. Add the class to the import XML
3.3. Write a migrate script
6. zProperty Management
1. Adding a zProperty
1.1. Adding a zProperty to an Event
1.2. Adding a zProperty to a Device
2. Migrating the zProperty Code
7. Creating New Jobs
1. Job Requirements
2. Running a Job
3. Life Cycle of a Job
4. Shell Command Jobs
5. Logging
8. Device Management
1. Adding Devices Programatically
1.1. Using a REST call
1.2. Using an XML-RPC Call from Python
1.3. XML-RPC Attributes
2. Editing Device Information
2.1. Using a REST call
2.2. Using an XML-RPC Call from Python
3. Deleting A Device
3.1. Using a REST call
3.2. Using an XML-RPC Call from Python
4. Checking If A Device Exists
4.1. Using a REST call
4.2. Using an XML-RPC Call from Python
5. Exporting a Device List
9. Extending the Model
1. Add a ZenModel Relationship
1.1. One-to-One (1:1) Relationships
2. One-to-Many (1:N) Relationships
3. Many-to-Many (M:N) Relationships
3.1. One-to-Many (1:N) Container Relationships
4. Zenoss XML Schema
4.1. object
4.1.1. Example
4.1.2. Attributes
4.1.3. Children
4.2. objects
4.2.1. Example
4.2.2. Children
4.3. property
4.3.1. Example
4.3.2. Attributes
4.4. tomany
4.4.1. Example
4.4.2. Attributes
4.4.3. Children
4.5. tomanycont
4.5.1. Example
4.5.2. Attributes
4.5.3. Children
4.6. toone
4.6.1. Example
4.6.2. Attributes
4.7. link
4.7.1. Example
4.7.2. Attributes
5. Zenoss Permissions
5.1. Adding New Permissions
5.2. Assigning Permissions to a Method
5.3. Checking Links
10. Zenoss Daemons
1. Twisted Network Programming Overview
1.1. Understanding NJobs, Driver and DeferredList
1.1.1. DeferredList
1.1.2. NJobs
1.1.3. Driver
1.1.4. A Simple Example
2. Zenoss Daemon Overview
3. zenhub: Daemon to ZODB management
3.1. Daemon to ZODB management
3.2. Heartbeats and other Events
3.3. Pluggable Daemon Services
4. ZenRender and Graphs
5. Developing a Daemon
5.1. Command-line Options
5.2. Add the Daemon Control Script
5.3. Set Up ZenHub Communications
5.3.1. Registering Services with the Hub
11. Add a Performance Daemon
1. Overview
2. DataMaps
3. Performance Collection
3.1. Connecting Collectors and Services
4. Creating a New Collector
4.1. Constructor
4.2. Getting a List of Devices
4.2.1. Thresholds
4.3. fetchConfig()
4.4. Collector's ZenHub Service
4.5. Miscellaneous Functions
4.6. Collect the Performance Data
12. Adding a Device Type
1. Overview
2. Add the MIB
3. Add a Device Organizer
4. Create a Modeler
4.1. Verify the SNMP connectivity and OIDs
4.2. Common SNMP Issues
4.3. Modeler Code
4.4. Testing the Modeler
5. Create a Performance Collector
5.1. Performance Data Collector Code
5.2. Writing Your Own Command Parser
6. Create the Template
6.1. Create the DataSource
6.2. Create a Threshold
6.3. Create a Graph
7. Map Events
8. Adding SSH Monitoring Tests
8.1. Overview
8.2. Modeling Plugin Test Data
8.2.1. Test Data for an ObjectMap
8.2.2. Test Data for a RelationshipMap
8.2.3. Test Data for a List of Data Maps
8.3. Data Point Parser Test Data
8.3.1. Test Data for Device-Level Parsers
8.3.2. Test Data for Component Parsers
8.4. Running the Tests
13. Extending the User Interface
1. Overview of the Zenoss UI Technologies
1.1. HyperText Markup Language (HTML)
1.2. Cascading Style Sheets (CSS)
1.3. Zope 2, ZPT and TAL
1.4. ZPT and Macro Expansion for TAL (METAL)
1.5. JavaScript / AJAX
1.6. JavaScript libraries: YUI and MochiKit
2. Customizing the Navigation Bar
2.1. Adding a link
2.2. A Simple HTML Page
2.3. A Simple TAL and METAL page
3. Customizing the Logo
4. Zope 2 Page Templates, TAL and METAL and Zenoss
4.1. Tips
5. Zope 3 Views Explained
5.1. The Zope 2 Way
5.2. The Zope 3 Way
6. Other Customizations
6.1. Adding Tabs
6.2. Adding a Dialog
6.3. Adding a New Menu or Menu Item
6.4. Creating a Table Using ZenTableManager
6.5. Creating an Editable Table
6.6. How to Save Properties via an Edit Screen
7. Creating a Dashboard Portlet
7.1. Create a ZenPack
7.2. Write the Python back-end code
7.3. Write the JavaScript Portlet
7.4. Register the portlet
8. Debugging Tips
14. Reports
1. Adding a New Report
2. Plugins
3. Adding Export Buttons to Reports
15. Migrating Zenoss Code
1. Introduction and Steps
2. How It Works
3. What You Write
3.1. Implement cutover()
3.2. Supporting Code
3.3. Testing and Deployment
16. Testing
1. Zenoss Unit Tests
1.1. Introduction
1.2. doctest Testing
1.3. Zenoss' Test Runner
1.3.1. An Example Unit Test
1.4. Integrating With Buildbot
1.5. JavaScript Test Framework
2. Functional User Interface Testing
2.1. Introduction
2.2. Installing and Running
2.2.1. Installing and Configuring Mac OS X
3. Where to Get More Information
A. Event Database Dictionary
B. TALES Expressions
1. Examples
1.1. ping
1.2. DNS forward lookup
1.3. DNS reverse lookup
1.4. snmpwalk
2. TALES Device Attributes
3. TALES Event Attributes
Glossary