There are certain situations in our project where we need real
time notifications in the form of email, SMS or by a phone call in the case when some
important Jenkins job got failed.
In this case, we can use Jenkins plugin PagerDuty and can integrate PagerDuty with Jenkins which will help us in achieving our goal.
What is PagerDuty?
PagerDuty
is an incident management platform that provides reliable incident
notifications via email, push, SMS, and phone, as well as automatic
escalations, on-call scheduling, and other functionality to help teams detect
and fix infrastructure problems quickly.
Below
are the steps we need to follow to integrate PagerDuty with Jenkins:
Step
1: From the Jenkins Home Page, Manage
Jenkinsร Manage Pluginร Install Page Duty alert.
Step
2: Generate API integration key for pager duty alert.
Click
on this link and register your account on pager duty.
On the home page of pager
duty click on configurationร Services
Click
on add Services option present at the bottom of the page.
Inside
integration settings select option as “Use Our API policy directly” and fill other
details as per your requirement and click on add service.
After
following up the above steps integration key would be generated exclusively for your account.
Please
Note down this integration key for further usage.
Step
3: Now Again go Back to Jenkins, Click on Create New Job.
Step
4: In Post Build Section of Job, Select PagerDuty Incident Trigger.
Step
5: Please provide the Value as per the below screenshot.
Please
Note here you need to put your service integration key that was obtained in Step 2. Also, you can specify in which cases you want the incident to be triggered.
Step 6: Execute your Jenkins job now.
Now
once our Jenkins job will fail or aborted as per instruction configured in Step no 5. Incident will be a trigger as per option selected
by us in Jenkins Job we will receive notifications in the form of email, Phone
call or by SMS.
Please
Note by default all the incident notifications would be sent out to email id specified while creating your profile in the case you want to opt for notification via Phone and SMS you need to explicitly
specify that information in the notification section of your profile.
Thanks for the sharing. Best wishes Ankur !
ReplyGood call tracking software can pinpoint which keyword led to the call,there and as mentioned above track the caller's path through a website.
ReplyHi Ankur, Thanks for information. I have question, can we trigger job with SMS? Please confirm.
ReplyNo
ReplyHi Ankur,able to integrate with mail but unable to update number in SMS as getting "International phone alerts are not enabled for this account." message for same
Replyonce we install pager duty plugin in jenkins do we need to configure in configure system details ?
Reply