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.
yes but it turns out, you need to do:
connect.enable()
before writing any config, like you would in a terminal
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.
yes but it turns out, you need to do:
connect.enable()
before writing any config, like you would in a terminal
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
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().
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.