9.5.9. plugins/plugin_taniumstats.pyΒΆ

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
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())
"""