Server IP : 92.204.138.22 / Your IP : 18.188.35.25 Web Server : Apache System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64 User : internationaljou ( 1019) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/internationaljou/public_html/admin/js/BROKY_ADMIN/alfasymlink/root/lib/panopta-agent/library/ |
Upload File : |
from datetime import datetime def status(agent, server_key, schedules, plugins): """ The 'status' argument allows the target machine's user to see various metrics without having to go into the control panel. """ print("Agent Version %s Status\n------------\n" % agent.version) # Print important config variables print("Config Variables:\n------------") print("Server Key: %s\nCommunication Endpoint: %s" % (server_key, agent.agg_url)) # Print out plugins print("\nActive Plugins:\n------------") for id, schedule in list(schedules.items()): print("plugin name: %s" % schedule.plugin_textkey) print("resource: %s" % schedule.resource_textkey) print("params: %s" % str(schedule.option)) ch_minutes = int(schedule.frequency) / 60 print("check interval: %d minutes\n" % ch_minutes) # Plugin status and errors print("\nPlugin Errors: \n") for key, value in plugins.metadata.items(): plugin_label = value[0] metadict = value[1] error_string = "" for ikey in list(metadict.keys()): if metadict[ikey].get("error_message") is not None: error_string += "%s : %s\n" % (metadict[ikey]["label"], metadict[ikey]["error_message"]) if error_string != "": print(plugin_label + "\n----") print(error_string) def stats(schedules, number_of_syncs, last_sync): """ The 'stats' argument displays to the user various statistics on the agent's operations. """ print("Agent Statistics\n--------\n") for id, schedule in list(schedules.items()): print("plugin: %s" % schedule.plugin_textkey) print("plugin params: %s" % str(schedule.option)) print("last check value: %s" % str(schedule.last_check_value)) print("next check time: %s\n" % datetime.ctime(schedule.next_check_time)) print("Number of agent syncs with server: %d" % number_of_syncs) if last_sync: last_sync_f = last_sync else: last_sync_f = "--" print("Last succesful sync: %s" % last_sync_f)