Giter Club home page Giter Club logo

backupswitchesconfig's Introduction

backupSwitchesConfig

批量备份不同交换机配置

  1. 读取交换机信息,我用的是调用数据库的方式,一共包括四个信息,IP/交换机型号/交换机厂家/机房名称
  2. 根据不同型号创建不同的函数,就是def的内容,共创建了华为、华三、锐捷(思科用锐捷的)三种,主要是不同型号的命令不一样,所以不能通用
  3. 探测所有交换机IP可达性,如果不通说明网络不可达,不进行备份,主要是我们数据库里好多已下架交换机信息研发没有删掉
  4. 迭代所有可达的交换机IP,根据厂家匹配对应的备份函数
  5. linux下设置crontab定时任务,每天执行一次
  6. 效果是在指定的目录下,按照日期创建一个目录,每台设备的备份文件存在当天的目录下

#所需环境: linux主机,python 3.5.2,python库:pymysql(调用mysql数据库用)/pexpect(登录交换机用)/datatime/time/sys/os

backupswitchesconfig's People

Contributors

yanhao1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.