moostech / configuration-control-scripts Goto Github PK
View Code? Open in Web Editor NEWconfiguration version control scripts for SDN and DevOps
License: MIT License
configuration version control scripts for SDN and DevOps
License: MIT License
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]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.