We've set up a matrix job which builds our project for multiple configurations, namely Release and Debug. If one of these sub-jobs fails, the "Extended E-mail Notification" plugin sends out the following mail (${BUILD_LOG_REGEX}):
Build log lines matching "error," "failed," etc:
[...truncated 5 lines...]
Release completed with result FAILURE
[...truncated 1 lines...]
Debug completed with result FAILURE
Email was triggered for: Failure
Sending email for trigger: Failure
How do we get the actual error messages from the sub-jobs into the emails?
To get a portion of the log in the mail, if not all, set the 'Extended E-mail Notification' to send a separate email for each job that failed, and use the $BUILD_LOG in the body of the message:
In the Multi-Configuration Job, the last parameter of the 'Editable
Email Notification' is 'Trigger for matrix projects' - set it to
'Trigger for each configuration'.
In the body of the message (below the '$DEFAULT_CONTENT' ) add the parameter $BUILD_LOG to display the end of the build log
Assuming the log is in plain-text, change 'Content Type' to Plain Text
For the list of built-in Jenkins parameters, go to this page:
http://[your-jenkins-server]/env-vars.html
Cheers
Related
I build a SSIS-Package to import data from an excel-file. As the excel file is required to have a certain scheme, it fails sometimes if the person creating the file does not stick to the scheme. For this case, i want to send a mail to this person, informing about the fail. I tried different methods but the send mail task always sends 5 to 6 mails instead of one.
The basic structure of my package is this:
The mail task is a simple "Send Mail Task" via SMTP Connection Manager and without attachements, only a message.
Previous approaches are:
With the Event Handler: Settings i tried are Event Handler: OnError and Executable: Whole Package level, on the foreach loop container and on the single "Import File" Task, as this is the one that fails.
In the control flow: I conneted the mail task on failure with the loop container and also with the single import file task:
I also played with the "Delay Validation"-setting in the properties, setting it on true for the loop container and also the import file task.
Where is the mistake i make and how can i fix the package to send only one mail instead of 5-6? Thanks in advance!
Update: The Problem kinda solved itself. I changed from a send mail task to a script task to send a mail with a logfile, this worked perfectly. I also changed the mail_from in the send mail task from a mail-container to a single mail, and this also solved the problem. After that, i changed again to the mail-container and it also works how it should. Seems to be a bug. Thanks all.
I've written a script that sends an hourly email to me using:
MailApp.sendEmail("john#doe.com", "Status Update", currentStatus);
My only gripe is that every message I get is treated as a separate thread, despite the subject lines all being the same. I'd prefer if all were threaded so I can see the stream of messages in one place.
Is there any way to have new status messages appended to the same thread?
Will this require using GMailApp functions instead?
EDIT (2016-08-26): I have solved my problem using the following method/workaround:
Include a unique "marker" somewhere in the status message. I use a static UUID that I generated online.
Use GmailApp.search() to find the thread with the status message(s) by looking for the unique marker.
Use GmailApp.reply() to add a new status message to the thread.
This keeps all the status messages together as desired. Perhaps there's a more elegant way to do this but this works...
How can I configure zabbix to send me the content of a logfile in email alert? I have an alert that sends me an email when a new line is added in a logfile and I want to add the last line in the email.
How can I do this?
If you alert based on a trigger like {host:log[/tmp/file.txt].strlen()} <> 0, then you can use {ITEM.VALUE} macro to refer to the item value that triggered the alert. If there are several items in a trigger, use an indexed version of this macro like {ITEM.VALUE2} to refer to the second item in the trigger expression. The default notification message that comes with Zabbix includes these macros, so if you have not changed it, it should work out of the box.
Please see Using macros in messages section in the official documentation for more information.
SSIS package in question runs a series of stored procedures and fills 13 different excel files with results and sends those excel files to 13 different users in attachments. Package run stops with the message in the title of this question, sometime right in the middle of sending or for example today, on the 4th user. The files get created because I can see them in their directories so only the send mail task is failing. When I go back to visual studio and execute each send task manually, send task works fine even though sometime it still gives me the error yet, still sends the right file to the right person but not thru SSIS package run in SQL server... I tried to delay SMTP processes thinking that might be in the way (to 660000 miliseconds) but did not help. Has this happened to anybody?.. Thanks for all your answers in advance.
Here is the full message for a task that sent the e-mail with attachment regardless the error when task was manually executed...
[Send Mail Task] Error: An error occurred with the following error message: "The operation has timed out.".
Progress: The SendMail task is completed. - 100 percent complete
Task Send Mail Task for Inventory Reports 038 failed
Finished, 12:03:03 PM, Elapsed time: 00:00:00.655
I think I figured it out why this was happening. In case somebody / anybody is interested, here is what I think has happened.
I was trying to expand the timeout period thru a script task, playing with Threading.Thread.Sleep value but I neglected to do the same in my SMTP connection properties. When I changed the timeout value in properties for SMTP connection, error messages stopped coming :)
I wish I could post a picture to show you where exactly that property is located but my reputation failed me!.. :( (less than 10 points yet)
I am in the process of completing all of my changes then I will post again with final result hoping that will resolve all of my problems.
Thanks to all who showed interest.
We are in the process of converting a batch job that processes our bounced emails that we send. We are switching from Redemption to EWS (just upgraded to Exchange 2010 from Exchange 2003). As you know bounced emails come in different forms. I have been able to work through all the test case emails i've got except for the ones that come in the form of:
Your message did not reach some or all of the intended recipients.
Subject: Hello
Sent: 4/01/2012 8:16 AM
The following recipient(s) cannot be reached:
hi#foo.com on 4/01/2012 8:19 AM
The e-mail system was unable to deliver the message, but did not report a specific reason. Check the address and try again. If it still fails, contact your system administrator.
smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi#foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>
This is what is displayed in outlook. When i read the email with EWS the Body is empty. I need to look at the information above when i get the email with EWS. The emails have an attachment (which is the original email) though it doesn't look that way in outlook. I've tried to look at almost all the properties that comes back from EWS and have yet been able to find the text above. Redemption allow you to look at this info using ReportText. What we are specifically looking for is the email error delivery code. We do different things based on this code.
Edit: To be clearer the Body Property on my other test cases isn't empty. I'm loading the emails like:
Dim emailPset = New PropertySet(BasePropertySet.FirstClassProperties)
emailPset.RequestedBodyType = BodyType.Text
Dim f = EmailMessage.Bind(email.Service, email.Id, emailPset)
Update1: After some research it looks like i need to be able to read the Recipients table of the message in the PR_NDR_STATUS_CODE & PR_REPORT_TEXT fields. Still searching if there is a way to do this in EWS.
We were able to get enough info the
smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi#foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>
part which is what we needed by telling the object to load the MIME content.
Definitely not the most straight forward API to use but hopefully we don't hit any more hickups.