Big, fat TODO: Almost every method asks the DB for all data and returns it. More...
Public Member Functions | |
get_events (Op5Auth $auth) | |
Used from the HTTP API. | |
build_alert_summary_query ($fields=null, $is_api_call=false, $blacklisted_criteria=array(), $db_table=null, $auth=null) | |
Create the base of the query to use when calculating alert summary. | |
top_alert_producers () | |
Get alert summary for "top (hard) alert producers". | |
alert_totals () | |
Get alert totals. | |
recent_alerts () | |
Find and return the latest $this->options['summary_items'] alert producers according to the search criteria. | |
histogram ($slots=false) | |
Fetch alert history for histogram report. | |
histogram_data ($query, $date_str='j', $slots=false, $newstatesonly=false) | |
Populate slots for histogram. | |
Static Public Member Functions | |
static | add_event_comment ($timestamp, $event_type, $host_name, $service, $comment, $username) |
Add a new comment to the event pointed to by the timestamp/event_type/host_name/service. |
Big, fat TODO: Almost every method asks the DB for all data and returns it.
Instead, users should subscribe what they're interested in, and be fed that data once the query runs, once.
Summary_Reports_Model::alert_totals | ( | ) |
Get alert totals.
This is identical to the toplist in many respects, but the result array is different.
Summary_Reports_Model::build_alert_summary_query | ( | $ | fields = null , |
|
$ | is_api_call = false , |
|||
$ | blacklisted_criteria = array() , |
|||
$ | db_table = null , |
|||
$ | auth = null | |||
) |
Create the base of the query to use when calculating alert summary.
Each caller is responsible for adding sorting and limit options as necessary.
$fields | string Comma separated list of database columns the caller needs | |
$is_api_call | boolean = false | |
$blacklisted_criteria | array = array() | |
$db_table | string = null | |
$auth | auth module to use, if not using default |
Summary_Reports_Model::get_events | ( | Op5Auth $ | auth | ) |
Used from the HTTP API.
$auth | Op5Auth |
Summary_Reports_Model::histogram | ( | $ | slots = false |
) |
Fetch alert history for histogram report.
$slots | array with slots to fill with data |
Summary_Reports_Model::histogram_data | ( | $ | query, | |
$ | date_str = 'j' , |
|||
$ | slots = false , |
|||
$ | newstatesonly = false | |||
) |
Populate slots for histogram.
$query | sql | |
$date_str | string for use in PHP date() | |
$slots | array with slots to fill with data | |
$newstatesonly | bool Used to decide if to ignore repated events or not |
Summary_Reports_Model::top_alert_producers | ( | ) |
Get alert summary for "top (hard) alert producers".