...
- when count of failed messages for last 10 minutes exceeds 5 then send sends email to administrators
- when count of messages which wait for response from external system for more then 5 minutes exceeds 10 then send sends email to administrators
Alerts checking is scheduled operation that is determined by ohf.alerts.repeatTime configuration parameter - checking is executed every 5 minutes by default.
...
Properties alerts configuration
There the following property files:
- alertsCore.cfg (in core module)
- alerts.cfg (in web-admin module)
- alerts0.cfg (in specific project module)
Tip |
---|
Configurations in next files override same configurations in previous files. |
Alerts configuration uses the same model as rest of OpenHub framework, see External configuration model
Property file configuration format and example (from application.properties):
Code Block |
---|
############################################################################### # Alerts core configuration file. # # There the following property names: # - alerts.N.id: unique alert identification (if not defined then order number (=N) is used instead) # - alerts.N.limit: limit that must be exceeded to activate alert # - alerts.N.sql: SQL query that returns count of items for comparison with limit value # - [alerts.N.enabled]: if specified alert is enabled or disabled; enabled is by default # - [alerts.N.mail.subject]: notification (email, sms) subject; can be used Java Formatter placeholders (%s = alert ID) # - [alerts.N.mail.body]: notification (email, sms) body; can be used Java Formatter placeholders (%d = actual count, %d = limit) # ############################################################################### # checks if there is any waiting message that exceeds time limit for timeout alerts.900.id=WAITING_MSG_ALERT alerts.900.limit=0 alerts.900.sql=SELECT COUNT(*) FROM message WHERE state = 'WAITING_FOR_RES' AND last_update_timestamp < (current_timestamp - interval '3600 seconds') |
...