Skip to main content Skip to complementary content

Alerters

When the value does not verify the check in the checker configuration, an alert is created and sent to the alerters.

Apache Karaf Decanter provides ready to use alerters.

Log

The Decanter Log alerter log a message for each alert.

The decanter-alerting-log feature installs the log alerter:

karaf@root()> feature:install decanter-alerting-log

This alerter does not need any configuration.

Email

The Decanter e-mail alerter sends an e-mail for each alert.

The decanter-alerting-email feature installs the e-mail alerter:
karaf@root()> feature:install decanter-alerting-email
This feature also installs the etc/org.apache.karaf.decanter.alerting.email.cfg configuration file where you can specify the SMTP server and e-mail addresses to use:
#
               # Decanter e-mail alerter configuration
               #
               
               # From e-mail address
               from=
               
               # To e-mail address
               to=
               
               # Hostname of the SMTP server
               host=smtp.gmail.com
               
               # Port of the SMTP server
               port=587
               
               # enable SMTP auth
               auth=true
               
               # enable starttls and ssl
               starttls=true
               ssl=false
               
               # Optionally, username for the SMTP server
               #username=
               
               # Optionally, password for the SMTP server
               #password=
  • the from property specifies the from e-mail address (for instance dev@karaf.apache.org)
  • the to property specifies the to e-mail address (for instance dev@karaf.apache.org)
  • the host property specifies the SMTP server hostname or IP address
  • the port property specifies the SMTP server port number
  • the auth property (true or false) specifies if the SMTP server requires authentication (true) or not (false)
  • the starttls property (true or false) specifies if the SMTP server requires STARTTLS (true) or not (false)
  • the ssl property (true or false) specifies if the SMTP server requires SSL (true) or not (false)
  • the username property is optional and specifies the username to connect to the SMTP server
  • the password property is optional and specifies the password to connect to the SMTP server

Camel

The Decanter Camel alerter sends each alert to a Camel endpoint.

It allows you to create a route which reacts to each alert. It is a very flexible alerter as you can apply transformation, use EIPs, Camel endpoints, and so on.

This alerter creates a Camel exchange. The body of the in message contains a Map with all alert details (including alertLevel, alertAttribute, alertPattern and all other details).

The decanter-alerting-camel feature installs the Camel alerter:
karaf@root()> feature:install decanter-alerting-camel

This feature also installs the etc/org.apache.karaf.decanter.alerting.camel.cfg configuration file:

#
            # Decanter Camel alerter
            #
            
            # alert.destination.uri defines the Camel endpoint URI where
            # Decanter send the alerts
            alert.destination.uri=direct-vm:decanter-alert

This configuration file allows you to specify the Camel endpoint URI where to send the alert (using the alert.destination.uri property).

For instance, in this configuration, if you define:
alert.destination.uri=direct-vm:decanter-alert
You can create the following Camel route which will react to the alert:
<?xml version="1.0" encoding="UTF-8"?>
               <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
               
               <camelContext xmlns="http://camel.apache.org/schema/blueprint">
               <route id="decanter-alert">
               <from uri="direct-vm:decanter-alert"/>
               ...
               ANYTHING
               ...
               </route>
               </camelContext>
               
               </blueprint>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!