1.0 Introduction
The purpose of this article is to describe the procedure for adding an email handler to a Sensu server to send email notifications or alerts when a check is executed or reaches a warning or critical status for a Fortanix Data Security Manager (DSM) instance.
2.0 Terminology References
SMTP - Simple Mail Transfer Protocol
VM - Virtual Machine
3.0 Prerequisites
Before configuring the email handler, ensure the following:
The Sensu server is set up and monitoring the Fortanix DSM targets.
4.0 Configure Email Handler on Sense VM
This section explains how to configure the email handler on the Sensu VM.
Perform the following steps:
Run the following command to navigate to the
Monitoring-Server-Artifactsfolder on the Sensu VM created in “Section 5.1: Setting Up Sensu Server” in the Fortanix DSM with Sensu Monitoring and Alerting guide:cd Monitoring-Server-ArtifactsRun the following command to execute the
add_handlers.shscript to add an email handler:./add_handlers.shWhen prompted, select Y for email handler:
Do you want to create email handler ? (Y/N): Y Creating email handler Specify From email address : Specify To email address : Specify SMTP server address : Does SMTP server allow insecure connection (unauthenticated on port 25)? (Y/N) : Specify SMPT username : Specify SMTP user password : Specify SMTP port (default 587) : Created Attaching email handler to all checksVerify the email handler configuration from Sensu Web user interface (UI):
.png?sv=2022-11-02&spr=https&st=2025-11-02T15%3A37%3A55Z&se=2025-11-02T15%3A49%3A55Z&sr=c&sp=r&sig=3xcaPdvaubEhRzmM7Ltqzhv34eV%2FAF5hFgI2spOfNcg%3D)
Figure 1: Select the Email handler
.png?sv=2022-11-02&spr=https&st=2025-11-02T15%3A37%3A55Z&se=2025-11-02T15%3A49%3A55Z&sr=c&sp=r&sig=3xcaPdvaubEhRzmM7Ltqzhv34eV%2FAF5hFgI2spOfNcg%3D)
Figure 2: Email handler specification
5.0 Configure Keepalive Handler
This section explains how the keepalive handler monitors the status of the sensu-agent service on each node.
5.1 Configure Keepalive Handler on Sense VM
Perform the following steps on the Sensu VM:
Run the following command to navigate to the
Monitoring-Server-Artifactsfolder in Sensu VM created in “Section 5.1: Setting Up Sensu Server” in the Fortanix DSM with Sensu Monitoring and Alerting guide:cd Monitoring-Server-ArtifactsRun the following command to create the
email-keepalive-handler.ymlfile:vi email-keepalive-handler.ymlAdd the following configuration to the
email-keepalive-handler.ymlfile:type: Handler api_version: core/v2 metadata: name: keepalive namespace: default spec handlers: - email type: set filters: - is_incident - not_silencedRun the following command to create the keepalive handler for email handler:
sensuctl create -f email-keepalive-handler.ymlRun the following commands to reload the
systemdmanager configuration:sudo systemctl daemon-reloadRun the following commands to restart the
sensu-agentservice:sudo systemctl restart sensu-agentRun the following command to verify the status of the
sensu-agentservice:sudo systemctl status sensu-agent
5.2 Apply Configuration Changes on Fortanix DSM Node
Perform the following steps on each Fortanix DSM node where the sensu-agent service is configured:
Add the following values in the
/etc/sensu/agent.ymlfile:keepalive-warning-timeout: 60 keepalive-critical-timeout: 90Run the following command to reload the
systemdmanager configuration:sudo systemctl daemon-reloadRun the following command to restart the
sensu-agentservice:sudo systemctl restart sensu-agentRun the following command to verify the status of the
sensu-agentservice:sudo systemctl status sensu-agent