automation stitch to send output of an CLI command
Hello,
FortiGate with FortiOS 7.2.5.
I try to create an automation stitch that sends me output of
diagnose debug config-error-log read
command upon FortiGate start.
As described e.g. here
https://docs.fortinet.com/document/fortigate/7.2.5/administration-guide/639044
I should create two actions, first for CLI command, second for sending mail with %%result%% in message body.
I used this setting:
config system automation-action
edit "get_config_errors"
set action-type cli-script
set script "diagnose debug config-error-log read"
next
edit "send_mail_result"
set action-type email
set email-from "***"
set email-to "***"
set email-subject "command output"
set message "%%result%%"
next
end
# LogID 32009 = FortiGate Start
config system automation-trigger
edit "Start"
set event-type event-log
set logid 32009
next
end
config system automation-stitch
edit "send_config_errors_upon_start"
set trigger "Start"
config actions
edit 1
set action "get_config_errors"
set required enable
set delay 5
next
edit 2
set action "send_mail_result"
set required enable
next
end
next
end
But when I test this automation (using one time schedule) I receive e-mail (two e-mails, there are two FortiGates in HA cluster) with body "%%result%%" verbatim, there is no command output.
Any tip what is wrong?
