Learn how to leverage Amazon CloudWatch alarms to create an incident in ServiceNow

Delightful Magenta Porcupine
來關注...
關注/停止關注:Delightful Magenta Porcupine
關注有什麼好處?:當作者有新文章發佈時,「思書」就會自動通知您,讓您更容易與作者互動。
現在就加入《思書》,你就可以關注本作者了!
《思書》是一個每個人的寫作與論壇平台,特有的隱私管理,讓你寫作不再受限,討論更深入真實,而且免費。 趕快來試試!
還未加入《思書》? 現在就登錄! 已經加入《思書》── 登入
1.84k   0  
·
2020/01/06
·
3分鐘


Introduction

Customers want to leverage Amazon CloudWatch and ServiceNow together to receive notification of important events and to quickly orchestrate a remediation.

Amazon CloudWatch is a monitoring and management service that enables you to monitor your applications, understand and respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health.

ServiceNow routes incidents to the right people in your organization who need to take action when something meaningful happens in your AWS environment.

This post demonstrates how to integrate Amazon SNS topics to send messages to ServiceNow, open an incident when a CloudWatch alarm is triggered, and test your configuration with a sample CloudWatch alarm.

To get in-Depth knowledge on ServiceNow you can enroll for live ServiceNow Online Training

Configure ServiceNow

We will use a free ServiceNow developer instance to do our work. If you already have one, feel free to use your own. 

  • Log in to https://developers.service-now.com, and request a developer instance https://developer.servicenow.com/app.do#!/instance. 
  • Log in to the developer instance as administrator, and make sure to remember your login credentials (these will be used later when configuring SNS topic subscription URLs).
  • Navigate to System Applications -> Studio, and choose [Import From Source Control].
  • Enter the following URL https://github.com/byukich/x_snc_aws_sns and leave both User name and Password fields empty.

  • Close the Studio browser tab. You won’t be needing it any more.
  • Refresh your ServiceNow browser tab, and navigate to “SNS”. Notice that there are three new navigation links on the left pane (AWS SNS in the below image refers to the app name and not to Amazon SNS)

Create an SNS topic and subscription

  • Log in to the Amazon SNS console, in N Virginia, https://console.aws.amazon.com/sns/v2/home 
  • Choose Topics on the left pane. 
  • Choose Create new topic, give it a name and display name “ServiceNow.”
  • Choose Create Topic.Choose the Amazon Resource Name (ARN) link for the topic you just created. 
  • Choose Create Subscription.Choose HTTPS protocol.
  • For Endpoint use the admin password that was given to you when you acquired the free ServiceNow developer instance
  • Choose Create subscription.
  • Note that your new subscription

Confirm SNS subscription on ServiceNow

Before SNS is allowed to send messages to ServiceNow, you must confirm the subscription on ServiceNow. At this point, AWS has already sent a handshake request, and it’s awaiting confirmation inside your ServiceNow instance.

  •  On your ServiceNow browser tab, navigate to SNS -> Subscriptions, and notice that a new record has been created by AWS.

  • Stay on this page, because you will need to create a handler next.

Now let’s do something meaningful whenever SNS sends an alarm. In this case, we want to open an incident when CloudWatch notifies you of a budget threshold being crossed. ServiceNow provides a script “Handler” that is invoked when SNS sends an alarm message. To configure a handler to create an incident, follow instructions below:

  • At the bottom of the Subscription form, find the Handlers section.
  • Choose New and type a name for the handler, such as “Create SNS Spending Alarm Incident.”
  • Paste the following code at line 3 (just inside the function):

var incident = new GlideRecord("incident"); incident.initialize(); incident.short_description = "SNS Alarm: "+message.AlarmName; incident.description = "AWS Account ID: " + message.AWSAccountId + "\nRegion: " + message.Region + "\nDescription: " + message.NewStateReason; incident.insert();

  • Choose Submit to save the handler.

To get in-Depth knowledge on AWS you can enroll for live AWS Training

Test using CloudWatch

To test this integration, we’ll create a CloudWatch alarm, then it will be tripped to trigger an SNS message, which will create an incident in ServiceNow.

  • Navigate to the CloudWatch console. Your alarm should be in the same Region as your SNS topic, N Virginia.
  • Choose Create an Alarm and, under Browse metrics, select Billing

  • Select USD and choose Next:

  • Complete your setup by filling the details as shown:

  • To test your Alarm, go to the same modification page shown earlier, and change your threshold to something lower than your current spend. That will trigger your alarmFor example before trigger:Alarms->Select Alarm->Modify
  • After refreshing the page, your alarm should be triggered.
  • Navigate to ServiceNow and check whether an Incident was created.

  • If you see an incident, then you have successfully integrated SNS and ServiceNow.

 


喜歡作者的文章嗎?馬上按「關注」,當作者發佈新文章時,思書™就會 email 通知您。

思書是公開的寫作平台,創新的多筆名寫作方式,能用不同的筆名探索不同的寫作內容,無限寫作創意,如果您喜歡寫作分享,一定要來試試! 《 加入思書》

思書™是自由寫作平台,本文為作者之個人意見。


文章資訊

分類於:
標籤:
日期:
創作於:2020/01/06,最後更新於:2020/01/23。
合計:693字


分享這篇文章:



參與討論!
現在就加入《思書》,馬上參與討論!
《思書》是一個每個人的寫作與論壇平台,特有的隱私管理,用筆名來區隔你討論內容,讓你的討論更深入,而且免費。 趕快來試試!
還未加入《思書》? 現在就登錄! 已經加入《思書》── 登入


×
登入
申請帳號

需要幫助
關於思書

暗黑模式?
字體大小
成人內容未過濾
更改語言版本?