Re: Send mail to mailbox when there's an infrastructure fail

21 views
Skip to first unread message
Message has been deleted

Aaron Digulla

unread,
Apr 10, 2019, 7:36:03 AM4/10/19
to Jenkins Users
Hi Sarfroz,

To make sure I understand you correctly:

- Your Git server was down
- Jenkins did start a job
- The job tried to check out the code from Git
- That step failed
- You didn't receive a mail for this specific failure (usually, it works)
- You're using Scripted Pipeline, not Declarative Pipeline

Correct?

The problem here is that the mail recipients come from the Jenkinsfile. When Git isn't running, Jenkins can't get the Jenkinsfile and therefore has no chance to figure out where to send mails.

Try to set up monitoring of the Git server outside of Jenkins.

Alternatively, use a freestyle Job triggered by cron which periodically checks that it can connect to the Git server (just execute a git ls or something again a small repo). You can then send a mail from this job when it fails.

Regards,

Aaron Digulla

Sarfroz Basha

unread,
Apr 10, 2019, 8:54:30 AM4/10/19
to Jenkins Users
Hi Aaron,

Thanks for your reply. Its very helpful to me.

Can you please explain steps to create freestyle job triggered by cron in Jenkins. Whenever checks into the Gitserver, if Gitserver was down automatically email notification need to come.


Regards,
Sarfroz Basha
Reply all
Reply to author
Forward
0 new messages