This commit is contained in:
=
2025-08-20 15:04:57 -04:00
parent 7d7db9eb2a
commit 0645982090
7 changed files with 47 additions and 10 deletions
+6 -1
View File
@@ -3,7 +3,7 @@ import requests
import json
import os
def devicehistory(url):
def devicehistory(url, outputjson: bool):
endpoint = url + '/v1/getexechistory'
print("\n")
print("1. Today")
@@ -43,7 +43,12 @@ def devicehistory(url):
}
response = requests.request("POST", endpoint, headers=headers, data=payload, verify=False)
if outputjson == True:
return response
parse_text = json.loads(response.text)
for block in parse_text['response']['exechistory']:
print(f"Command: {block['commandline']}")
print(f"Date: {block['datetime']}")