Description

User wants to configure an event-options resulting file to be sent to an sftp server, but the file is not being uploaded successfully.

Solution

The complete configuration for this to work would be:

 

set event-options destinations <destination-name> archive-sites sftp://user@hostname:<destination-port>/path password <password>

set event-options generate-event <event-name> time-interval <interval-in-seconds>

set event-options policy <policy-name> events <event-name>

set event-options policy <policy-name> then execute-commands commands "command"

set event-options policy <policy-name> then execute-commands commands "command"

set event-options policy <policy-name> then execute-commands commands "command"

set event-options policy <policy-name> then execute-commands commands "command"

set event-options policy <policy-name> then execute-commands output-filename <file-name.txt>

set event-options policy <policy-name> then execute-commands destination <destination-name>

set event-options policy <policy-name> then execute-commands output-format text

 

Syslog file can be configured to see the messages generating when the file is transferred:

 

set system syslog file <file-name> user info

 

Example log results:

 

root@SRX# run show log event-options

Oct 18 10:43:30 a12-27 root: invoke-commands: Executed /tmp/evt_cmd_Q8OZGi, output to /tmp/evt_op_GB5C8t in text format

Oct 18 10:43:31 a12-27 root: transfer-file: Transferred /tmp/evt_op_GB5C8t

 

Note: The path needs to include at least 2 levels. For example:

 

/homes --> Using this path causes issues on the server and the file is sent from the SRX but it's not added to the path on the server side.

 

/homes/user --> Using this path the file is transferred successfully.

Modification History

2023-10-26 : Article Created
12/20/2023: Formatting corrections made