cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
964
Views
1
Helpful
6
Replies

C9300 - Kron - cannot execute in non-interactive context

Maurizio Caloro
Level 1
Level 1

Hello together
try ios upgrade with kron on c9300, but this will be failed with following syntax:
   --->>"% Interactive command cannot execute in non-interactive context"

so please what are for this the best way? i try also to enable guestshell, but from this explained
error dont found any solution. thanks for possible update.
-->

conf t
!
kron policy-list iosupgrade
cli install add file flash:cat9k_iosxe.17.06.05.SPA.bin activate commit prompt-level none
!
kron occurrence iosupgrade at 13:01 oneshot
policy-list iosupgrade
!
abc-testing0xxxx#sh kron schedule
Kron Occurrence Schedule
iosupgrade inactive, will run once in 0 days 00:00:02 at 13:01 on

abc-testing0xxxx#
*Jul 4 13:01:00.001: Major 1, Minor 0
*Jul 4 13:01:00.001: Timer Event iosupgrade
*Jul 4 13:01:00.002: Call parse_cmd 'install add file flash:cat9k_iosxe.17.06.05.SPA.bin activate commit prompt-level none'
*Jul 4 13:01:00.052: Kron CLI return 0
'
**CLI 'install add file flash:cat9k_iosxe.17.06.05.SPA.bin activate commit prompt-level none':
% Interactive command cannot execute in non-interactive context'

--
debug kron all
*Jul 4 13:01:00.052: Major 4, Minor 7
*Jul 4 13:01:00.052: Respond to end of CLI Process
*Jul 4 13:01:00.052: Forcing Removing Occur iosupgrade
*Jul 4 13:01:00.052: Removing Occur iosupgrade
*Jul 4 13:01:00.052: Removing Policy Name 'iosupgrade'
abc-testing0xxxx#
*Jul 4 13:01:00.052: Finished Removing Occurrence iosupgrade
abc-testing0xxxx#

abc-testing0xxxx#sh kron schedule
Kron Occurrence Schedule

1 Accepted Solution

Accepted Solutions

ok direction Script, you mean Python? thanks for any possible link....

View solution in original post

6 Replies 6

not all command allow and work with Kron
try use EEM instead 

Hi @Maurizio Caloro 

 I understand this output "% Interactive command cannot execute in non-interactive context'" as saying that the cron script tried to run the command but at some point it was requested to take a decision (interactive) but the script is "non-interactive"

 The solution I see would be run a script using some language like Expect in association with cron in order to interact with the prompt as necessary.

Another alternative, less likelly to work, but does not hurt to try, would be run the command on the switch, identify which is the interaction required and then schedule another kron policy-list  with the required response.

For example, if the interaction required is a "Yes" some where, run a kron policy-list  only with the command "Yes".  But, as I said, never tested and I dont know if will work.

Hello @Flavio Miranda 

Thanks for your quick answer, the syntax "install add file flash:cat9k_iosxe.17.06.05.SPA.bin activate commit prompt-level none"

with the syntax "prompt-level none" no answer will be need and auto-reboot without any input are needed!

 

 

 

Then probably the implamentation of cron consider "cli install add file " as interactive, even though you suppress the necesssity for interactiveness with "prompt-level none"

 

dont waste your time use EEM or script. it better 

ok direction Script, you mean Python? thanks for any possible link....

Review Cisco Networking for a $25 gift card