from collections import OrderedDict
VERSION = "1.1.0"
"""Version of this set of plugin definitions."""
MINIMUM_THAT_VERSION = "1.1.0"
"""Minimum THAT version required to run these plugin definitions."""
NAME = "taniumstats"
PRIORITY = 9999
ANALYZE_DATA = OrderedDict()
GET_TANIUM_DATA = OrderedDict()
GET_INTERNET_DATA = [
]
ANALYZE_DATA["tanium_info_json"] = """
# Load tanium_info.json
result = self.load_json_file("tanium_info.json")
"""
ANALYZE_DATA["discover_info_json"] = """
# Load discover_info.json
result = self.load_json_file("discover_info.json")
"""
ANALYZE_DATA["tanium_version"] = """
src = self.get_result("tanium_info_json")
path = "Settings/Version"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_active_questions"] = """
src = self.get_result("tanium_info_json")
path = "Active Question Cache/Active Question Estimate"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_string_count"] = """
src = self.get_result("tanium_info_json")
path = "String Cache/Total String Count"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_total_questions"] = """
src = self.get_result("tanium_info_json")
path = "Question History/Question Count"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_total_actions"] = """
src = self.get_result("tanium_info_json")
path = "Action History Cache/Actions"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_platform_handle_count"] = """
src = self.get_result("tanium_info_json")
path = "System Performance Info/HandleCount"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_platform_process_count"] = """
src = self.get_result("tanium_info_json")
path = "System Performance Info/ProcessCount"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["tanium_platform_memory_available"] = """
src = self.get_result("tanium_info_json")
path = "percentage(System Performance Info/PhysicalAvailable,System Performance Info/PhysicalTotal)"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["managed_clients"] = """
src = self.get_result("tanium_info_json")
path = "Active Question Cache/Active Client Estimate"
result = self.resolve_dict_path(path, src)
"""
ANALYZE_DATA["unmanaged_clients"] = """
src = self.get_result("discover_info_json")
path = "unmanaged"
result = self.force_int(self.resolve_dict_path(path, src),0)
"""
ANALYZE_DATA["that_questions_asked"] = """
csv = "that_stats.csv"
df = self.load_csv_as_df(csv)
result = len(df.index)
"""
ANALYZE_DATA["that_avg_question_seconds"] = """
csv = "that_stats.csv"
df = self.load_csv_as_df(csv)
result = int(df["Question Total Seconds"].mean())
"""