Skip to main content
BoddenBF
Visitor III
Oct 3, 2024 4:02 PM UTC
Question

Fortimanager CLI Template error

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.

 

 

2 replies

johnathan
Staff
Staff
Oct 3, 2024 4:21 PM UTC

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
Oct 3, 2024 5:00 PM UTC

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

 

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
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