Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then use the info here to create a new MC_SystemAlerter task. For the new task use the tag from the action config and make it a one-off task. The xml file that needs to be uploaded contains the settings for the emails (see mcSystemAlerter.xsd schema). In here it is possible to use the tag %LOG% in the body of the email. This tag will then be replaced by the logmessage(s) that triggered sending the email. The smtp configuration has the tls attribute since 2023.02. This is required for modern SMTP servers that require TLS. Set this attribute to true to support tls.

Basic example

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mc-system-alerter xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/mcSystemAlerter.xsd">
    <alerts>
        <emailalert>
            <recipients>
                <recipient email="Some.body@somewhere.org"/>
				<recipient email="%FEWS_MC_SYSTEM_ALERTER_RECIPIENTS%"/>
             </recipients>
            <configuration>
                 <!-- requires OS System Environment Property FEWS_MCSYSTEMALERTER_PASSWORD to be present. --> 
                <smtp fromaddress="Some.body@somewhere.org" host="smtp.mailhost.nl" user="fewsuser" passwordEnvironmentVariableKey="FEWS_MCSYSTEMALERTER_PASSWORD"/>
            </configuration>
            <subject>
                <subjectline content="The subject line of the email to send"/>
                <substitutions/>
            </subject>
            <body value="%LOG%"/>
            <attachments/>
        </emailalert>
    </alerts>
</mc-system-alerter>

...

Warning

NB. Note that the fromaddress field is an optional field that will fallback to InternetAddress.getLocalAddress() which is according to specification but in rare cases will fail to provide a suitable fromaddress and will cause errors in the master controler log file (where the MCSystemAlerter logs its errors). Including the correct fromaddress will resolve this matter. Also when the Master Controller DNS is not configured properly this may result into slowness in the System Alerter.