Commit f3c1bb2e authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- Basic framework for methods

parent 0e8b7136
......@@ -26,6 +26,7 @@ import logging
from datetime import datetime
import os, os.path
import re
import MySQLdb
# Global Variables
verbose = False
......@@ -86,14 +87,27 @@ def main(argv):
# Determine if we should be running now
# Get a MySQL database handle
# Get the list of servers to access
serverlist = get_servers()
# Loop through the list
# Get the key for each server
# Build configs (based on what criteria? always? Only when changed?)
# SCP configs over (if there are configs)
# Get results from server
# Process results, update database, store results
# end loop
if (len(serverlist) > 0):
for server in serverlist:
# Get the key for each server
key = get_serverkey(server)
# Build configs (based on what criteria? always? Only when changed?)
configlist = build_config(server)
# SCP configs over (if there are configs)
push_config(server, key)
# Get results from server
get_results(server, key)
# Process results, update database, store results
logger.info('Sleeping until next loop iteration')
......@@ -122,6 +136,21 @@ def loadconfig():
logger.debug('configdir = {0}'.format(cfg['configdir']))
logger.debug('datadir = {0}'.format(cfg['datadir']))
def get_servers():
logger.info('Loading server list')
def get_serverkey(server):
logger.info('Retrieving server key')
def build_config(server):
logger.info('Building server configuration')
def push_config(server, key):
logger.info('Pushing server configuration')
def get_results(server, key):
logger.info('Retrieving results from server')
###
# Usage
###
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment