Module: Zenoss

Included in:
Event::Event, Event::ZEvent, Model, Model::DeviceClass, Model::DeviceHW, Model::OperatingSystem, Model::RRDDataPoint, Model::ServiceOrganizer, Model::System
Defined in:
lib/events/event.rb,
lib/zenoss.rb,
lib/model/model.rb,
lib/model/devices.rb,
lib/events/zevent.rb,
lib/model/rrd_view.rb,
lib/model/event_view.rb,
lib/model/devices/device.rb,
lib/model/systems/system.rb,
lib/model/z_device_loader.rb,
lib/model/devices/device_hw.rb,
lib/model/rrd/rrd_data_point.rb,
lib/model/devices/device_class.rb,
lib/model/zenpack/zenpack_manager.rb,
lib/model/devices/operating_system.rb,
lib/model/events/event_manager_base.rb,
lib/model/services/service_organizer.rb,
lib/model/events/mysql_event_manager.rb

Overview

########################################################################### Copyright ?? 2010 Dan Wanek <dwanek@nd.gov>

This file is part of zenoss_client.

zenoss_client is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

zenoss_client 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. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with zenoss_client. If not, see <www.gnu.org/licenses/>. ###########################################################################

Defined Under Namespace

Modules: Event, Model

Class Method Summary (collapse)

Class Method Details

+ (Model::DeviceClass) devices

The base DeviceClass /zport/dmd/Devices

Returns:



51
52
53
# File 'lib/zenoss.rb', line 51

def Zenoss.devices
  Model::DeviceClass.new('/zport/dmd/Devices')
end

+ (Model::ServiceOrganizer) services

The base ServiceOrganizer /zport/dmd/Services

Returns:



56
57
58
# File 'lib/zenoss.rb', line 56

def Zenoss.services
  Model::ServiceOrganizer.new('/zport/dmd/Services')
end

+ (Boolean) set_auth(user, pass)

Parameters:

  • user (String)
  • pass (String)

Returns:

  • (Boolean)


44
45
46
47
48
# File 'lib/zenoss.rb', line 44

def Zenoss.set_auth(user, pass)
  const_set(:USER, user)
  const_set(:PASS, pass)
  true
end

+ (Model::System) systems

The base System /zport/dmd/Systems

Returns:



61
62
63
# File 'lib/zenoss.rb', line 61

def Zenoss.systems
  Model::System.new('/zport/dmd/Systems')
end

+ (URI) uri(uri)

Set the Base URI of the Zenoss server

Parameters:

  • uri (URI, String)

    is the URL we use to connect to the Zenoss server

Returns:

  • (URI)

    the URI that was parsed and used as our base connection



31
32
33
34
35
36
37
38
39
# File 'lib/zenoss.rb', line 31

def Zenoss.uri(uri)
  if(uri.kind_of?(URI))
    uri.path << '/' unless(uri.path.index /\/$/)
    const_set(:BASE_URI, uri)
  else
    uri << '/' unless(uri.index /\/$/)
    const_set(:BASE_URI, URI.parse(uri))
  end
end