Created on
11-02-2021
12:05 AM
Edited on
09-20-2024
02:24 AM
By
Jean-Philippe_P
Description
To troubleshoot the automation stitch, it is necessary to stop all running scripts, reset any debug that may be running, and then enable debugging for automation stitch.
FortiGate # exec auto-script stopall
No script is running.
FortiGate # diag debug reset
FortiGate # diag debug app autod -1
Debug messages will be on for 30 minutes.
FortiGate # diag debug enable
Trigger the automation stitch either via GUI or CLI:
- Via GUI:
'Right-click' on the Automation stitch -> Test Automation Stitch. - Via CLI:
exec auto-script start backup //backup is the name of automation stitch
FortiGate # auto_stitch_stats()-103: Request stitch(all) statistics
0: config system auto-script
0: edit "autod.0"
0: set script "execute backup config ftp /Backup/backup.cfg 192.168.1.253 testuser testpassword"
0: end
__action_cli_script_open()-182: cli script action:backup is called. svc ctx:0x6142378
accprof:super_admin script:
execute backup config ftp /Backup/backup.cfg 192.168.1.253 testuser testpassword
5: execute backup config ftp /Backup/backup.cfg 192.168.1.253 testuser testpassword
__cli_script_close()-122: cli script:
autod.0
output:
########## script name: autod.0 ##########
========== #1, 2021-10-25 14:32:02 ==========
FortiGate $ execute backup config ftp /Backup/backup.cfg 192.168.1.253 testuser testpassword
Please wait...
Connect to ftp server 192.168.1.253 ...
Send config file to ftp server via vdom root failed.
Command fail. Return code 5
__action_cli_script_close()-209: cli script action is done.
Other debugging of the automation stitch is done with the following commands:
FortiGate # diag test app autod -----> Press Enter.
- Enable/disable log dumping.
- Show automation settings.
- Show automation statistics.
- Show plugin statistics.
- Show running stitches.
These are the available options for this process, and they can provide valuable information about why the automation stitch failed to work.
Some examples are provided below:
Example 1.
Automation is active:
FortiGate # diag test app autod 2
csf: disabled root:no
version:0 sync time:
total stitches activated: 1
stitch: backup
destinations: all
trigger: backup
local hit: 0 relayed to: 0 relayed from: 0
actions:
backup type:cli-script interval:0
delay:0 required:yes
script:execute backup config ftp /Backup/backup.cfg 192.168.1.253 testuser testpassword
Example 2:
It is possible to check the statistics for this process:
FortiGate # diag test app autod 4
action plugin stats:
email:
flags:1
stats: total:0 cur:0 done:0 drop:0
ios-notification:
flags:1
stats: total:172 cur:0 done:172 drop:0
alert:
flags:0
stats: total:0 cur:0 done:0 drop:0
For further examples and diagnostics commands refer to: Diagnosing automation stitches.
Related Articles:
Technical Tip: Programming a daily restart (reboot)
Technical Tip: Use FortiGate automation stitches for alert emails