Configuring alerts in Denodo

Applies to: Denodo 8.0 , Denodo 7.0 , Denodo 6.0
Last modified on: 29 Mar 2018
Tags: Administration Denodo Monitor JMX Monitoring Scheduler jobs

Download document

You can translate the document:

Introduction

This document explains how to send notifications by mail regarding events occurred in Denodo Virtual DataPort.

In some situations we need to be alerted if a specific event takes place in Denodo. In order to achieve that, we can use different techniques detailed in this article: log4j appenders, JMX alerts, SNMP traps and Denodo Scheduler Handlers.

JMX notifications

When to use 

To register alerts regarding Memory/CPU usage information or any other information available in the MBeans exposed through JMX by the Denodo Platform.

Description  

Java Mission Control (JMC) is an Oracle tool for managing, monitoring, profiling, and troubleshooting Java applications. We will see how to use this tool in order to monitor the Denodo Platform MBeans and to generate alerts based on their status.

Steps to configure

JMC is included as part of the Java distribution, if a JDK is already installed JMC can be executed (otherwise the Java Development Kit needs to be installed). Once the tool is running, perform the following steps:

  1. Execute jmc.exe located at <JDK_PATH>/bin.
  2. The “JVM Browser” shows the processes running locally. When the VDP Server is running in a remote machine you can connect with a remote JVM using the option “File” > “Connect” > “Create a new connection”.
  3. From the JVM Browser search for the VDP Server process. You can identify the process by the process ID (searching previously for this number) or identifying the element which command line starts as following:

com.denodo.util.launcher.Launcher com.denodo.vdb.vdbinterface.server.VDBManagerImpl...

 

  1. By clicking on the JVM Browser element and double clicking on “MBean Server” JMC will connect to the VDP Server.
  2. On the MBeanServer wizard a Triggers tab is available at the bottom. This will open a wizard where trigger rules can be configured (activated and deactivated) for several events like CPU usage or Deadlocked threads. New trigger rules can also be created based on the exposed MBeans.

As an example we are going to create a new Trigger that sends an email every time that the number of active requests exceeds a limit number. The steps will be the following:

  1. On the Triggers tab click on “Add…” button.

  1. Search for the MBean containing the information and click on “Finish”. In the KB article “Monitoring Denodo servers with JMX” more information about the available MBeans can be found.

  1. A new wizard called “Rule Details” will show up. In that wizard the values for triggering the condition can be setted. In this example the “current value” will be the limit that, when reached, the email will be sent.

  1. Once the condition is configured by clicking on the “Action” tab the “Send e-mail” action can be configured.

  1. In addition, the SMTP server has to be configured in order to be able to send the email. For that go to Window > Preferences > Java Mission Control > JMX Console > Communication and set up the SMTP Server configuration.

Log4j Alerts

When to use

To get an e-mail alert of an event logged in the Denodo Virtual DataPort logs.

Description

Virtual DataPort uses the logging library Apache Log4j to log the activity of the Virtual DataPort server and its Administration Tool. Log4j allows defining the log level (TRACE, DEBUG, INFO, WARN, ERROR or FATAL) for different categories. The configuration of Log4j for the Virtual DataPort server is controlled by the file:

<DENODO_HOME>/conf/vdp/log4j2.xml

For the administration tool by the file:

<DENODO_HOME>/conf/vdp-admin/log4j.xml.

In these files you can find three main components: Appenders, PatternLayouts and Loggers.

A logger defines a log level for a category and they can be assigned to appenders previously configured. For instance:

<RollingFile name="VDBOUT" fileName=".../logs/vdp/vdp-cache.log">

        <PatternLayout pattern="[%t] %d{yyyy-MM-dd'T'HH:mm:ss.SSS}/>

</RollingFile>

<Logger name="com.denodo.vdb" level="error">

      <AppenderRef ref="VDBOUT" />

</Logger>

 

This configuration indicates that the category “com.denodo.vdb” on an error event will write the output of the log to the file configured in the VDBOUT appender following the defined pattern layout.

The SMTPAppender is an appender which sends an e-mail when a specific logging event occurs, typically on errors or fatal errors. Therefore, instead of writing the output to a file it is possible to configure a destination email address.  

Steps to configure

  1. Configure the appender. The appender contains the information related to the SMTP server used for sending the email. Take into account that the configuration is slightly different for log4j2 and log4j:

  1. For log4j2 (VDP Server): <DENODO_HOME>/conf/vdp/log4j2.xml

                <SMTP name="EMAILALERT"  

                        subject="VDP Log Alert"

                        to="toUser@mydomain.com"

                        from="fromUser@mydomain.com"

                            smtpHost="mail.mydomain.com"

                        smtpPort="25"

                             smtpProtocol="smtp"

                        smtpUsername="mysmtpusername"

                             smtpPassword="mysmtppassword"

                        smtpDebug="true"

                        bufferSize="512">

                    </SMTP>

  1. For log4j (Admin Tool): <DENODO_HOME>/conf/vdp-admin/log4j.xml

<appender name="EMAILALERT"  class="org.apache.log4j.net.SMTPAppender">

<param name="SMTPHost" value="mail.mydomain.com" />

<param name="SMTPUsername" value="mysmtpusername" />

<param name="SMTPPassword" value="mysmtppassword" />

<param name="From" value="fromUser@mydomain.com" />

<param name="To" value="toUser@mydomain.com" />

<param name="Subject" value=”VDP Log Alert”/>

</appender>

  1. Configure the loggers. Once the appender is configured, any logger with a log level for a category can be configured indicating the email appender as output:  

        <Logger name="com.denodo.vdp" level="FATAL">

<AppenderRef ref="EMAILALERT" />

</Logger>

SNMP traps

When to use

To report the output of the Denodo Monitor.

Description

The Denodo Monitor Tool can be configured for sending Simple Network Management Protocol Traps (SNMP Traps) with the information received by the Queries Monitor or the Cache Monitor. Then using a SNMP Manager (or listener) you will be able to read the SNMP Trap Messages and configure alerts based on them.

The Denodo Monitor must be configured as an SNMP agent which sends the traps to the configured port. Then we have to run a SNMP manager or listener for reading the information sent by the Denodo Monitor and trigger messages based on events.

Steps to configure

First of all, to configure the Denodo Monitor to send SNMP traps with the output of the Virtual DataPort query monitor and/or to send SNMP traps with the output of the Virtual DataPort cache monitor:

  1. Open the file:

<DENODO_HOME>\tools\monitor\denodo-monitor\conf\ConfigurationParameters.properties

  1. To send SNMP traps with the output of the Virtual DataPort query monitor:
  1. Set "vdpqueries.snmptrapagent.enable" to "true".
  2. Set the values of the other "vdpqueries.snmptrapagent" properties to point to your SNMP listener.
  1. To send SNMP traps with the output of the Virtual DataPort cache monitor:
  1. Set "vdploadcacheprocesses.snmptrapagent.enable"  to "true".
  2. Set the values of the other "vdploadcacheprocesses.snmptrapagent" properties to point to your SNMP listener.

Either for step 2 and/or step 3 the properties are the same (uncomment to use the default values):

  • Version: version of the SNMP protocol.
  • Community: name of the group of computers that will receive SNMP traps.
  • LocalIPAddress: IP address of the agent generating the SNMP trap.
  • Targetaddress: IP address of the computer receiving the SNMP traps
  • Targetport: port where the computer receiving the SNMP traps is listening.
  • ApplicationOID: Application Object Identifier.
  • EnterpriseOID: Enterprise Object Identifier

After enabling the “snmptrapagent” in the monitor configuration, a client (listener) to receive the SNMP Trap Alerts has to be configured.

In the market there are several tools for monitoring SNMP Traps like Nagios or Zenoss with many functionalities using these tools that can trigger alerts based on trap events. In this article a simple SNMP tool was used, however, the idea is basically the same for all of them: listen to the trap messages.

Denodo Scheduler Handlers

When to use

To send an email alert about the failure of a particular Job in Denodo Scheduler.

Description

When configuring Jobs in Scheduler it is possible to configure handlers. A handler is an action that is executed as the last step before completing the execution of a job (if the conditions are met). Denodo Scheduler includes as a built-in handler the “Mail” handler. This handler allows to send an email with the result report on the job execution. It requires a list of destination e-mail addresses to be specified and allows several conditions to be set (determining in which cases the mail has to be sent).

Steps to configure

In order to be able to send the email Scheduler requires a SMTP server to be configured. This configuration has to be set in “Configuration” > “Server Configuration” > “Mail configuration”.

Once the mail server is set you have to follow this steps:

  1. Select the Job (or create a new one).
  2. Click on the Handlers section of the Job configuration.
  3. Select “New Handler” > “mail”.
  4. Add the target mail addresses and the configuration “When to send”.
  5. Save the Job.

Next time the Job is executed, before finishing the execution, Scheduler will check if the “When to send” conditions are met and, if it is the case, it will send the Job report to the configured target emails.

Questions

Ask a question
You must sign in to ask a question. If you do not have an account, you can register here

Featured content

DENODO TRAINING

Ready for more? Great! We offer a comprehensive set of training courses, taught by our technical instructors in small, private groups for getting a full, in-depth guided training in the usage of the Denodo Platform. Check out our training courses.

Training