Reports model Responsible for fetching data for avail and SLA reports. More...
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. |
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.
Status_Reports_Model::__construct | ( | Report_options $ | options, | |
$ | db_table = 'report_data' | |||
) |
Constructor.
$options | An instance of Report_options | |
$db_table | Database name |
Status_Reports_Model::get_initial_dt_depths | ( | $ | type, | |
$ | names, | |||
$ | timestamp | |||
) | [protected] |
Fetch information about SCHEDULED_DOWNTIME status for multiple objects.
Status_Reports_Model::get_initial_states | ( | $ | type, | |
$ | names, | |||
$ | timestamp | |||
) | [protected] |
Get inital states of a set of objects.
Status_Reports_Model::get_last_shutdown | ( | $ | timestamp | ) | [protected] |
Get latest (useful) process shutdown event.
Status_Reports_Model::get_uptime | ( | ) |
Calculate uptime between two timestamps for host/service.
Status_Reports_Model::uptime_query | ( | $ | is_service, | |
$ | objects | |||
) | [protected] |
Get log details for host/service.