Git Product home page Git Product logo

configuration-control-scripts's Introduction

CONTENTS OF THIS FILE
---------------------
   
 * Introduction
 * Usage
 * Pre-requistes
 * Script Details
 * Script Options
 * Default Global Variables
 * Questions/Comments



INTRODUCTION
------------
This script:
 * Monitors the configuration running in your SDN controller
 * If there are any changes, then the script will ssh to the SDN controller, and copy/paste to configuration to a text file.
 * The script can push the new configuration to a github account.
 * The script can send a notification email if configuration changes.
� 


USAGE
-----
CLI argument to run the script is:
 * python configuration_control.py <controller username> <controller password> [options]
 * Or ./configuration_control.py <controller username> <controller password> [options]

To view all the script options, type:
 * python configuration_control.py —-help
 * Or python configuration_control.py -h



PRE-REQUISTES
-------------
  1) Install git on the controller using "sudo apt-get install git" command, before using the script
  2) Create a git repository to store the configuration files using the git clone command. For example:
     “�git clone https://github.com/nenni80/configuration-control-scripts.git”
  3) Setup github on your controller
     git config --global user.name "nenni80"
     git config --global user.email [email protected]
  4) Copy the script to the controller. 
  5) Change the script file permission mode to 755, "chmod 755 configuration_control.py"
     Note: if you update controller image, you will need to install github and copy the script again.
  6) Add the script to a cron file, so it can start automatically even if the controller reboots
     edit your crontab by typing "crontab -e and create an entry like this:
     @reboot /home/admin/configuration_control.py admin password123



SCRIPT DETAILS
--------------
 * Monitor the current configuration file using md5sum command. 
 * If configuration files changes, the script ssh to localhost, then the script types "show run" to collect the config
 * The script saves the output of show run in "configuration.txt" file in the github folder
 * If the script is running on standby controller, then the script will exit.
 * The script will parse the controller log file to see who did the last configuration change, and will save the config in userlog.txt file in the github folder
 * If github option is enabled, the script will check the github status, and make sure the local github folder is uptodate, then uploads the file.
 * If send email option is enabled, then the script will send an email



SCRIPT OPTIONS
--------------
 * Mandatory variables: 
      - controller username
      - controller password

 * Optional variables:
      - If GitHub is enabled, then define GITHUBUSER, GITHUBPWD, GITDIR
      - If Email is enabled, then define EMAILTO, EMAILFROM, EMAILPWD
      - Interval: how often to pull the configuration from the controller, default is 1 second
      - LogUser: log who was the last person to login into the controller, and what configuration changes did he make?



DEFAULT GLOBAL VARIABLES
------------------------
 * SERVER = "localhost"               			# Controller IP addresses
 * CONFFILE = "configuration.txt"     			# configuration file to be added to github - to be added to github
 * LOGFILE = "/log/bigswitch/floodlight/floodlight.log" # logfile on the controller
 * USERLOG = "userslog.txt"           			# logfile that contains user - to be added to github



QUESTIONS/COMMENTS
------------------
contact [email protected]

configuration-control-scripts's People

Watchers

James Cloos avatar mostafa mansour 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.