cancel
Showing results for 
Search instead for 
Did you mean: 

How to create UPM profile in TCL script

How to create UPM profile in TCL script

NKev
New Contributor II

Hello, 

I would like to create an upm profile with a TCL script in XIQ-SE. Unfortunately the script stops at this point due to an error with the syntax.

Which syntax do I have to use for the content of the upm script?

 

Example:

create upm profile nlAutDhcp

if (!$match($EVENT.LOG_EVENT,ClientAuthenticated)) then
create log message "Authenticated port: $(EVENT.LOG_PARAM_3), VLAN: $(EVENT.LOG_PARAM_4)"
enable ip-security dhcp-snooping vlan $EVENT.LOG_PARAM_4 ports $EVENT.LOG_PARAM_3 violation-action drop-packet block-port permanently snmp-trap
endif

.

Thank you & best regards
Kevin

1 ACCEPTED SOLUTION

Hi,
 
Just create Python script as said  @OscarK . The last line is just to save config to device (XIQ-SE automatically responds "Yes" when you run this particular command) - you can skip this line if you wish:
emc_cli.send('create upm profile nlAutDhcp', False)
emc_cli.send('enable cli scripting', False)
emc_cli.send('if (!$match($EVENT.LOG_EVENT,ClientAuthenticated)) then', False)
emc_cli.send('create log message "Authenticated port: $(EVENT.LOG_PARAM_3), VLAN: $(EVENT.LOG_PARAM_4)"', False)
emc_cli.send('enable ip-security dhcp-snooping vlan $EVENT.LOG_PARAM_4 ports $EVENT.LOG_PARAM_3 violation-action drop-packet', False)
emc_cli.send('block-port permanently snmp-trap', False)
emc_cli.send('endif', False)
emc_cli.send('.')
emc_cli.send('save') 

 

View solution in original post

3 REPLIES 3

OscarK
Extreme Employee

If you use a python script in XIQSE instead of TCL, you should be able to use emc_cli.send("create upm profile nlAuthDhcp",False) which means dont wait for a prompt.

Enter all upm lines and let the last set the wait to true again.

 

NKev
New Contributor II

Thanks for your help. Any ideas how to do that in a TCL script?

Hi,
 
Just create Python script as said  @OscarK . The last line is just to save config to device (XIQ-SE automatically responds "Yes" when you run this particular command) - you can skip this line if you wish:
emc_cli.send('create upm profile nlAutDhcp', False)
emc_cli.send('enable cli scripting', False)
emc_cli.send('if (!$match($EVENT.LOG_EVENT,ClientAuthenticated)) then', False)
emc_cli.send('create log message "Authenticated port: $(EVENT.LOG_PARAM_3), VLAN: $(EVENT.LOG_PARAM_4)"', False)
emc_cli.send('enable ip-security dhcp-snooping vlan $EVENT.LOG_PARAM_4 ports $EVENT.LOG_PARAM_3 violation-action drop-packet', False)
emc_cli.send('block-port permanently snmp-trap', False)
emc_cli.send('endif', False)
emc_cli.send('.')
emc_cli.send('save') 

 

GTM-P2G8KFN