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.
 get_state ()
 API status entrypoint.
 get_uptime ()
 Calculate uptime between two timestamps for host/service.

Protected Member Functions

 uptime_query ($is_service, $objects)
 Get log details for host/service.
 get_last_shutdown ($timestamp)
 Get latest (useful) process shutdown event.
 get_initial_dt_depths ($type, $names, $timestamp)
 Fetch information about SCHEDULED_DOWNTIME status for multiple objects.
 get_initial_states ($type, $names, $timestamp)
 Get inital states of a set of objects.

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,
names,
timestamp 
) [protected]

Fetch information about SCHEDULED_DOWNTIME status for multiple objects.

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

Get inital states of a set of objects.

Returns:
array of initial states
Status_Reports_Model::get_last_shutdown ( timestamp  )  [protected]

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 ( is_service,
objects 
) [protected]

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 19 Dec 2018 for ninja by  doxygen 1.6.1