Exemple #1
0
'''
pymon Workflow

For any given workflow instance, in pymon, we will want it to be a
Singleton. The state of the system will be stored in base.State
which in turn is used in base.Workflow. The last thing we want is
multiple instances of workflow with different state information.
'''
from base import Workflow, WorkflowAware


# Instantiate and setup workflow states
appWf = Workflow()
appWf.addState(
    'Normal', 
    description='pymon is in normal operation with no alerts')
appWf.setInitState('Normal')

# Setup workflow transitions


# define a workflow-aware for mangaging state
class AppState(WorkflowAware):
    '''
    '''
    def __init__(self, workflow=None):
        self.enterWorkflow(workflow, None, "Just Created")


# this is what should get imported by the pymon application:
appState = AppState(workflow=appWf)
Exemple #2
0
'''
pymon Workflow

For any given workflow instance, in pymon, we will want it to be a
Singleton. The state of the system will be stored in base.State
which in turn is used in base.Workflow. The last thing we want is
multiple instances of workflow with different state information.
'''
from base import Workflow, WorkflowAware

# Instantiate and setup workflow states
appWf = Workflow()
appWf.addState('Normal',
               description='pymon is in normal operation with no alerts')
appWf.setInitState('Normal')

# Setup workflow transitions


# define a workflow-aware for mangaging state
class AppState(WorkflowAware):
    '''
    '''
    def __init__(self, workflow=None):
        self.enterWorkflow(workflow, None, "Just Created")


# this is what should get imported by the pymon application:
appState = AppState(workflow=appWf)
Exemple #3
0
'''
pymon Workflow

For each service that is being monitored, it's own workflow
should exist, one that shares no session data with any other service,
as each service is completely independent.
'''
from pymon.config import cfg

from base import Workflow, WorkflowAware

states = cfg.state_definitions
# Create a workflow for managing states
stateWorkflow = Workflow()

for state, stateName in cfg.stateLookup.items():
    description = 'pymon is in %s state' % stateName.upper()
    stateWorkflow.addState(state, description=description, fullName=stateName)

# Set up workflow transitions
transitionNames = {
    states.ok: 'Recovering',
    states.recovering: 'Recovering',
    states.warn: 'Warning',
    states.error: 'Erring',
    states.failed: 'Failing',
    states.acknowledged: 'Acknowledging',
    states.maintenance: 'Maintenance',
    states.disabled: 'Disabling',
    states.escalated: 'Escalating',
    states.unknown: 'Unknown',
Exemple #4
0
'''
pymon Workflow

For each service that is being monitored, it's own workflow
should exist, one that shares no session data with any other service,
as each service is completely independent.
'''
from pymon.config import cfg

from base import Workflow, WorkflowAware


states = cfg.state_definitions
# Create a workflow for managing states
stateWorkflow = Workflow()


for state, stateName in cfg.stateLookup.items():
    description = 'pymon is in %s state' % stateName.upper()
    stateWorkflow.addState(state, description=description, fullName=stateName)


# Set up workflow transitions
transitionNames = {
    states.ok: 'Recovering',
    states.recovering: 'Recovering',
    states.warn: 'Warning',
    states.error: 'Erring',
    states.failed: 'Failing',
    states.acknowledged: 'Acknowledging',
    states.maintenance: 'Maintenance',