Class ServiceDAL

Description

Provides access to the Services (ServiceStatus) stored in the Foundation Database.

Provides access to the Services (ServiceStatus) stored in the Foundation Database. data is returned in the following format for multiple services:

   Array
   (
       [Count] => 550
       [Services] => Array
           (
               [1] => Array
                   (
                       [ServiceStatusID] => 1
                       [ApplicationTypeID] => 100
                       [Description] => Current Load
                       [Host] => stdClass Object
                           (
                               [HostID] => 1
                               [ApplicationTypeID] => 100
                               [Device] => stdClass Object
                                   (
                                       [DeviceID] => 1
                                       [Name] => 127.0.0.1
                                       [Identification] => 127.0.0.1
                                   )
                               [Name] => localhost
                               [MonitorStatus] => stdClass Object
                                   (
                                       [MonitorStatusID] => 7
                                       [Name] => UP
                                       [Description] => Status UP
                                   )
                               [LastCheckTime] => 2007-04-18T18:23:54.000Z
                               [PropertyTypeBinding] => stdClass Object
                                   (
                                       [StringProperty] => stdClass Object
                                           (
                                               [name] => LastPluginOutput
                                               [value] => OK - 127.0.0.1: rta 0.058ms, lost 0%
                                           )
                                       [IntegerProperty] => Array
                                           (
                                               [0] => stdClass Object
                                                   (
                                                       [name] => CurrentNotificationNumber
                                                       [value] => 0
                                                   )
                                               [1] => stdClass Object
                                                   (
                                                       [name] => ScheduledDowntimeDepth
                                                       [value] => 0
                                                   )
                                           )
                                       [LongProperty] => Array
                                           (
                                               [0] => stdClass Object
                                                   (
                                                       [name] => TimeDown
                                                       [value] => 0
                                                   )
                                               [1] => stdClass Object
                                                   (
                                                       [name] => TimeUnreachable
                                                       [value] => 0
                                                   )
                                               [2] => stdClass Object
                                                   (
                                                       [name] => TimeUp
                                                       [value] => 1176920634
                                                   )
                                           )
                                       [DoubleProperty] => Array
                                           (
                                               [0] => stdClass Object
                                                   (
                                                       [name] => ExecutionTime
                                                       [value] => 0
                                                   )
                                               [1] => stdClass Object
                                                   (
                                                       [name] => Latency
                                                       [value] => 0
                                                   )
                                               [2] => stdClass Object
                                                   (
                                                       [name] => PercentStateChange
                                                       [value] => 0
                                                   )
                                           )
                                       [BooleanProperty] => Array
                                           (
                                               [0] => stdClass Object
                                                   (
                                                       [name] => isAcknowledged
                                                       [value] =>
                                                   )
                                               [1] => stdClass Object
                                                   (
                                                       [name] => isChecksEnabled
                                                       [value] => 1
                                                   )
                                               [2] => stdClass Object
                                                   (
                                                       [name] => isEventHandlersEnabled
                                                       [value] => 1
                                                   )
                                               [3] => stdClass Object
                                                   (
                                                       [name] => isFailurePredictionEnabled
                                                       [value] => 1
                                                   )
                                               [4] => stdClass Object
                                                   (
                                                       [name] => isFlapDetectionEnabled
                                                       [value] => 1
                                                   )
                                               [5] => stdClass Object
                                                   (
                                                       [name] => isHostFlapping
                                                       [value] =>
                                                   )
                                               [6] => stdClass Object
                                                   (
                                                       [name] => isNotificationsEnabled
                                                       [value] => 1
                                                   )
                                               [7] => stdClass Object
                                                   (
                                                       [name] => isPassiveChecksEnabled
                                                       [value] => 1
                                                   )
                                               [8] => stdClass Object
                                                   (
                                                       [name] => isProcessPerformanceData
                                                       [value] => 1
                                                   )
                                           )
                                        [DateProperty] => stdClass Object
                                           (
                                               [name] => LastStateChange
                                               [value] => 2007-04-11T19:01:50.000Z
                                           )
                                   )
                           )
                       [MonitorStatus] => stdClass Object
                           (
                               [MonitorStatusID] => 1
                               [Name] => OK
                               [Description] => Status OK
                           )
                       [LastCheckTime] => 2007-04-18T23:34:20.000Z
                       [NextCheckTime] => 2007-04-18T23:39:20.000Z
                       [MetricType] =>
                       [Domain] =>
                       [StateType] => stdClass Object
                           (
                               [StateTypeID] => 2
                               [Name] => HARD
                               [Description] => State Hard
                           )
                       [CheckType] => stdClass Object
                           (
                               [CheckTypeID] => 1
                               [Name] => ACTIVE
                               [Description] => Active Check
                           )
                       [LastHardState] => stdClass Object
                           (
                               [MonitorStatusID] => 1
                               [Name] => OK
                               [Description] => Status OK
                           )
                       [LastStateChange] => 2007-04-18T18:28:44.000Z
                       [LastPluginOutput] => OK - load average: 1.76, 1.42, 1.49
                       [CurrentNotificationNumber] => 0
                       [RetryNumber] => 1
                       [ScheduledDowntimeDepth] => 0
                       [TimeCritical] => 1176920320
                       [TimeOK] => 1176939260
                       [TimeUnknown] => 0
                       [TimeWarning] => 1176920624
                       [ExecutionTime] => 50
                       [Latency] => 532
                       [PercentStateChange] => 0
                       [isAcceptPassiveChecks] => 1
                       [isChecksEnabled] => 1
                       [isEventHandlersEnabled] => 1
                       [isFailurePredictionEnabled] => 1
                       [isFlapDetectionEnabled] => 1
                       [isNotificationsEnabled] => 1
                       [isObsessOverService] => 1
                       [isProblemAcknowledged] =>
                       [isProcessPerformanceData] => 1
                       [isServiceFlapping] =>
                   )
           )
   )
For a single service, data is returned in the same way except that the service is returned as an Object rather than an array. The Object contains a count as TotalCount (which is always 1) and then the ServiceStatus object as above.
     stdClass Object
     (
         [TotalCount] => 1
         [ServiceStatus] => stdClass Object
             (
                 [ServiceStatusID] => 22
                 [ApplicationTypeID] => 100
                 [Description] => ssh_disk_root
                 [Host] => stdClass Object
     ...
             )
     )

Located in /ServiceDAL.inc.php (line 265)


	
			
Method Summary
ServiceDAL __construct (string $foundationURL)
service getService (string $serviceDescription, string $hostName)
service getServiceById (integer $serviceId)
list getServices ()
service getServicesByDescription (string $serviceDescription)
list getServicesByFilter ([mixed $filter = null], [mixed $sort = null], [mixed $firstResult = -1], [mixed $maxResults = -1])
list getServicesByHostGroupId (integer $hostGroupId)
list getServicesByHostGroupName (string $hostGroupName)
list getServicesByHostId (integer $hostId)
list getServicesByHostName (string $hostName, [mixed $sort = null], [mixed $firstResult = -1], [mixed $maxResults = -1])
list getServicesByIds (list $serviceIds, list $sort, integer $firstResult, integer $maxResults)
list getTroubledServices ([$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
Methods
Constructor __construct (line 274)

create an instance of a ServiceDAL

create an instance of a ServiceDAL

  • access: public
ServiceDAL __construct (string $foundationURL)
  • string $foundationURL: - MUST be provided
getService (line 330)

Get services with the description provided, associated with host provided

Get services with the description provided, associated with host provided

  • access: public
service getService (string $serviceDescription, string $hostName)
  • string $serviceDescription: Description field of service
  • string $hostName: Host that service is associated with
getServiceById (line 353)

get service with the id provided

get service with the id provided

  • access: public
service getServiceById (integer $serviceId)
  • integer $serviceId
getServices (line 285)

Get all the services

Get all the services

  • return: of services
  • access: public
list getServices ()
getServicesByDescription (line 306)

Get services with the description provided

Get services with the description provided

  • access: public
service getServicesByDescription (string $serviceDescription)
  • string $serviceDescription
getServicesByFilter (line 521)

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

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

  • access: public
list getServicesByFilter ([mixed $filter = null], [mixed $sort = null], [mixed $firstResult = -1], [mixed $maxResults = -1])
getServicesByHostGroupId (line 450)

Get the services for the specified hostgroup

Get the services for the specified hostgroup

  • return: of services
  • access: public
  • todo: should services returned by hostgroup be broken down by host?
list getServicesByHostGroupId (integer $hostGroupId)
  • integer $hostGroupId: ID of hostgroup to get services for
getServicesByHostGroupName (line 425)

Get the services for the specified hostgroup

Get the services for the specified hostgroup

  • return: of services
  • access: public
  • todo: should services returned by hostgroup be broken down by host?
list getServicesByHostGroupName (string $hostGroupName)
  • string $hostGroupName: Name of the HostGroup to get services for
getServicesByHostId (line 377)

get services associated with the host specified by hostId

get services associated with the host specified by hostId

  • return: of services
  • access: public
list getServicesByHostId (integer $hostId)
  • integer $hostId
getServicesByHostName (line 400)

get services associated with the host specified by hostName

get services associated with the host specified by hostName

  • return: of services
  • access: public
list getServicesByHostName (string $hostName, [mixed $sort = null], [mixed $firstResult = -1], [mixed $maxResults = -1])
  • string $hostName
getServicesByIds (line 501)

Retrieves all services specified in service id array. no exception is thrown.

Retrieves all services specified in service id array. If a service is not found then it is just not returned and no exception is thrown.

  • return: of services
  • access: public
list getServicesByIds (list $serviceIds, list $sort, integer $firstResult, integer $maxResults)
  • list $serviceIds: List of ids to get detailed information for
  • list $sort: List of fields to sort results on
  • integer $firstResult: Number of the first service to return - use of pagination
  • integer $maxResults: Max number of services to return starting with $firstResult
getTroubledServices (line 475)

Get all troubled services - Services with a monitor status which is not OK.

Get all troubled services - Services with a monitor status which is not OK. Use $firstResult and $maxResults to constrain the number of services returned.

  • return: of services
  • access: public
list getTroubledServices ([$firstResult $firstResult = -1], [$maxResults $maxResults = -1])
  • $firstResult $firstResult: Number of service to start with - Used for pagination
  • $maxResults $maxResults: Total number of services to return based on $firstResult

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