Introduction
This page details the conceptual blocks of code in pymon.
Components
- Configuration
- Monitors
- Clients
- Rules
- Actions
Configuration
Application and monitor level configuration data.
- configuration data is passed to the monitor factory
State/History
- pymon.interfaces.IState
- IState(monitorInstance).save()
from pymon.application import MonitorState
class IState(Interface):
''
class State(object):
implements(IState)
components.registerAdapter(MonitorState, monitors.MyMonitor, IState)
state = IState(myMonitor)Monitors
In Twisted terminology, Monitors are actually "Factories."
They do the following:
- provide a method for executing the check against the monitored resource
- provide a method for extracting the data from the results
- provide a callable that is used by pymon that creates a deferred with callbacks to the other two methods
Clients
In Twisted terminology, pymon Clients are actually "Protocols."
- process rules for returned status of monitored resource
- update state and history for monitored resource
- fire off appropriate actions (messages, pages, etc.)
Rules
The code that checks the returned result against expected results.
- checking thresholds/intervals
- turning monitoring on or off for maintenance windows
Actions
- messaging (emails, pages)
- escallation