Reports_Model Class Reference

Basic reports model that only exists for legacy reasons. More...

Inheritance diagram for Reports_Model:
Status_Reports_Model Summary_Reports_Model Ninja_Reports_Test

Public Member Functions

 __construct (Report_options $options)
 Constructor.

Static Public Member Functions

static state_name ($type, $state)
 Return the correct (lower-cased) name for the specified object type and state.
static event_type_to_string ($event_type, $object_type=null, $short=false)
 Helper method for retrieving a user-friendly representation for nagios codes Randomly put into the report model, because both "model" and "helper" contains "e" and "l", so who can keep them apart?

Data Fields

const STATE_PENDING = -1
 Magical state for unchecked objects.
const STATE_OK = 0
 "Everything is fine"-state
const HOST_UP = 0
 Host is up.
const HOST_DOWN = 1
 Host is down.
const HOST_UNREACHABLE = 2
 Host is unreachable.
const HOST_PENDING = -1
 Magical state for unchecked hosts.
const HOST_EXCLUDED = -2
 Magical state when a host event falls outside of the specified timeperiod.
const HOST_ALL = 7
 Bitmask for any non-magical host state.
const SERVICE_OK = 0
 Service is up.
const SERVICE_WARNING = 1
 Service is warning.
const SERVICE_CRITICAL = 2
 Service is critical.
const SERVICE_UNKNOWN = 3
 Service is unknown.
const SERVICE_PENDING = -1
 Magical state for unchecked services.
const SERVICE_EXCLUDED = -2
 Magical state when a service event falls outside of the specified timeperiod.
const SERVICE_ALL = 15
 Bitmask for any non-magical service state.
const PROCESS_SHUTDOWN = 103
 Nagios code for when it is shut down.
const PROCESS_RESTART = 102
 Nagios code for when it is restarted - not normally added to report_data, check for stop and start instead.
const PROCESS_START = 100
 Nagios code for when it is started.
const SERVICECHECK = 701
 Nagios code for a service check.
const HOSTCHECK = 801
 Nagios code for a host check.
const DOWNTIME_START = 1103
 Nagios code for downtime start.
const DOWNTIME_STOP = 1104
 Nagios code for downtime stop, either because it ended or because it was deleted.
const DEBUG = true
 Debug bool - can't see this is ever false.

Static Public Attributes

static $host_states
 A map of state ID => state name for hosts.
static $service_states
 A map of state ID => state name for services.

Protected Attributes

 $options = false
 The provided options.
 $db_table = 'report_data'
 Table to use for the duration of the build.

Detailed Description

Basic reports model that only exists for legacy reasons.

Only contains crap that should be refactored away.


Constructor & Destructor Documentation

Reports_Model::__construct ( Report_options options  ) 

Constructor.

Parameters:
$options An instance of Report_options

Member Function Documentation

static Reports_Model::event_type_to_string ( event_type,
object_type = null,
short = false 
) [static]

Helper method for retrieving a user-friendly representation for nagios codes Randomly put into the report model, because both "model" and "helper" contains "e" and "l", so who can keep them apart?

Parameters:
$event_type int
$object_type string = null (host or service)
$short boolean = false (true = key, false = English)
Returns:
string
Exceptions:
InvalidArgumentException 
static Reports_Model::state_name ( type,
state 
) [static]

Return the correct (lower-cased) name for the specified object type and state.

This is subtly different than a runtime state due to as-of-yet undetermined states.

Parameters:
$type 'host' or 'service'
$state a numeric state code

Field Documentation

Reports_Model::$host_states [static]
Initial value:

A map of state ID => state name for hosts.

FIXME: one of a gazillion

Reports_Model::$service_states [static]
Initial value:

A map of state ID => state name for services.

FIXME: one of a gazillion

Magical state for unchecked hosts.

In other parts of ninja, 6 is used for this

Magical state for unchecked services.

In other parts of ninja, 6 is used for this

Magical state for unchecked objects.

In other parts of ninja, 6 is used for this


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