Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Uwe_Sommerfeld
New Contributor

Variables in CLI Scripts

Hi all are there any usable parameters / variables in CLI scripts? Like $HOSTNAME is there a list available?
4 REPLIES 4
csecmx
New Contributor

I´ve tried %%host%% and %%hostname%% with no luck; I´m trying to save a timestamp-and-hostname log file script; in the meantime I´ll use %%date%% %%time%% to add the timestamp and manually add the hostname (and maybe current fortiOS version of the device at the time of the backup).

 

Regards!

Sam_FTNT
Staff
Staff

Hi @csecmx For CLI Script variable of the Hostname use %%devname%%.

 

 

NSE8#3306
Byron1
New Contributor

Hi @Sam_FTNT We have some news about what's in thread?, since apparently the command "%%devname%%" fails to compile correctly. 

JPIZZLE
New Contributor II

Hello, all.  I want to use system variables in my scripts, but none of the ones like %%date%%, %%hostname%%, or %%dev.id%% work.  Any word on host to grab variables like dates, hostnames, device serials, etc?

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors