11-01-2023 07:38 AM
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
Solved! Go to Solution.
11-08-2023 02:06 AM
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')
11-02-2023 05:36 AM
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.
11-02-2023 06:52 AM
Thanks for your help. Any ideas how to do that in a TCL script?
11-08-2023 02:06 AM
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')