SingleStateCalculator Class Reference

State calculator for a single object - thus more of a state. More...

Inheritance diagram for SingleStateCalculator:
StateCalculator

Public Member Functions

 initialize ($initial_state, $initial_depth, $is_running)
 Prepare a state calculator for action Takes a number of initialization arguments, simply because they can be more efficiently retrieved in bulk somewhere else.
 add_event ($row=false)
 Take a database row object, and parse it.
 calculate_object_state ()
 Calculate the object state, based on the chosen state calculator.
 get_data ()
 For hysterical reasons, we expect every single report type to return the report data in a brand new way.
 finalize ()
 Finalize the report, calculating real uptime from our internal meta-format.

Data Fields

 $st_log = false
 The log array, only used for treds, should use summary reports for this.

Protected Member Functions

 filter_excluded_state ($state)
 Manually excluded states are excluded here.
 st_update_log ($row=false)
 Deprecated method that keeps the log around for the benefit of the trend graph.

Protected Attributes

 $st_last_dt_init = 1
 set to FALSE on nagios restart, and a timestamp on first DT start after restart, so we can exclude duplicate downtime_start
 $st_real_state = false
 The real state of the object.
 $st_dt_objects = array()
 objects in downtime

Detailed Description

State calculator for a single object - thus more of a state.

. keeper?


Member Function Documentation

SingleStateCalculator::add_event ( row = false  ) 

Take a database row object, and parse it.

Parameters:
$row Database row

Reimplemented from StateCalculator.

SingleStateCalculator::calculate_object_state (  ) 

Calculate the object state, based on the chosen state calculator.

If there is sub reports, the argument will be ignored. Otherwise, use either the argument or the object's real state, according to magical properties inherent in the numbers themselves.

SingleStateCalculator::filter_excluded_state ( state  )  [protected]

Manually excluded states are excluded here.

Parameters:
$state int
Returns:
int
SingleStateCalculator::get_data (  ) 

For hysterical reasons, we expect every single report type to return the report data in a brand new way.

Jay.

Returns:
array

Reimplemented from StateCalculator.

SingleStateCalculator::initialize ( initial_state,
initial_depth,
is_running 
)

Prepare a state calculator for action Takes a number of initialization arguments, simply because they can be more efficiently retrieved in bulk somewhere else.

Parameters:
$initial_state The state for the object when the report starts
$initial_depth The downtime depth when the report starts - in practice a boolean
$is_running Is nagios itself running when the report starts?

Reimplemented from StateCalculator.


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