Applies to:
Denodo 8.0
,
Denodo 7.0
,
Denodo 6.0
Last modified on: 12 Aug 2021
Tags:
Administration
Denodo Monitor
JMX
Monitoring
Scheduler jobs
This document explains how to send notifications by mail regarding events occurring 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.
To register alerts regarding Memory/CPU usage information or any other information available in the MBeans exposed through JMX by the Denodo Platform.
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.
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:
com.denodo.util.launcher.Launcher com.denodo.vdb.vdbinterface.server.VDBManagerImpl...
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:
To do that, go to the MBeans tab and search for the appropriate bean and the attribute to be measured. In this case, the bean is “VDBServerManagementInfo” and the attribute “ActiveRequests”.
Once located, right click on “ActiveRequests” to indicate to JMC how it needs to manage the retrieved value. In this case, the value will be interpreted as a number, in units of 1.
To get an e-mail alert of an event logged in the Denodo Virtual DataPort logs.
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/log4j2.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.
<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>
<Logger name="com.denodo.vdp" level="FATAL">
<AppenderRef ref="EMAILALERT" />
</Logger>
To report the output of the Denodo Monitor.
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.
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:
<DENODO_HOME>\tools\monitor\denodo-monitor\conf\ConfigurationParameters.properties
Either for step 2 and/or step 3 the properties are the same (uncomment to use the default values):
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.
To send an email alert about the failure of a particular Job in Denodo Scheduler.
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 email 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 “Administration” > “Server Settings” > “Mail Settings”.
Once the mail server is set you have to follow this steps:
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.