skyline.panorama package
Submodules
skyline.panorama.agent module
skyline.panorama.panorama module
panorama.py
- class Panorama(parent_pid)[source]
Bases:
ThreadThe Panorama class which controls the panorama thread and spawned processes.
- insert_new_metric(metric_name, metrics_to_insert=None)[source]
Insert a new metrics into the metrics tables.
- Parameters:
metric_name (str) – metric name
metrics_to_insert (list) – metric names
- Returns:
inserted_metric_ids
- new_load_metric_vars(metric_vars_file)[source]
Load the metric variables for a check from a metric check variables file
- Parameters:
metric_vars_file (str) – the path and filename to the metric variables files
- Returns:
the metric_vars module object or
False- Return type:
list
- update_slack_thread_ts(i, base_name, metric_timestamp, slack_thread_ts, snab_id)[source]
Update an anomaly record with the slack_thread_ts.
- Parameters:
i – python process id
metric_check_file – full path to the metric check file
- Returns:
returns True
- update_anomaly_end_timestamp(i, anomaly_id, anomaly_end_timestamp, anomalies_to_update)[source]
Update anomaly records with the anomaly_end_timestamp.
- Parameters:
self (object) – self
i (object) – python process id
anomaly_id (int) – the anomaly id
anomaly_end_timestamp (int) – the anomaly end timestamp
anomalies_to_update (dict) – a dict of anomaly ids and anomaly_end_timestamps
- Returns:
anomaly_end_timestamps_updated
- Return type:
list
- update_alert_ts(i, base_name, metric_timestamp, alerted_at)[source]
Update an anomaly record with the alert_ts.
- Parameters:
i – python process id
base_name – base name
metric_timestamp – the anomaly timestamp
alerted_at – the alert timestamp
- Returns:
returns True
- determine_db_id(table, key, value, engine=None, use_table=None, log=True)[source]
Get the id of something from the database and create a new entry if it does not exist
- Parameters:
table (str) – table name
key (str) – key name
value (str) – value name
engine (object) – the engine object
use_table (object) – the use_table object
- Returns:
int or boolean
- update_snab(i, snab_panorama_items)[source]
Update snab anomaly records.
- Parameters:
i – python process id
- Returns:
returns True