01-07-2021 12:20 AM - edited 01-07-2021 01:55 AM
Hello, I can not send a global configuration command to a switch, I get the typical "% Invalid input detected at '^' marker." With netmiko i can not tell exactly where the misinput is. I want to add a user to a bunch of devices. so the command I use is the username xxx privilege x secret x xxxxxxx
Solved! Go to Solution.
01-07-2021 01:48 AM
yes but it turns out, you need to do:
connect.enable()
before writing any config, like you would in a terminal
01-07-2021 01:44 AM
Hi there,
Are you using the correct function (send_config_set):
...
commands = ['username {0} privilege {1} secret {2}'] ... result = ssh.send_config_set(commands)
...
...that said, you also have a typo in the word 'privilege'
cheers,
Seb.
01-07-2021 01:48 AM
yes but it turns out, you need to do:
connect.enable()
before writing any config, like you would in a terminal
01-07-2021 03:34 AM
01-07-2021 05:33 AM - edited 01-07-2021 05:34 AM
you need to send confrmation - show us your example or follow the below document how you can send confirmation.
https://pynet.twb-tech.com/blog/automation/netmiko-what-is-done.html
example :
https://github.com/ktbyers/netmiko/blob/develop/examples/send_command_prompting_expect.py
01-07-2021 05:45 AM
config_command = ['no username ****']
connect.send_config_set(config_command)
thats it, i get that i should use expect_string, but its not possible with send_config_set().
01-07-2021 07:19 AM
this should be enable and config mode.
01-07-2021 07:55 AM
OSError: Search pattern never detected in send_command: remove
I get an error from the send_command(), it doesnt pick up on the 'remove', despite
"This operation will remove all username related configurations with same name.Do you want to continue?"
remove being in the prompt.
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