Skip to main content
BoddenBF
Visitor III
October 3, 2024
Question

Fortimanager CLI Template error

  • October 3, 2024
  • 1 reply
  • 1872 views

Hello there,

 

I created a CLI template to generate CSRs on Fgt units as follows:

 

execute vpn certificate local generate rsa $(y) 4096 10.$(y).0.1 DO STI STI TEST SEG b@domain.com IP:10.$(y).0.1,DNS:s$(y).x.org,DNS:s$(y).x.org x/app/cert/scep/ password

 

Where $(y) is a meta variable for branch ids, but the result is error: "-999 - invalid value - syntax error". If i input the same script substituting the meta variable with the branch id directly on the units console it works just fine.

 

Appreciate any help,

BoddenBF.

 

 

1 reply

johnathan
Staff
Staff
October 3, 2024

You should be able to validate the CLI Template and preview what it pushes to the device by following this guide: https://docs.fortinet.com/document/fortimanager/7.2.0/new-features/260251/improved-cli-templates-with-validation-and-preview-functions
If the validation succeeds, please check the preview and post the output here. 

Never trust a computer you can't throw out a window.
BoddenBF
BoddenBFAuthor
Visitor III
October 3, 2024

Thanks for replying. The validation is successful, all variable mappings are set. The preview shows the same script i input manually on the units:

 

execute vpn certificate local generate rsa Y 4096 10.Y.0.1 DO STI STI TEST SEG b@domain.com IP:10.Y.0.1,DNS:sY.dyndns.org,DNS:s3Y.dyndns.org x/app/cert/scep/ pass