You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
727 B
15 lines
727 B
4 years ago
|
import threading, socket, getpass
|
||
|
from . import O2A, A2O # Data flow Orchestrator To Agent
|
||
|
|
||
|
# Main def
|
||
|
def Agent(inGSettings):
|
||
|
# Detect Machine host name and username
|
||
|
inGSettings["AgentDict"]["HostNameUpperStr"] = socket.gethostname().upper()
|
||
|
inGSettings["AgentDict"]["UserUpperStr"] = getpass.getuser().upper()
|
||
|
|
||
|
# Start thread to wait data from Orchestrator (O2A)
|
||
|
lO2AThread = threading.Thread(target=O2A.O2A_Loop, kwargs={"inGSettings":inGSettings})
|
||
|
lO2AThread.start()
|
||
|
|
||
|
# Send log that Agent has been started
|
||
|
A2O.LogListSend(inGSettings=inGSettings, inLogList=[f'Host: {inGSettings["AgentDict"]["HostNameUpperStr"]}, User: {inGSettings["AgentDict"]["UserUpperStr"]}, Agent has been started.'])
|