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

Programmatically Manage Zenoss via Perl

VERSION 3  Click to view document history
Created on: Mar 15, 2011 2:20 AM by patbaker82 - Last Modified:  Mar 16, 2011 9:53 AM by patbaker82

Prerequisites

 

Zenoss version >= 3.0

 

Description

 

The Zenoss Perl module ties components together that are vital to communicating with the Zenoss JSON API. This module is a full service implementation that provides access to all documented API calls by the Zenoss Monitoring System. Essentially, anything that can be accomplished via the Zenoss UI can be done programmatically via Perl.

 

How/CPAN

 

http://search.cpan.org/dist/Zenoss

 

Example

This is a very simple example that will establish a connection to the Zenoss JSON API, then add a device.  Additional examples can be found at http://search.cpan.org/dist/Zenoss/lib/Zenoss/Examples.pod

 

    use Zenoss;
    
    # Create Zenoss API object
    my $api = Zenoss->connect(
        {
            username    => 'admin',
            password    => 'zenoss',
            url         => 'http://zenossinstance',
            timeout     => '300',
        }
    );
    
    # Add a device
    my $result = $api->device_addDevice(
        {
            deviceName  => 'newdevice',
            deviceClass => '/Server/Linux',
            model       => JSON::true,
        }
    );

Comments (0)

More Like This

  • Retrieving data ...

More by patbaker82