程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

how to transfer data to mikrotik router using netmiko?

发布于2025-01-05 09:13     阅读(833)     评论(0)     点赞(24)     收藏(5)


I would be appreciated if you could help me to transfer some data to my mikrotik router via netmiko in python.

I already wrote this code but its not working.

Mikrotik = {
        'device_type': 'mikrotik_routeros',
        'host':'host',
       'username': '****',
        'password': '***',
        'port': '22',
        }

from netmiko import ConnectHandler

ssh_conn = ConnectHandler(**Mikrotik)

source_file = "C:/Users/text.txt"
dest_file = "test1.txt"
direction = "put"
file_system = "flash:"

transfer_dict = file_transfer(
    ssh_conn,
    source_file=source_file,
    dest_file=dest_file,
    file_system=file_system,
    direction=direction,
    overwrite_file=True,
)

what am I doing wrong? or is there another way to do this


解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/2046780/5f887c644054f35c70c6/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

24 0
收藏该文
已收藏

评论内容:(最多支持255个字符)