AlertListener

AlertListener can be registered on NodeStatusDataStore either programmatically using addAlerter()/removeAlerter() or through sirona configuration (aka sirona.properties).

Configuration

The configuration is based on the key: org.apache.sirona.alerters. The value is a list of alerter name/alias:

org.apache.sirona.alerters = mail,webhook

The class of the alerter is set using {alerterName}.class:

mail.class = com.company.sirona.alerter.MailAlerter

The alerters are then configured individually using @AutoSet feature of sirona:

# just a sample of an optional config
mail.host = xxxxx
mail.password = ...
mail.protocol = smtp

MailAlerter

sirona-alerter-mail provides a javamail alerter.

Here is the configuration supposing your alerter is named mail:

mail.class = org.apache.sirona.alerter.mail.MailAlerter
mail.from = me@provider.com
mail.port = 1234
mail.host = provider.com
mail.to = target@provider.com
mail.user = xxx
mail.password = xxx
mail.timeout = 60000
mail.tls = true
mail.auth = true
mail.protocol = smtp
mail.template = ${marker} throw an alert for:\n${resultsCsv}
mail.subjectTemplate = ${marker} throw an alert at ${date}


# true to use the default javamail session with the previous configuration (Session.getDefaultInstance())
mail.useDefault = false