From 13757c46ee7d8317a93760dd602eccf18f00accd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 May 2015 14:11:07 -0500 Subject: [PATCH 1/5] Initial commit --- hooks/alertops/README.md | 4 ++++ hooks/alertops/index.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 hooks/alertops/README.md create mode 100644 hooks/alertops/index.js diff --git a/hooks/alertops/README.md b/hooks/alertops/README.md new file mode 100644 index 0000000..713f2e1 --- /dev/null +++ b/hooks/alertops/README.md @@ -0,0 +1,4 @@ +AlertOps + +Sends a error event to AlertOps. +Follow http://help.alertops.com/default.aspx/MyWiki/Errorception.html for setup detail. \ No newline at end of file diff --git a/hooks/alertops/index.js b/hooks/alertops/index.js new file mode 100644 index 0000000..bc316cc --- /dev/null +++ b/hooks/alertops/index.js @@ -0,0 +1,30 @@ +var request = require("request"), + path = require("path"); + +exports.serviceName = "AlertOps"; + +exports.author = { + name: "Xinlin Ruan", + email: "xinlinr@alertops.com", + github: "AlertOps", + twitter: "AlertOps" +}; + +exports.onError = function(error, settings, done) { + request({ + url: "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/" + + settings.apiKey + "/Errorception/" + settings.sourceName + + "/subject/id/none/none/webUrl/shortText/LongText", + method: "post", + body: JSON.stringify({ + subject: "(Errorception) " + error.message, + id: path.basename(error.webUrl), + webUrl: error.webUrl, + shortText: "Error: " + error.message + " at time: " + error.date, + LongText: "An Error " + error.message + (error.isFirstOccurrence ? "occurred" : "recurred") + " in " + + (error.isInline?("an inline script on " + error.page):error.scriptPath) + + " See " + error.webUrl + " for details" + }), + timeout: 10000 + }, done); +} \ No newline at end of file From d60661571d0f106e894820ed47244ed22e70fb78 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 May 2015 14:41:38 -0500 Subject: [PATCH 2/5] Revert "Initial commit" This reverts commit 13757c46ee7d8317a93760dd602eccf18f00accd. --- hooks/alertops/README.md | 4 ---- hooks/alertops/index.js | 30 ------------------------------ 2 files changed, 34 deletions(-) delete mode 100644 hooks/alertops/README.md delete mode 100644 hooks/alertops/index.js diff --git a/hooks/alertops/README.md b/hooks/alertops/README.md deleted file mode 100644 index 713f2e1..0000000 --- a/hooks/alertops/README.md +++ /dev/null @@ -1,4 +0,0 @@ -AlertOps - -Sends a error event to AlertOps. -Follow http://help.alertops.com/default.aspx/MyWiki/Errorception.html for setup detail. \ No newline at end of file diff --git a/hooks/alertops/index.js b/hooks/alertops/index.js deleted file mode 100644 index bc316cc..0000000 --- a/hooks/alertops/index.js +++ /dev/null @@ -1,30 +0,0 @@ -var request = require("request"), - path = require("path"); - -exports.serviceName = "AlertOps"; - -exports.author = { - name: "Xinlin Ruan", - email: "xinlinr@alertops.com", - github: "AlertOps", - twitter: "AlertOps" -}; - -exports.onError = function(error, settings, done) { - request({ - url: "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/" - + settings.apiKey + "/Errorception/" + settings.sourceName - + "/subject/id/none/none/webUrl/shortText/LongText", - method: "post", - body: JSON.stringify({ - subject: "(Errorception) " + error.message, - id: path.basename(error.webUrl), - webUrl: error.webUrl, - shortText: "Error: " + error.message + " at time: " + error.date, - LongText: "An Error " + error.message + (error.isFirstOccurrence ? "occurred" : "recurred") + " in " - + (error.isInline?("an inline script on " + error.page):error.scriptPath) - + " See " + error.webUrl + " for details" - }), - timeout: 10000 - }, done); -} \ No newline at end of file From a44be981e66745e0784cf30a62b380e4af8df7f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 May 2015 15:10:39 -0500 Subject: [PATCH 3/5] Revert "Initial commit" This reverts commit 13757c46ee7d8317a93760dd602eccf18f00accd. --- hooks/alertops/README.md | 4 ++++ hooks/alertops/index.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 hooks/alertops/README.md create mode 100644 hooks/alertops/index.js diff --git a/hooks/alertops/README.md b/hooks/alertops/README.md new file mode 100644 index 0000000..713f2e1 --- /dev/null +++ b/hooks/alertops/README.md @@ -0,0 +1,4 @@ +AlertOps + +Sends a error event to AlertOps. +Follow http://help.alertops.com/default.aspx/MyWiki/Errorception.html for setup detail. \ No newline at end of file diff --git a/hooks/alertops/index.js b/hooks/alertops/index.js new file mode 100644 index 0000000..67ac528 --- /dev/null +++ b/hooks/alertops/index.js @@ -0,0 +1,29 @@ +var request = require("request"), + path = require("path"); + +exports.serviceName = "AlertOps"; + +exports.author = { + name: "Xinlin Ruan", + email: "xinlinr@alertops.com", + github: "AlertOps", + twitter: "AlertOps" +}; + +exports.onError = function(error, settings, done) { + request({ + url: "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/" + settings.apiKey "/Errorception/" settings.sourceName + "/subject/id/none/none/webUrl/shortText/LongText", + method: "post", + body: JSON.stringify({ + subject: "(Errorception) " error.message, + id: path.basename(error.webUrl), + webUrl: error.webUrl, + shortText: "Error: " error.message " at time: " error.date, + LongText: "An Error " error.message (error.isFirstOccurrence ? "occurred" : "recurred") " in " + (error.isInline?("an inline script on " error.page):error.scriptPath) + " See " error.webUrl " for details" + }), + timeout: 10000 + }, done); \ No newline at end of file From 71233fbe7f46111e475d1980f3f4bda5bf8eb3a9 Mon Sep 17 00:00:00 2001 From: alertops Date: Wed, 6 May 2015 09:54:12 -0500 Subject: [PATCH 4/5] Update index.js update shortText and LongText format --- hooks/alertops/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hooks/alertops/index.js b/hooks/alertops/index.js index 67ac528..9712a1c 100644 --- a/hooks/alertops/index.js +++ b/hooks/alertops/index.js @@ -13,17 +13,19 @@ exports.author = { exports.onError = function(error, settings, done) { request({ url: "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/" - settings.apiKey "/Errorception/" settings.sourceName - "/subject/id/none/none/webUrl/shortText/LongText", + + settings.apiKey + "/Errorception/" + settings.sourceName + + "/subject/id/none/none/webUrl/shortText/LongText", method: "post", body: JSON.stringify({ - subject: "(Errorception) " error.message, + subject: "(Errorception) " + error.message, id: path.basename(error.webUrl), webUrl: error.webUrl, - shortText: "Error: " error.message " at time: " error.date, - LongText: "An Error " error.message (error.isFirstOccurrence ? "occurred" : "recurred") " in " - (error.isInline?("an inline script on " error.page):error.scriptPath) - " See " error.webUrl " for details" + shortText: "Error: " + error.message, + LongText: "An Error " + error.message + (error.isFirstOccurrence ? " occurred" : " recurred") + + " at time: " + error.date + + " in " + (error.isInline?("an inline script on " + error.page):error.scriptPath) + + " See " + error.webUrl + " for details" }), timeout: 10000 - }, done); \ No newline at end of file + }, done); +} From d02ae67034af231b61751ee3bf650f9ef7ac3fe7 Mon Sep 17 00:00:00 2001 From: alertops Date: Tue, 19 Apr 2016 10:33:35 -0500 Subject: [PATCH 5/5] Update index.js updated url to the latest --- hooks/alertops/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/alertops/index.js b/hooks/alertops/index.js index 9712a1c..3e5915d 100644 --- a/hooks/alertops/index.js +++ b/hooks/alertops/index.js @@ -14,7 +14,7 @@ exports.onError = function(error, settings, done) { request({ url: "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/" + settings.apiKey + "/Errorception/" + settings.sourceName - + "/subject/id/none/none/webUrl/shortText/LongText", + + "/subject/id/none/none/webUrl/shortText/LongText/none", method: "post", body: JSON.stringify({ subject: "(Errorception) " + error.message,