skyline.panorama package

Submodules

skyline.panorama.agent module

class PanoramaAgent[source]
run()[source]

skyline.panorama.panorama module

class Panorama(parent_pid)[source]

Bases: threading.Thread

The Panorama class which controls the panorama thread and spawned processes.

check_if_parent_is_alive()[source]

Self explanatory

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

spin_process(i, metric_check_file)[source]

Assign a metric anomaly to process.

Parameters:
  • i – python process id
  • metric_check_file – full path to the metric check file
Returns:

returns True

run()[source]

Called when the process intializes.

Determine if what is known in the Skyline DB blah

Module contents