diff --git a/agent360/plugins/cloudlinux.py b/agent360/plugins/cloudlinux.py index f0b36d4..40434e6 100644 --- a/agent360/plugins/cloudlinux.py +++ b/agent360/plugins/cloudlinux.py @@ -26,13 +26,14 @@ def run(self, config): except Exception: return "Could not load lveinfo data" - if data['success'] is not 1: + if data['success'] != 1: return "Failed to load lveinfo" results = {} for line in data['data']: - username = line['ID'] + # ID may be an int (UID without a username), keys must be uniform + username = str(line['ID']) del line['ID'] results[username] = line @@ -40,3 +41,4 @@ def run(self, config): if __name__ == '__main__': Plugin().execute() + \ No newline at end of file diff --git a/agent360/plugins/mysql.py b/agent360/plugins/mysql.py index 19e9887..3e3ab49 100644 --- a/agent360/plugins/mysql.py +++ b/agent360/plugins/mysql.py @@ -151,18 +151,18 @@ def run(self, config): 'source_retry_count': 'master_retry_count', } non_delta_slave = ( - 'slave_io_state', - 'master_host', - 'seconds_behind_master', - 'read_master_log_pos', + 'slave_io_state', 'replica_io_state', + 'master_host', 'source_host', + 'seconds_behind_master', 'seconds_behind_source', + 'read_master_log_pos', 'read_source_log_pos', 'relay_log_pos', - 'slave_io_running', - 'slave_sql_running', + 'slave_io_running', 'replica_io_running', + 'slave_sql_running', 'replica_sql_running', 'last_error', - 'exec_master_log_pos', + 'exec_master_log_pos', 'exec_source_log_pos', 'relay_log_space', - 'slave_sql_running_state', - 'master_retry_count' + 'slave_sql_running_state', 'replica_sql_running_state', + 'master_retry_count', 'source_retry_count' ) if query_result_slave is None: query_result_slave = dict() @@ -171,7 +171,7 @@ def run(self, config): key = replica_key_map.get(key, key) if key == 'slave_sql_running': value = 1 if value == 'Yes' else 0 - if key == 'slave_io_running': + if key in ('slave_io_running', 'replica_io_running'): value = 1 if value == 'Yes' else 0 for c in constructors: