Hot!TCL Scripting

Author
forticentric
New Member
  • Total Posts : 1
  • Scores: 0
  • Reward points: 0
  • Joined: 2021/04/01 08:14:49
  • Status: offline
2021/04/01 08:22:39 (permalink)
0

TCL Scripting

Is there anyone that could share an example of a TCL script that I can run on FortiManager to simply set the source-ip for FortiManager and FortiAnalyzer settings on multiple firewalls.  Rather than do this per device and have to change the source-ip in the script everytime, I'd like to do it to all devices at  once. 
 
The source ip will need to be the local vlan interface IP on each device.  The vlan interface is named the same for every location, so the only variable I should need to pull is the ip for that interface, then use that variable in the set src-ip command.
 
Any help would be appreciated, I'm not much of a TCL or REGEX guy. :(
#1
Toshi Esumi
Expert Member
  • Total Posts : 2560
  • Scores: 251
  • Reward points: 0
  • Joined: 2014/11/06 09:56:42
  • Status: offline
Re: TCL Scripting 2021/04/14 12:59:43 (permalink)
0
I'm relatively new to Fortimanager and keep learning for the best way to apply the config/operation model FMG offers to our operation.
I don't know the syntax of TCL. But one thing I can tell now is if you define a meta field per device and define the value under each device,
you can refer the meta field, say "src_addr", as $(src_addr) in a script, then run it against multiple devices you choose.
#2
gabyrossi
Bronze Member
  • Total Posts : 56
  • Scores: 2
  • Reward points: 0
  • Joined: 2006/12/12 11:18:04
  • Status: offline
Re: TCL Scripting 2021/04/14 13:47:16 (permalink)
0
Hello, I would recommend you to do with the templates that the FMG brings.
 
https://docs.fortinet.com/document/fortimanager/6.0.3/administration-guide/89724/system-templates
 
regards
#3
Toshi Esumi
Expert Member
  • Total Posts : 2560
  • Scores: 251
  • Reward points: 0
  • Joined: 2014/11/06 09:56:42
  • Status: offline
Re: TCL Scripting 2021/04/14 13:58:31 (permalink)
0
Actually, I was just told by TAC not to use meta field in scripts,  instead use them in CLI template when I opened a ticket after encountering an error. I think the same thing can be done with a CLI template.
#4
emnoc
Expert Member
  • Total Posts : 6097
  • Scores: 414
  • Reward points: 0
  • Joined: 2008/03/20 13:30:33
  • Location: AUSTIN TX AREA
  • Status: offline
Re: TCL Scripting 2021/04/14 14:10:49 (permalink)
0
I haven't messed with tcl in age but fortinet support had some simple tclscripts with examples similar to below
 
https://help.fortinet.com/fmgr/50hlp/56/5-6-1/FortiManager_Admin_Guide/1000_Device%20Manager/2400_Scripts/1000_Script%20samples/0400_Tcl%20scripts+.htm
 
You can tickle your self crazy with tcl ( pun intended ) 
 
Ken Felix

PCNSE 
NSE 
StrongSwan  
#5
Jump to:
© 2021 APG vNext Commercial Version 5.5