Skip to main content
ErrantOsi
Explorer II
December 22, 2023
Solved

Fortigate Automation Stitch Backup autoscript stop

  • December 22, 2023
  • 5 replies
  • 5725 views

Hi guys, I am trying to configure the automatic tftp backup on our new 100F Forti. I followed a guide how to do the configuration but according to the syslog the process always gets somehow stopped and deleted by the autoscript. When I execute the command manual the backup works. We have two VDOMs, root for MGMT and 1 for production traffic. The configuration is done in the global level (I also tried with adding config global in the cli script).

Anyone has an idea where the issue can be? I am absolute cluesless :\

 

The Eventlogs I have says:

1. Automation stitch triggered
stitch:backup-stitch is triggered.

2. Autoscript stop automatically
script autod.6 stopped automatically

3. Autoscript delete result
User delete the result of script autod.6 from autod

 

The Config looks like this:

 

Trigger:

config system automation-trigger
edit "TFTP-Daily-Backup"
set description ''
set trigger-type scheduled
set trigger-frequency daily
set trigger-hour 16
set trigger-minute 54
next

Action:

edit "backup-action"
set description ''
set action-type cli-script
set minimum-interval 1
set script "execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10"
set output-size 10
set timeout 0
set execute-security-fabric disable
set accprofile "super_admin"
next

 

Stitch:

config system automation-stitch
edit "backup-stitch"
set description ''
set status enable
set trigger "TFTP-Daily-Backup"
config actions
edit 1
set action "backup-action"
set delay 0
set required enable
next

Best answer by ozkanaltas

Hello @ErrantOsi ,

 

I encountered the same problem in Fortigate with vdom. But I solved my problem by writing "config global". I think the "config global" spelling is important here.

 

this style
--------------------
set script "config global
execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10"

 

not same this
-------------------------
set script "config global execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10"

 

Which style did you try before? The correct one is the first style. If this thing didn't work in your environment. Could you run these commands and share the output with us? 

 

exec auto-script stopall
diag debug reset
diag test app autod 1
diag debug cli 7
diag debug enable

 

exec auto-script start <stitch_name>

5 replies

Markus_M
Staff & Editor
Staff & Editor
December 22, 2023

You could run a status output and see details of the script.

exec auto-script status <name>
exec auto-script result <name>
The script will stop if a condition is met:

output-size 10 (megabyte in memory)

set timeout 0 (unlimited)

 

Best regards,

 

Markus

 

Best regards, Markus
ErrantOsi
ErrantOsiAuthor
Explorer II
December 22, 2023

Hi Markus thanks for your answer. I am not sure what you mean? How is the exec auto-script status or result helping in this case? There is no script I created, its just in the automation action?

ozkanaltas
Valued Contributor III
December 23, 2023

Hello @ErrantOsi ,

 

I encountered the same problem in Fortigate with vdom. But I solved my problem by writing "config global". I think the "config global" spelling is important here.

 

this style
--------------------
set script "config global
execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10"

 

not same this
-------------------------
set script "config global execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10"

 

Which style did you try before? The correct one is the first style. If this thing didn't work in your environment. Could you run these commands and share the output with us? 

 

exec auto-script stopall
diag debug reset
diag test app autod 1
diag debug cli 7
diag debug enable

 

exec auto-script start <stitch_name>

Markus_M
Staff & Editor
Staff & Editor
December 26, 2023

if the auto-script is used at least, one needs to run

exec auto-script result <stitch name>

to get its output.

the config global part is a bit tricky. When you need to run multi-line commands you must add them in the same way, ideally just write the stuff in a notepad and paste to the FortiGate CLI. For example:

... set minimum-interval 1 set script "config global execute backup config tftp FOLDERNAME/%%devname%%-%%date%%.conf 10.10.10.10" set output-size 10 ...

you need to keep the double quotes exactly where they are.

Similar description here:

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Automated-script-execution/ta-p/193685

I honestly don't know the differences between

"config system automation-trigger" and "config system auto-script", but would guess multilines need to be run the same. If you got VDOMs, there is basically no choice. Need to enter the VDOM (global or whatever else), then run the commands.

 

Best regards,

 

Markus

Best regards, Markus
Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT