skyline.panorama package¶
Submodules¶
skyline.panorama.panorama module¶
-
class
Panorama
(parent_pid)[source]¶ Bases:
threading.Thread
The Panorama class which controls the panorama thread and spawned processes.
-
mysql_select
(select)[source]¶ Select data from mysql database
Parameters: select (str) – the select string Returns: tuple Return type: tuple, boolean Example usage:
query = 'select id, test from test' result = self.mysql_select(query)
Example of the 0 indexed results tuple, which can hold multiple results:
>> print('results: %s' % str(results)) results: [(1, u'test1'), (2, u'test2')] >> print('results[0]: %s' % str(results[0])) results[0]: (1, u'test1')
Note
- If the MySQL query fails a boolean will be returned not a tuple
False
None
-
mysql_insert
(insert)[source]¶ Insert data into mysql table
Parameters: select (str) – the insert string Returns: int Return type: int or boolean Example usage:
query = 'insert into host (host) VALUES ('this_host')' result = self.mysql_insert(query)
Note
- If the MySQL query fails a boolean will be returned not a tuple
False
None
-
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)[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
-