Run mutliple FortiOS commands in an awk script

I am working on a awk fortigate script where I need to run multiple FortiOS commands. No multi-step, just to get the output from more than one FortiOS commands.


I receive an error message when I run the parser with direct input from a fortigate.

I have an other script with one FortiOS command and it works. Plz, check attached file.


I tried also to use ';' to separate the FortiOS commands but it does not work.

#! REMOTE::SSH

config global ;

diagnose sys ntp status


Any ideas?


OUTPUT-PARSER.txt

Can you try separating the commands with a new line while keeping them all under the same REMOTE::SSH section?

Finally it worked!

I needed to seperate the commands and add ';' without space. Check sample below:

#! REMOTE::SSH
config global;
diagnose sys ntp status

I face a problem when I use the command-runner to collect the input file directly from a fortigate device.

I run the script with the next configuration options to the foritgate device:

  1. With vdom configuration where requires to be executed 2 FortiOS commands by the ind script
  2. Without vdom configuration where a singe FortiOS command is executed by the ind script

The 2nd option always work. The 1st seems like doesnt get correctly the FortiOS command output.

You can find details from the test to the attached .txt file.


I have to mention that the .ind scripts work fine when I use .input files and dont get the input directly from the fortigate.

Note: VDOM=Virtual firewall


Any idea? Could be an issue of the command-runner?


testing_live_config.txt