transfer_xml

Descripción 

 Detecta el modo de transferencia y llama a la función agentplugin() para realizar la transferencia. 

 Parámetros 

 

 

 

 Nombre 

 Tipo 

 Requerido 

 Descripción 

 

 

 file 

 str 

 Si 

 Diccionario con la configuración del agente 

 

 

 transfer_mode 

 str 

 Si 

 Modo de transferencia. Por defecto es global_variables['transfer_mode'] 

 

 

 tentacle_ip 

 str 

 Si 

 Dirección IP para Tentacle. Por defecto es global_variables['tentacle_ip'] 

 

 

 tentacle_port 

 int 

 Si 

 Puerto para Tentacle. Por defecto es global_variables['tentacle_port'] 

 

 

 tentacle_extra_opts 

 str 

 Si 

 Opciones extra para Tentacle. Por defecto es global_variables['

 

 tentacle_extra_opts'] 

 

 

 

 

 data_dir 

 str 

 Si 

 Ruta de la carpeta data_dir. Por defecto es global_variables['

 

 data_dir'] 

 

 

 

 

 

 Return   

 

 

 

 Tipo 

 

 

 None 

 

 

 

 Versión 

 

 1.0.0 

 

 Ejemplo 

 import pandoraPlugintools as pt

# Define the path to the file to be transferred

file_to_transfer = '/tmp/agent.data'

# Define transfer mode (e.g., 'local' or 'tentacle')

transfer_mode = 'tentacle'

# Define Tentacle IP and port

tentacle_ip = '192.168.1.100'

tentacle_port = 41121

# Define data directory for local transfer mode

data_dir = '/var/spool/pandora/data_in/'

# Perform the file transfer based on the selected transfer mode

pt.transfer.transfer_xml(file_to_transfer, transfer_mode, tentacle_ip, tentacle_port, tentacle_extra_opts, data_dir)

# Print a message indicating the successful transfer

print("File transfer completed.")