Skip to main content
Uwe_Sommerfeld
New Member
Jan 14, 2013 4:30 PM UTC
Question

Variables in CLI Scripts

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

    5 replies

    csecmx
    New Member
    Jan 31, 2023 9:39 PM UTC

    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!

    Translate
    Sam_FTNT
    Staff
    Staff
    Mar 30, 2023 3:38 AM UTC

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

     

     

    Translate
    marconet-22
    Explorer II
    Dec 12, 2024 3:05 PM UTC

    Hi

    Where can i find variable list?

    Translate
    Byron1
    New Member
    Apr 17, 2024 1:42 PM UTC

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

    Translate
    JPIZZLE
    Explorer II
    Jul 12, 2024 12:58 PM UTC

    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?

    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