how to configure ZenMail in Zenoss Resource Manager 5.x

Applies To

Zenoss Resource Manager 5.x

Summary

The zenmail daemon is not enabled and running on the Zenoss Resource Manager by default. This is to prevent potential port binding conflicts. The default port for the zenmail daemon is TCP port 25. It is likely that this port is already in use on the Zenoss server by a locally running SMTP daemon, such as Sendmail.

The zenmail daemon in Zenoss Resource Manager must be configured and started to perform correctly. This KB provides instructions on how to configure ZenMail in RM 5.x.

Procedures

Edit the Service Configuration so CC Starts zenmail Automatically

Log into the Control Center UI.

Click the Zenoss.resmgr name to display the Applications/Zenoss.resmgr page.

Scroll down the page to the IP Assignments section and click zenmail to display the zenmail page.

On the zenmail page, scroll down to Configuration Files.

Click the Edit button for /opt/zenoss/etc/zenmail.conf to display the Edit Configuration pane for the file. NOTE: Initially, all lines in the configuration file are commented out. Uncomment those values required for your environment.

Edit the configuration file:

Set the listenPort value.

Although the default value is 25, it is likely that Control Center has set this value. If necessary to prevent conflicts, change the port definition. Devices sending SMTP messages must be able to send to the port specified here.

Set the eventseverity value.

The default value is '2'. This means that events coming in via this daemon are set to Info as the severity value. The severity levels include:

1 = Debug
2 = Info
3 = Warn
4 = Error
5 = Critical

Set the listenip value.

Although the default value is '0.0.0.0', it is likely that Control Center has left this value blank and commented out. This indicates binding to all local addresses. This can be changed to bind to a specific address. The listenip can be used in conjunction with the 'listenPort'. For example, if there is a local SMTP daemon running on port 25, but bound to a specific interface, leave the 'listenPort' for the zenmail daemon on port '25' but change the listenip value to bind it to a separate local interface address.

If necessary, change default values for other options required for the environment.

Click Save to save the changes and exit the edit window.

Scroll to the IP Assignments section and verify the IP that Control Center assigned to zenmail. If it is necessary to assign or change the address:

Click the Assign button to display the Assign IP dialog.

NOTE: This dialog displays the current settings for:

Service name

Endpoint

Port

The current but changeable IP value

Enter the new IP value.

Click Assign IP to save the changes and exit the dialog.

Set zenmail to automatically start:

Login to the Resource Manager UI.

Navigate to:

Advanced > Control Center

Scroll down to zenmail

Click the check box for autostart on the zenmail row.

Start the zenmail service from either the Control Center UI or with:

serviced service start zenmail

How Events are Generated with email

If the zenmail daemon is configured and listening, emails sent to anyaddress@yourzenossserver are picked up by the zenmail daemon and an event is created with the following information:

Sender's email address -

Used to guess the associated device name. For example, for systems emailing directly into Zenoss, the sending address is configured as something@hostname.domainname so it matches the devicehostname.domainname.

email subject line -

Becomes the summary field of the event.

Mail body -

Becomes the message field of the event.

Default severity (and other options)-

Configured in the zenmail.conf file.

Scripts to Test the zenmail Daemon Configuration

Two sample test scripts are included for testing the zenmail daemon configuration. One is written in Perl (Perl test script) and the other is written in Python (Python test script). The scripts are attached below. The scripts are well commented for easy understanding. Use these scripts for simple testing of the zenmail daemon to demonstrate the daemon's behavior and verify the zenmail daemon configuration. The scripts can be run locally on the Zenoss server, or remotely from another system if that system has a resolvable path to the Zenoss server. Notes: The system must have Perl and/or Python installed.The Perl version requires Net-SMTP.</p