- pycharm is cool with imports but it doesnt work on other systems, think about the database option
- Display config page just like .json file
- Display error if no main.json found
- Proper logging
- Logging to WEB UI
- Global Variables like scoring, and data. Better way?
- Display timer
- Indicate end of scoring
- Update scoreboard, scoreboard still there when db is gone
- Once running gray out option, enable a terminate button
- Use a database to store the boolean buttons enabled/disabled or pass it?
- Importing is crazy!
- Pass the scoring_engine var through the routes?
A python 3 program used to test various service uptimes for a given network infrastructure.
- Create an Ubuntu 16.04LTS outside of the firewall. An example would be the
172.31.XX.0/29
subnet on the figure below. - Ensure the Ubuntu 16.04LTS has internet access.
- Setup the SSE on a Ubuntu 16.04LTS system.
- Git clone this repository:
git clone https://github.com/SilexOne/sse.git
- Run the install script:
./sse_setup.sh
- Configure the JSON file to your network:
- Edit
scoring_engine/main.json
, see Usage for more details
- Edit
- Run the program:
python3 main.py
- View the website:
- Browse to the machine that is hosting the SSE
http://#.#.#.#
- Browse to the machine that is hosting the SSE
-
Once installed you will need to make and configure a
scoring_engine/main.json
file. A template is already provided asmain.json.example#
, you may make a copy ofmain.json.example1
asmain.json
. -
View the mode's overall settings and configure if needed:
logging
: This sets the logging level for SSE and how verbose the output is. It follows Python logging standard.timeframe
: This sets how long SSE will score forservices
: This will hold all the service settings thatscoring_engine/services
will use.
{ "name": "testing", "logging": "DEBUG", "timeframe": { "hours": "0", "minutes": "1" }, "services": { ... }
For example, logging is set at DEBUG and the test will only run for one minute. The
name
is just the title of the config itself. You can create other config files just likemain.json.example#
-
View and configure
services
:enabled
: Determines if the SSE will score that service- Other Settings: Specific configuration settings to test that
services
will use
{ "name": "testing", "logging": "DEBUG", "timeframe": { "hours": "0", "minutes": "1" }, "services": { "dns": { "enabled": "1", "servers": { "main": "8.8.8.8", "secondary": "8.8.4.4" }, "hostnames": { "wcsc.usf.edu": "131.247.1.113", "webcse.csee.usf.edu": "131.247.3.5" } }, "ad": { "enabled": "0" }, }
For example,
dns
is enabled and the service configuration to be tested is configured asservers
andhostnames
. You may take a look atservices/score_dns.py
and how it uses the configuration settings.ad
is disabled and will not be tested.
If you want to test another service that isn't in SSE by default you can easily add one yourself.
-
Within
scoring_engine/main.json
add a service inservices
with the appropriate settings in both modes.{ "name": "production", "logging": "INFO", "timeframe": { ... }, "services": { "dns": { ... }, ----> "YOUR_SERVICE_NAME": { ----> "enabled": "1", ----> "SETTINGS_USED_IN_THE_PYTHON_FILE": "something" }, ... } }
-
Create a python file based off
scoring_engine/services/template.py
and store it in thescoring_engine/services
folder.- Follow the template guidelines
- Import the necessary libraries,
from utils.settings import data, collect
- Ensure the decorator is on your function,
@collect(data.get('services').get('YOUR_SERVICE_NAME_YOU_CREATED_IN_THE_JSON_FILE').get('enabled'))
- Use the settings from the json to test your service, This will be passed in as a parameter
def A_NAME_THAT_PERTAINS_TO_YOUR_SERVICE_TEST(config):
, then can be used as soservice_settings = config.get('services').get('YOUR_SERVICE_NAME_YOU_CREATED_IN_THE_JSON_FILE')
- Return either a 1 or 0 which represent PASS/FAIL
- Look at existing scoring functions in
scoring_engine/services
to get real examples
-
Run the program and the service should be added.
-
Fork the project from github.
-
Git clone the repository.
$ git clone git@github.com:<YOUR_USERNAME_FOR_GITHUB>/sse.git
-
Set the upstream repository.
# Sets your git project upstream to this repository $ git remote add upstream https://github.com/SilexOne/sse.git
-
Ensure your fork's master mirrors the upstream repository. That means you should not make any changes to your master, all you need to create branches off it. You will also need to update your master when new changes occur in the overall project.
# Updates your master branch to be the same as the upstream repository # Run this specific command everytime the upstream repository changes $ git pull upstream master # Show which branch you are on $ git branch * master # Create a new branch and use it $ git checkout -b new-branch-your-creating # Verify you are using that new branch $ git branch master * new-branch-your-creating # Make changes and add to the project # Add and commit the new changes $ git add . $ git commit - m "your commit message" # Push your branch to your github $ git push origin new-branch-your-creating # Go to github and do a pull request # Then wait for it to be merged in or denied
-
How to merge your branch if you run into a merge conflict.
# Updates your master branch to be the same as the upstream repository $ git pull upstream master # Your branch will rebase off the new master branch $ git rebase master new-branch-your-creating
-
If your branch was merged in and you want to keep contributing.
# Updates your master branch to be the same as the upstream repository $ git pull upstream master # Switch back to master $ git checkout master # Verify you are on master $ git branch * master new-branch-your-creating # Branch off master $ git checkout -b another-branch-you-created # Verify you are on that branch $ git branch master new-branch-your-creating * another-branch-you-created # Pretty much repeat step 3 with the changes and git add, and step 4 if applicable