07-04-2023 06:31 AM
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
Solved! Go to Solution.
07-04-2023 07:41 AM
ok direction Script, you mean Python? thanks for any possible link....
07-04-2023 06:55 AM - edited 07-04-2023 06:57 AM
not all command allow and work with Kron
try use EEM instead
07-04-2023 06:55 AM
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.
07-04-2023 07:01 AM
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!
07-04-2023 07:12 AM
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"
07-04-2023 07:16 AM
dont waste your time use EEM or script. it better
07-04-2023 07:41 AM
ok direction Script, you mean Python? thanks for any possible link....
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide