Status_Reports_Model Class Reference

Reports model Responsible for fetching data for avail and SLA reports. More...

Inheritance diagram for Status_Reports_Model:
Reports_Model Ninja_Reports_Test

Public Member Functions

 __construct (Report_options $options, $db_table='report_data')
 Constructor.
 uptime_query ()
 Get log details for host/service.
 get_uptime ()
 Calculate uptime between two timestamps for host/service.
 get_last_shutdown ()
 Get latest (useful) process shutdown event.

Protected Member Functions

 get_initial_dt_depths ($type= 'host', $names=array())
 Fetch information about SCHEDULED_DOWNTIME status for multiple objects.
 get_initial_states ($type= 'host', $names=array())
 Get inital states of a set of objects.

Protected Attributes

 $st_is_service = false
 Whether the objects in this report are services.
 $st_source = false
 Array of (non-group) objects that are part of this report.
 $calculator = false
 The top-level calculator that represents this report.

Detailed Description

Reports model Responsible for fetching data for avail and SLA reports.

This class must be instantiated to work properly.

## State interaction in subreports Given two objects, assuming only two states per object type, would interact such that the non-OK state overrules the OK state completely as such: host UP | DOWN | scheduled | unscheduled | scheduled | unscheduled ------------++++++++++++++++++++++++++++++++++++++++++++++++++++++ scheduled + sched up | unsched up | sched down | unsched down UP ------------+------------+-------------+------------+------------- unscheduled+ unsched up | unsched up | sched down | unsched down host ----------------+------------+-------------+------------+------------- scheduled + sched down | sched down | sched down | unsched down DOWN------------+------------+-------------+------------+------------- unscheduled+unsched down| unsched down|unsched down| unsched down

When two sub-objects have different non-OK states, the outcome depends on whether scheduleddowntimeasuptime is used or not. If the option is used, then the service with the worst non-scheduled state is used. If the option is not used, the worst state is used, prioritizing any non-scheduled state.

This applies to non-"cluster mode" reports. If you're in cluster mode, this applies backwards exactly.


Constructor & Destructor Documentation

Status_Reports_Model::__construct ( Report_options options,
db_table = 'report_data' 
)

Constructor.

Parameters:
$options An instance of Report_options
$db_table Database name

Member Function Documentation

Status_Reports_Model::get_initial_dt_depths ( type = 'host',
names = array() 
) [protected]

Fetch information about SCHEDULED_DOWNTIME status for multiple objects.

Returns:
array of Depth of initial downtime.
Status_Reports_Model::get_initial_states ( type = 'host',
names = array() 
) [protected]

Get inital states of a set of objects.

Returns:
array of initial states
Status_Reports_Model::get_last_shutdown (  ) 

Get latest (useful) process shutdown event.

Returns:
Timestamp when of last shutdown event prior to $start_time
Status_Reports_Model::get_uptime (  ) 

Calculate uptime between two timestamps for host/service.

Returns:
array or false on error
Status_Reports_Model::uptime_query (  ) 

Get log details for host/service.

Returns:
PDO result object on success. FALSE on error.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 30 Oct 2014 for ninja by  doxygen 1.6.1