How do I get network alerts in a Slack channel?


Question

I'd like to receive PingPlotter/MultiPing alerts via Slack so that I can keep my whole team notified of any network issues. Is there a way to do this?

Solution

With the REST call alert event in PingPlotter and MultiPing - you can integrate alerts with a variety of different tools - Slack included! Below is a step-by-step guide that should help you get things up and running.

Note: The following information currently applies to versions 4.12.0 and older of PingPlotter.

Setting up a REST call alert with Slack

The first thing you need to do to integrate PingPlotter with Slack is to generate an access token that will give PingPlotter and/or MultiPing the permission it needs to "talk" to Slack. You generate this key by going to your "team settings" (found in the dropdown menu in the upper left hand corner of any room) in Slack:

Once you're on the main settings screen, fold open the sidebar (on the left hand side of the page), scroll down, and near the bottom of the page, and you'll see an "API" option:

The API page has a few different options, the one we're looking for is the "Web API" (which is under the "Need more functionality?" section):

Once you're on the Web API page, there will be an "Authentication" option if you scroll down - which will allow you to generate a token. Go ahead and generate one, and then it should be displayed for you:

Viola! Now you've got a "key" that will allow PingPlotter to communicate with Slack. Copy this tolken and keep in handy, as we'll be using it very soon.

Now, we need to set up an alert in PingPlotter - but before doing so, it'd be helpful to know the parameters that you can use to send your alerts to one of your group's channel. Slack has done a great job of documenting these parameters - and you can find their documentation here.

We're keeping our alert fairly simple - anytime 10 out of 10 samples experiences high latency, we want PingPlotter to post a notification in our "#pingmantools" room. To do this, we'll be using some of the commands from the "Chat.postMessage" section of the API Methods documentation we discussed a minute ago.

Now, we'll create a new alert (and if you need a refresher on setting up alerts in PingPlotter or MultiPing - we've got a knowledge base article that can help out here), and put in our conditions. Then well set the "Event Type" to "Web REST call).

We want to make sure that we enter the proper REST address (which is in the Slack API methods documentation mentioned above), and then set the REST method to "POST."

Now - we just need to enter that authentication token that we generated a bit earlier in the "body" section of the alert (you did remember to save that - right?). We also need to enter the channel that we want to post the alert to (thus the "channel=" in the body), and what we want the text of the alert to say ("text="). We're using the "username" method to post our message (so it comes through our Slack channel as something other than just "Bot").

Next, click the "test" button... and...

Success! Now we can start associating this alert with a few targets, and keep the whole team notified of any network issues that may be lurking.

If you should find yourself with any questions, or needing any assistance in getting REST call alerts set up - don't hesitate to contact our support team at support@pingman.com.



Article ID: 109
Created On: May 1, 2015
Last Updated On: August 14, 2020

Online URL: https://www.pingman.com/kb/article/how-do-i-get-network-alerts-in-a-slack-channel-109.html