Inheritance diagram for MPulserCheck:
Check presence of heater pulses in data and send an alert mail if pulser is missing. Bad Pulser condition is assumed if last pulser occurred earlier than the time specified by mean of config parameter CheckPeriod. Bad Pulser condition is removed as soon as pulser events appear again inside data. A mail is sent to the recipient list specified by mean of config parameter Recipients after the first pulser fault is detected. If config parameter ResendMail is set to false, no more alerts are sent, even if pulser failure is still present. If ResendMail is set to true a mail is sent periodically (based on cfg parameter ResendPeriod), only if at least one new pulser failure occurred during the last period. In order for this module to be effective, the environment variable APOLLO_PULSER must be set.
module PulserCheck verbosity = info enable = true CheckPeriod = 500 Recipients = user@domain.com,localuser ResendMail = false ResendPeriod = 12 endmod
Public Member Functions | |
MPulserCheck (QSequence *s) | |
constructor: only initialize data members | |
~MPulserCheck () | |
destructor: do nothing | |
void | Init () |
init data members that depend on config file parameters and check for APOLLO_PULSER environmnent variable | |
QEvent * | Do (QEvent *ev) |
compare time of current event with time of last detected heater pulse, and call NotifyFailure() method if time gap is too big. Do nothing if APOLLO_PULSER is not set | |
void | Done () |
Done method. | |
Private Member Functions | |
void | ParseRecipients (const std::string &recipients) |
parse recipients list supplied in cfg file and fill list of recipients. | |
std::string | CheckRecipient (std::string &recipient) const |
convert CurrentUser to user name | |
void | NotifyFailure (time_t evTime) |
send alert mail | |
Private Attributes | |
time_t | fLastPulserTime |
time_t | fLastMailTime |
bool | fSkipThisModule |
time_t | fCheckPeriod |
max time allowed without a pulser event | |
std::list< std::string > | fRecipients |
list of alert mail recipients | |
bool | fResendMail |
true if alert mail must be re-sent after first one i failure is still present | |
time_t | fResendPeriod |
time in seconds after which another alert mail is sent |
void MPulserCheck::ParseRecipients | ( | const std::string & | recipients | ) | [private] |
parse recipients list supplied in cfg file and fill list of recipients.
recipients | comma separated list of recipients |
void MPulserCheck::NotifyFailure | ( | time_t | evTime | ) | [private] |
send alert mail
evTime | unix time of last pulser failure detection |
time_t MPulserCheck::fLastPulserTime [private] |
unix time of last pulser event
time_t MPulserCheck::fLastMailTime [private] |
unix time of last sent mail
bool MPulserCheck::fSkipThisModule [private] |
execution of this module will be skipped if environment variable APOLLO_PULSER is not set, since in that case it is normal to find no heater pulses