1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

append mb to memory key names; adjust expected timestamps to utc tz

This commit is contained in:
Jon Smith
2021-04-14 09:06:14 -05:00
parent 14838f7f5d
commit f3d00cf38a
5 changed files with 56 additions and 48 deletions

View File

@ -42,11 +42,11 @@ Examples:
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC-08:00) Pacific Time (US & Canada)", "time_zone": "(UTC-08:00) Pacific Time (US & Canada)",
"total_physical_memory": "2,047 MB", "total_physical_memory_mb": "2,047 MB",
"available_physical_memory": "1,417 MB", "available_physical_memory_mb": "1,417 MB",
"virtual_memory_max_size": "2,687 MB", "virtual_memory_max_size_mb": "2,687 MB",
"virtual_memory_available": "1,482 MB", "virtual_memory_available_mb": "1,482 MB",
"virtual_memory_in_use": "1,205 MB", "virtual_memory_in_use_mb": "1,205 MB",
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "TEST.local", "domain": "TEST.local",
"logon_server": "\\\\WIN-AA1A1A11AAA", "logon_server": "\\\\WIN-AA1A1A11AAA",
@ -103,11 +103,11 @@ Examples:
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC-08:00) Pacific Time (US & Canada)", "time_zone": "(UTC-08:00) Pacific Time (US & Canada)",
"total_physical_memory": 2047, "total_physical_memory_mb": 2047,
"available_physical_memory": 1417, "available_physical_memory_mb": 1417,
"virtual_memory_max_size": 2687, "virtual_memory_max_size_mb": 2687,
"virtual_memory_available": 1482, "virtual_memory_available_mb": 1482,
"virtual_memory_in_use": 1205", "virtual_memory_in_use_mb": 1205",
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "TEST.local", "domain": "TEST.local",
"logon_server": "\\\\WIN-AA1A1A11AAA", "logon_server": "\\\\WIN-AA1A1A11AAA",
@ -195,11 +195,11 @@ def process(proc_data):
"system_locale": "string", "system_locale": "string",
"input_locale": "string", "input_locale": "string",
"time_zone": "string", "time_zone": "string",
"total_physical_memory": "string", "total_physical_memory_mb": "string",
"available_physical_memory": integer, "available_physical_memory_mb": integer,
"virtual_memory_max_size": integer, "virtual_memory_max_size_mb": integer,
"virtual_memory_available": integer, "virtual_memory_available_mb": integer,
"virtual_memory_in_use": integer, "virtual_memory_in_use_mb": integer,
"page_file_locations": "string", "page_file_locations": "string",
"domain": "string", "domain": "string",
"logon_server": "string", "logon_server": "string",
@ -230,11 +230,11 @@ def process(proc_data):
) )
int_list = [ int_list = [
"total_physical_memory", "total_physical_memory_mb",
"available_physical_memory", "available_physical_memory_mb",
"virtual_memory_max_size", "virtual_memory_max_size_mb",
"virtual_memory_available", "virtual_memory_available_mb",
"virtual_memory_in_use", "virtual_memory_in_use_mb",
] ]
for key in int_list: for key in int_list:
proc_data[key] = convert_to_int(proc_data.get(key)) proc_data[key] = convert_to_int(proc_data.get(key))
@ -326,6 +326,14 @@ def parse(data, raw=False, quiet=False):
raw_output[k] = parse_network_cards(v) raw_output[k] = parse_network_cards(v)
elif k in ["hyperv_requirements"]: elif k in ["hyperv_requirements"]:
raw_output[k] = parse_hyperv_requirements(v) raw_output[k] = parse_hyperv_requirements(v)
elif k in [
"total_physical_memory",
"available_physical_memory",
"virtual_memory_max_size",
"virtual_memory_available",
"virtual_memory_in_use"
]:
raw_output[k + "_mb"] = v.strip()
else: else:
raw_output[k] = v.strip() raw_output[k] = v.strip()

View File

@ -8,8 +8,8 @@
"registered_owner": "Test, Inc.", "registered_owner": "Test, Inc.",
"registered_organization": "Test, Inc.", "registered_organization": "Test, Inc.",
"product_id": "11111-11111-11111-AA111", "product_id": "11111-11111-11111-AA111",
"original_install_date": 1553633490, "original_install_date": 1553640690,
"system_boot_time": 1617102839, "system_boot_time": 1617110039,
"system_manufacturer": "Dell Inc.", "system_manufacturer": "Dell Inc.",
"system_model": "Precision 5530", "system_model": "Precision 5530",
"system_type": "x64-based PC", "system_type": "x64-based PC",
@ -23,11 +23,11 @@
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC-06:00) Central Time (US & Canada)", "time_zone": "(UTC-06:00) Central Time (US & Canada)",
"total_physical_memory": 32503, "total_physical_memory_mb": 32503,
"available_physical_memory": 19743, "available_physical_memory_mb": 19743,
"virtual_memory_max_size": 37367, "virtual_memory_max_size_mb": 37367,
"virtual_memory_available": 22266, "virtual_memory_available_mb": 22266,
"virtual_memory_in_use": 15101, "virtual_memory_in_use_mb": 15101,
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "test.com", "domain": "test.com",
"logon_server": "\\\\TESTDC01", "logon_server": "\\\\TESTDC01",

View File

@ -8,8 +8,8 @@
"registered_owner": "User", "registered_owner": "User",
"registered_organization": "", "registered_organization": "",
"product_id": "00111-12345-00001-AA111", "product_id": "00111-12345-00001-AA111",
"original_install_date": 1613496027, "original_install_date": 1613503227,
"system_boot_time": 1616163903, "system_boot_time": 1616171103,
"system_manufacturer": "VMware, Inc.", "system_manufacturer": "VMware, Inc.",
"system_model": "VMware7,1", "system_model": "VMware7,1",
"system_type": "x64-based PC", "system_type": "x64-based PC",
@ -23,11 +23,11 @@
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC-08:00) Pacific Time (US & Canada)", "time_zone": "(UTC-08:00) Pacific Time (US & Canada)",
"total_physical_memory": 2047, "total_physical_memory_mb": 2047,
"available_physical_memory": 1417, "available_physical_memory_mb": 1417,
"virtual_memory_max_size": 2687, "virtual_memory_max_size_mb": 2687,
"virtual_memory_available": 1482, "virtual_memory_available_mb": 1482,
"virtual_memory_in_use": 1205, "virtual_memory_in_use_mb": 1205,
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "TEST.local", "domain": "TEST.local",
"logon_server": "\\\\WIN-AA1A1A11AAA", "logon_server": "\\\\WIN-AA1A1A11AAA",

View File

@ -8,8 +8,8 @@
"registered_owner": "Windows User", "registered_owner": "Windows User",
"registered_organization": "", "registered_organization": "",
"product_id": "11111-11111-11111-AA111", "product_id": "11111-11111-11111-AA111",
"original_install_date": 1544685348, "original_install_date": 1544692548,
"system_boot_time": 1616960084, "system_boot_time": 1616967284,
"system_manufacturer": "Microsoft Corporation", "system_manufacturer": "Microsoft Corporation",
"system_model": "Virtual Machine", "system_model": "Virtual Machine",
"system_type": "x64-based PC", "system_type": "x64-based PC",
@ -23,11 +23,11 @@
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC+03:00) Kuwait, Riyadh", "time_zone": "(UTC+03:00) Kuwait, Riyadh",
"total_physical_memory": 3555, "total_physical_memory_mb": 3555,
"available_physical_memory": 771, "available_physical_memory_mb": 771,
"virtual_memory_max_size": 5731, "virtual_memory_max_size_mb": 5731,
"virtual_memory_available": 2751, "virtual_memory_available_mb": 2751,
"virtual_memory_in_use": 2980, "virtual_memory_in_use_mb": 2980,
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "WORKGROUP", "domain": "WORKGROUP",
"logon_server": "\\\\WIN-1A1A1AA11AA", "logon_server": "\\\\WIN-1A1A1AA11AA",

View File

@ -8,8 +8,8 @@
"registered_owner": "jdoe", "registered_owner": "jdoe",
"registered_organization": "", "registered_organization": "",
"product_id": "00000-111-1111111-11111", "product_id": "00000-111-1111111-11111",
"original_install_date": 1420135200, "original_install_date": 1420142400,
"system_boot_time": 1616436951, "system_boot_time": 1616444151,
"system_manufacturer": "LENOVO", "system_manufacturer": "LENOVO",
"system_model": "11111AA", "system_model": "11111AA",
"system_type": "x64-based PC", "system_type": "x64-based PC",
@ -23,11 +23,11 @@
"system_locale": "en-us;English (United States)", "system_locale": "en-us;English (United States)",
"input_locale": "en-us;English (United States)", "input_locale": "en-us;English (United States)",
"time_zone": "(UTC-06:00) Central Time (US & Canada)", "time_zone": "(UTC-06:00) Central Time (US & Canada)",
"total_physical_memory": 8075, "total_physical_memory_mb": 8075,
"available_physical_memory": 1620, "available_physical_memory_mb": 1620,
"virtual_memory_max_size": 16149, "virtual_memory_max_size_mb": 16149,
"virtual_memory_available": 6468, "virtual_memory_available_mb": 6468,
"virtual_memory_in_use": 9681, "virtual_memory_in_use_mb": 9681,
"page_file_locations": "C:\\pagefile.sys", "page_file_locations": "C:\\pagefile.sys",
"domain": "WORKGROUP", "domain": "WORKGROUP",
"logon_server": "\\\\TEST", "logon_server": "\\\\TEST",