Class HostDAL

Description

Provides access to Host and HostStatus information stored in the Foundation Database.

Provides access to Host and HostStatus information stored in the Foundation Database. Host data is returned in the following format:

 Array (
   [Count] => 2
   [Hosts] => Array
   (
           [172.28.111.17] => Array
           (
                   [HostID] => 2
                   [Name] => 172.28.111.17
                   [ApplicationTypeID] => 100
                   [LastCheckTime] => 04-18-2007 14:54:17PM
                   [Device] => stdClass Object
                   (
                           [DeviceID] => 3
                           [Name] => 172.28.111.17
                           [Identification] => 172.28.111.17
                   )
                   [MonitorStatus] => stdClass Object
                   (
                           [MonitorStatusID] => 7
                           [Name] => UP
                           [Description] => Status UP
                   )
                   [LastPluginOutput] => OK - 172.28.111.17: rta 73.889ms, lost 0%
                   [CurrentNotificationNumber] => 0
                   [ScheduledDowntimeDepth] => 0
                   [TimeDown] => 1176762847
                   [TimeUnreachable] => 0
                   [TimeUp] => 1176933257
                   [ExecutionTime] => 0
                   [Latency] => 0
                   [PercentStateChange] => 0
                   [isAcknowledged] =>
                   [isChecksEnabled] => 1
                   [isEventHandlersEnabled] => 1
                   [isFailurePredictionEnabled] => 1
                   [isFlapDetectionEnabled] => 1
                   [isHostFlapping] =>
                   [isNotificationsEnabled] => 1
                   [isPassiveChecksEnabled] => 1
                   [isProcessPerformanceData] => 1
                   [LastStateChange] => 04-16-2007 15:34:16PM
           )
           [172.28.111.18] => Array
           (
                   [HostID] => 3
                   [Name] => 172.28.111.18
                   [ApplicationTypeID] => 100
                   [LastCheckTime] => 04-18-2007 14:56:25PM
                   [Device] => stdClass Object
                   (
                           [DeviceID] => 4
                           [Name] => 172.28.111.18
                           [Identification] => 172.28.111.18
                   )
                   [MonitorStatus] => stdClass Object
                   (
                           [MonitorStatusID] => 7
                           [Name] => UP
                           [Description] => Status UP
                   )
                   [LastPluginOutput] => OK - 172.28.111.18: rta 62.015ms, lost 0%
                   [CurrentNotificationNumber] => 0
                   [ScheduledDowntimeDepth] => 0
                   [TimeDown] => 1176846162
                   [TimeUnreachable] => 0
                   [TimeUp] => 1176933385
                   [ExecutionTime] => 0
                   [Latency] => 0
                   [PercentStateChange] => 0
                   [isAcknowledged] =>
                   [isChecksEnabled] => 1
                   [isEventHandlersEnabled] => 1
                   [isFailurePredictionEnabled] => 1
                   [isFlapDetectionEnabled] => 1
                   [isHostFlapping] =>
                   [isNotificationsEnabled] => 1
                   [isPassiveChecksEnabled] => 1
                   [isProcessPerformanceData] => 1
                   [LastStateChange] => 04-17-2007 14:42:42PM
           )
     )
)

Located in /HostDAL.inc.php (line 108)


	
			
Method Summary
HostDAL __construct (string $foundationURL)
a getHostByHostId (integer $hostId)
a getHostByHostName (string $hostName)
a getHosts ()
a getHostsByFilter ([$filter $filter = null], [$sort $sort = null], [$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
a getHostsByHostGroupID (integer $hostGroupId, [integer $sort = null], [integer $firstResult = -1], [integer $maxResults = -1])
a getHostsByHostGroupName (string $hostGroupName, [integer $sort = null], [integer $firstResult = -1], [integer $maxResults = -1])
list getHostsByHostNames (list $hostNames, list $sort, integer $firstResult, integer $maxResults)
a getHostsByMonitorServerName (string $monitorServerName)
a getHostsByService (string $serviceDescription)
a getTroubledHosts ([$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
Methods
Constructor __construct (line 117)

Create a HostDAL instance

Create a HostDAL instance

  • access: public
HostDAL __construct (string $foundationURL)
  • string $foundationURL: - cannot be null
getHostByHostId (line 273)

Get a host by host id

Get a host by host id

  • return: host
  • access: public
a getHostByHostId (integer $hostId)
  • integer $hostId
getHostByHostName (line 249)

get a host by hostname

get a host by hostname

  • return: list of hosts
  • access: public
a getHostByHostName (string $hostName)
  • string $hostName
getHosts (line 129)

Get all the hosts - no filters or restrictions

Get all the hosts - no filters or restrictions

  • return: list of Hosts
  • access: public
a getHosts ()
getHostsByFilter (line 353)

Retrieve hosts by defining a filter, sort and pagination parameters.

Retrieve hosts by defining a filter, sort and pagination parameters.

  • return: list of hosts
  • access: public
a getHostsByFilter ([$filter $filter = null], [$sort $sort = null], [$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
  • $filter $filter
  • $sort $sort: - items to sort by
  • $firstResult $firstResult
  • $maxResults $maxResults
getHostsByHostGroupID (line 153)

get all the hosts for a hostgroup specified by hostgroupId

get all the hosts for a hostgroup specified by hostgroupId

  • return: list of hosts
  • access: public
a getHostsByHostGroupID (integer $hostGroupId, [integer $sort = null], [integer $firstResult = -1], [integer $maxResults = -1])
  • integer $hostGroupId: Id of the hostgroup to get hosts for
  • integer $sort: associative array of field to sort by => true for ASC, false if not
  • integer $firstResult: lower limit for row to begin retrieving hosts
  • integer $maxResults: upper limit for row to end at when retrieving hosts
getHostsByHostGroupName (line 177)

get all the hosts for the hostgroup specified by hostGroupName

get all the hosts for the hostgroup specified by hostGroupName

  • return: list of hosts
  • access: public
a getHostsByHostGroupName (string $hostGroupName, [integer $sort = null], [integer $firstResult = -1], [integer $maxResults = -1])
  • string $hostGroupName: Name of the hostgroup to get hosts for
  • integer $sort: associative array of field to sort by => true for ASC, false if not
  • integer $firstResult: lower limit for row to begin retrieving hosts
  • integer $maxResults: upper limit for row to end at when retrieving hosts
getHostsByHostNames (line 328)

Retrieves all hosts specified in host name array. no exception is thrown.

Retrieves all hosts specified in host name array. If a host is not found then it is just not returned and no exception is thrown. Use $firstResult and $maxResults to constrain the number of hosts that are returned at one time.

  • return: of Hosts
  • access: public
list getHostsByHostNames (list $hostNames, list $sort, integer $firstResult, integer $maxResults)
  • list $hostNames: Hosts to retrieve details for.
  • list $sort: a list of fields to use to sort the list of hosts returned.
  • integer $firstResult: Number of host to start with - used for pagination
  • integer $maxResults: Total number of hosts to return, starting with $firstResult.
getHostsByMonitorServerName (line 225)

Get the hosts for the monitor server specified

Get the hosts for the monitor server specified

  • return: list of hosts
  • access: public
a getHostsByMonitorServerName (string $monitorServerName)
  • string $monitorServerName
getHostsByService (line 201)

Get hosts associated with the service with the description provided

Get hosts associated with the service with the description provided

  • return: list of hosts
  • access: public
a getHostsByService (string $serviceDescription)
  • string $serviceDescription: Description of Service to get hosts for
getTroubledHosts (line 300)

Get all troubled hosts - Hosts with a monitor status which is not UP.

Get all troubled hosts - Hosts with a monitor status which is not UP. Use $firstResult and $maxResults to constrain the number of hosts that are returned at one time.

  • return: list of hosts
  • access: public
a getTroubledHosts ([$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
  • $firstResult $firstResult: Number of host to start with - used for pagination
  • $maxResults $maxResults: Total number of hosts to return, starting with $firstResult.

Documentation generated on Fri, 04 May 2007 16:49:44 -0700 by phpDocumentor 1.3.0RC3