cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

XMC TCL scripting, how to wait xx minutes between CLI commands?

XMC TCL scripting, how to wait xx minutes between CLI commands?

Rahman_Duran
Contributor II
Hi,

As our Palo Alto firewall device has no scheduled update feature, I want to use XMC scripting for this purpose.

# request system software install version
# request restart system

These are the commands. So how can I tell XMC TCL engine to wait 30 minutes between these two commands?

Regards,
Rahman
23 REPLIES 23

But the first command of the script is "CLI request system software install version $version" and it is not run. For testing I deleted the "sleep" line and the result is same:

EMC User: rduran
EMC User Domain: artvin.edu.tr
CLI Login: admin
ACU-PA-3050-1 10.100.2.100 10/05/2018 02:11:20 PM at 02:11:20 PM
Error: session exceeded timeout: 30 secs
Error: session exceeded timeout: 30 secs
Error: session exceeded timeout: 30 secs

Regards,
Rahman

StephanH
Valued Contributor III
Hello Rahman,

never used but there is a special "sleep" command in XMC.
Open your onlinehelp of XMC and search for "How to create scrips" for more details.
On this page look for "sleep"

Have fun.

Best regards
Stephan
Regards Stephan

Hello Stephan,

Yes, I tried and "sleep xxx" works. But my script is not working.

#@MetaDataStart
#############################################################################################
# Define your user parameters in this section. For reference, see bundled scripts.
#############################################################################################

#@VariableFieldLabel "Version"
set var version 8.x.x
#@MetaDataEnd

# Enter all CLI commands from here
CLI request system software install version $version
CLI y
sleep 45
CLI show system info

Here is what I get when I run the script:

EMC User: rduran
EMC User Domain: artvin.edu.tr
CLI Login: admin
ACU-PA-3050-1 10.100.2.100 10/05/2018 01:43:04 PM at 01:43:04 PM
Error: session exceeded timeout: 30 secs
Error: session exceeded timeout: 30 secs
ACU-PA-3050-1 #sleep 45
Error: session exceeded timeout: 30 secs

If I don't use "CLI" keyword I get this error:

javax.script.ScriptException:
*** Script Error ***
nul

So how can I run those to commands against PANOS ssh CLI?

Regards,

Rahman

StephanH
Valued Contributor III
Hello Rahman,
if the "sleep" command isn't working within an TCL script you can use the following TLC build in command:

after
when is the time your program waits in milliseconds.

Best regards
Stephan
Regards Stephan
GTM-P2G8KFN