Zenoss::Connector - Module responsible for establishing a connection to the
# Create a connection object
my $connection = Zenoss::Connector->new(
username => 'admin',
password => 'zenoss',
url => 'http://zenossinstance:8080',
# Pass the connection to the router
my $api = Zenoss::Router->new(
connector => $connection,
# Call some API methods
my $response = $api->device_getDevices();
# Print the JSON return
This module creates a connection to the Zenoss API, and tests the connectivity.
Once a Zenoss::Connector object has been established, it can be passed to
Zenoss::Router to process Zenoss API calls.
While this module can be used directly, it is recommended that Zenoss
facilitates the connection to the Zenoss::Router.
A croak will occur in the event a connection cannot be established.
Attributes can be set on object creation, see SYNOPSIS, or by calling
Attributes can be retrieved by calling $obj->attribute.
The username to log in with at the Zenos instance
The password to log in with at the Zenos instance
The url to be used in establishing a connection to the Zenoss instance. Note,
that ports in the http(s) url are not required unless they're non-stanard. For
example the url can be set to:
Without having to specify :80 or :443. However, non-standard ports must be
specified! Zenoss by default uses :8080, so this must be specified on the url
if your instance uses this.
The timeout value for processing transactions. Note, if you process a large
request, IE getting all historical events, its prudent to set this value to
something higher than the default of 120 seconds.
This attribute cannot be set. However, once the object is created this attribute
can be accessed to provide the full url, with credentials, to the Zenoss
instance. For example,
Patrick Baker <firstname.lastname@example.org>
Copyright (C) 2010 by Patrick Baker <email@example.com>
This module is free software: you can redistribute it and/or modify it under the
terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
You can obtain the Artistic License 2.0 by either viewing the LICENSE file
provided with this distribution or by navigating to