Basic reports model that only exists for legacy reasons. More...
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. |
Basic reports model that only exists for legacy reasons.
Only contains crap that should be refactored away.
Reports_Model::__construct | ( | Report_options $ | options | ) |
Constructor.
$options | An instance of Report_options |
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?
$event_type | int | |
$object_type | string = null (host or service) | |
$short | boolean = false (true = key, false = English) |
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.
$type | 'host' or 'service' | |
$state | a numeric state code |
Reports_Model::$host_states [static] |
array( Reports_Model::HOST_UP => 'up', Reports_Model::HOST_DOWN => 'down', Reports_Model::HOST_UNREACHABLE => 'unreachable', Reports_Model::HOST_PENDING => 'undetermined', Reports_Model::HOST_EXCLUDED => 'hidden')
A map of state ID => state name for hosts.
FIXME: one of a gazillion
Reports_Model::$service_states [static] |
array( Reports_Model::SERVICE_OK => 'ok', Reports_Model::SERVICE_WARNING => 'warning', Reports_Model::SERVICE_CRITICAL => 'critical', Reports_Model::SERVICE_UNKNOWN => 'unknown', Reports_Model::SERVICE_PENDING => 'undetermined', Reports_Model::SERVICE_EXCLUDED => 'hidden')
A map of state ID => state name for services.
FIXME: one of a gazillion
const Reports_Model::HOST_PENDING = -1 |
Magical state for unchecked hosts.
In other parts of ninja, 6 is used for this
const Reports_Model::SERVICE_PENDING = -1 |
Magical state for unchecked services.
In other parts of ninja, 6 is used for this
const Reports_Model::STATE_PENDING = -1 |
Magical state for unchecked objects.
In other parts of ninja, 6 is used for this