This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
module.exports = function (context, done) { | |
var recBody = context.body; | |
var rContext = recBody.context; | |
var rCondition = rContext.condition; | |
var icon = recBody.status === 'Activated' ? ':open_mouth:': ':party_parrot:'; | |
var outText = `${rContext.resourceName} - ${rContext.name} - ${recBody.status} <${rContext.portalLink}|Click Here> | |
Condition: ${rCondition.metricName} ${rCondition.operator} ${rCondition.threshold} (${rCondition.metricUnit}) in the last ${rCondition.windowSize} minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Sockets; | |
private bool CheckForServer(string address, int port) | |
{ | |
int timeout = 500; | |
var result = false; | |
try | |
{ | |
using(var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) | |
{ |