Example #1
0
def cleanUp( configParameters, currentTime, daysOfPicklesToKeep ):
    """
    
        @summary: Based on current time and frequencies contained
                  within the time parameters, we will run 
                  the cleaners that need to be run.       
                            
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
                                  
    """     
    
    paths = StatsPaths()
    paths.setPaths()
    
    updateManager = AutomaticUpdatesManager(configParameters.nbAutoUpdatesLogsToKeep, "picklecleaner")
    
    if updateManager.updateIsRequired(currentTime) :
        
        output = commands.getoutput( paths.STATSTOOLS + "pickleCleaner.py %s" %int(daysOfPicklesToKeep) )
        print paths.STATSTOOLS + "pickleCleaner.py" + " " + str( daysOfPicklesToKeep )
        updateManager.addAutomaticUpdateToLogs( currentTime )
        
    updateManager = AutomaticUpdatesManager(configParameters.nbAutoUpdatesLogsToKeep, "generalCleaner")    
    
    if updateManager.updateIsRequired(currentTime) :
        commands.getstatusoutput( paths.STATSTOOLS + "clean_dir.plx" + " " + paths.STATSETC + "clean_dir.conf"   )
        print paths.STATSTOOLS + "clean_dir.plx" + " " + paths.STATSETC + "clean_dir.conf" 
        updateManager.addAutomaticUpdateToLogs( currentTime )
Example #2
0
def cleanUp(configParameters, currentTime, daysOfPicklesToKeep):
    """
    
        @summary: Based on current time and frequencies contained
                  within the time parameters, we will run 
                  the cleaners that need to be run.       
                            
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
                                  
    """

    paths = StatsPaths()
    paths.setPaths()

    updateManager = AutomaticUpdatesManager(
        configParameters.nbAutoUpdatesLogsToKeep, "picklecleaner")

    if updateManager.updateIsRequired(currentTime):

        output = commands.getoutput(paths.STATSTOOLS + "pickleCleaner.py %s" %
                                    int(daysOfPicklesToKeep))
        print paths.STATSTOOLS + "pickleCleaner.py" + " " + str(
            daysOfPicklesToKeep)
        updateManager.addAutomaticUpdateToLogs(currentTime)

    updateManager = AutomaticUpdatesManager(
        configParameters.nbAutoUpdatesLogsToKeep, "generalCleaner")

    if updateManager.updateIsRequired(currentTime):
        commands.getstatusoutput(paths.STATSTOOLS + "clean_dir.plx" + " " +
                                 paths.STATSETC + "clean_dir.conf")
        print paths.STATSTOOLS + "clean_dir.plx" + " " + paths.STATSETC + "clean_dir.conf"
        updateManager.addAutomaticUpdateToLogs(currentTime)
Example #3
0
def backupRRDDatabases(configParameters, currentTime, nbBackupsToKeep):
    """
    
        @summary: Based on current time and frequencies contained
                  within the time parameters, we will backup the databases
                  only if necessary.       
                            
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
                                  
    """

    paths = StatsPaths()
    paths.setPaths()

    updateManager = AutomaticUpdatesManager(
        configParameters.nbAutoUpdatesLogsToKeep, "dbBackups")

    if updateManager.updateIsRequired(currentTime):
        commands.getstatusoutput(paths.STATSTOOLS + "backupRRDDatabases.py" +
                                 " " + str(int(nbBackupsToKeep)))
        print paths.STATSTOOLS + "backupRRDDatabases.py" + " " + str(
            nbBackupsToKeep)
        updateManager.addAutomaticUpdateToLogs(currentTime)
Example #4
0
def backupRRDDatabases( configParameters, currentTime, nbBackupsToKeep ):
    """
    
        @summary: Based on current time and frequencies contained
                  within the time parameters, we will backup the databases
                  only if necessary.       
                            
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
                                  
    """  
    
    paths = StatsPaths()
    paths.setPaths()    
    
    updateManager = AutomaticUpdatesManager(configParameters.nbAutoUpdatesLogsToKeep, "dbBackups" )
    
    if updateManager.updateIsRequired( currentTime )  :
        commands.getstatusoutput( paths.STATSTOOLS + "backupRRDDatabases.py" + " " + str( int(nbBackupsToKeep)) )             
        print paths.STATSTOOLS + "backupRRDDatabases.py" + " " + str(nbBackupsToKeep)
        updateManager.addAutomaticUpdateToLogs( currentTime )
Example #5
0
def monitorActivities( configParameters, currentTime ):
    """
        @summary: Monitors all the activities that occured during 
        the course of this program. Report is sent out by mail
        to recipients specified in the config file.
        
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
        
    """    
    
    paths = StatsPaths()
    paths.setPaths()
    
    updateManager = AutomaticUpdatesManager( configParameters.nbAutoUpdatesLogsToKeep, "monitoring")
    
    if updateManager.updateIsRequired(currentTime)  :  
         output = commands.getoutput( paths.STATSBIN + "statsMonitor.py '%s'" %( currentTime ) )
         print paths.STATSBIN + "statsMonitor.py"
         print output
         updateManager.addAutomaticUpdateToLogs( currentTime )
Example #6
0
def monitorActivities(configParameters, currentTime):
    """
        @summary: Monitors all the activities that occured during 
        the course of this program. Report is sent out by mail
        to recipients specified in the config file.
        
        @param configParameters: StatsConfigParameters instance.
                               
        @param currenTime: currentTime in seconds since epoch format.
        
    """

    paths = StatsPaths()
    paths.setPaths()

    updateManager = AutomaticUpdatesManager(
        configParameters.nbAutoUpdatesLogsToKeep, "monitoring")

    if updateManager.updateIsRequired(currentTime):
        output = commands.getoutput(paths.STATSBIN + "statsMonitor.py '%s'" %
                                    (currentTime))
        print paths.STATSBIN + "statsMonitor.py"
        print output
        updateManager.addAutomaticUpdateToLogs(currentTime)