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

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. 

Translate
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

 

Translate
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024