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,
}
);