- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
Network Management
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2021 03:34 AM
You need to ping the owner of netmiko on github. But make sure that you are
using the right device type in your code.
On a side note, if you are using IOS-XE device, you can use REST to
communicate with the device and post configs.
**** please remember to rate useful posts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2021 07:19 AM
this should be enable and config mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
