For those of us unfamiliar with Powershell, as an alternative to Sending Emails from Log Manager for Orion using PowerShell the attached files can be used to send email notifications with HTML formatting.
SendEmailNotificationConfiguration.exe accepts 4 command line arguments.
- -from
- -recipients
- -subject
- -body
Each argument value should be enclosed within " "
-from
This is the email address the email will appear to come from. typically this will be someone@yourdomain.com
-recipients
Accepts a ; separated list of email recipients
-subject
The subject of the email notification.
-body
The content of a HTML formatted email body. This will include the 3 variables sent by log manager.
- ${DateTime}
- ${IpAddress}
- ${Message}
An example of the command line arguments.
-from "tony@emea.sales"
-recipients "usera@domain.local;userb@domain.local"
-subject "Log Manager Email Notification"
-body "SYSLOG MESSAGE NOTIFICATION <hr /> RECEIVED AT: ${DateTime} <br /> SOURCE IP: ${IpAddress} <br /> MESSAGE: ${Message}"
This will generate the following email:
How to Use
1 - Install or Copy Files
1. Run Setup.exe or copy the 4 files below to your preferred directory
- SendEmailNotification.exe
- SendEmailNotification.exe.config
- SendEmailNotificationConfiguration.exe
- SendEmailNotificationConfiguration.exe.config
The only difference is that by running setup.exe a shortcut to SendEmailNotificationConfiguration.exe will be added to your start menu.
2- Configure SMTP Details
To configure your smtp server details launch SendEmailNotificationConfiguration.exe
Enter your required details and Send a Test Email
Once confirmed. click Save Email Settings
These settings are saved to SendEmailNotification.exe.config and are encrypted using the default .Net machine level encryption.
3. Configure a Log Manager Rule
1. From the "Log Viewer" dashboard click on "Configure Rules"
2. Within SYSLOG, My Custom Rules, Click "CREATE NEW RULE"
3. Define the conditions for the rule to meet your requirements. for example:
4. Add an Action - to RUN AN EXTERNAL PROGRAM
5. Enter the path to SendEmailNotification.exe and the command line arguments required.