remove automatic add to status page + add apdex_t for updown.io

This commit is contained in:
Emilien Devos 2024-05-15 13:51:56 +02:00
parent c1d870cb15
commit 1b68e2610f
1 changed files with 1 additions and 30 deletions

View File

@ -62,43 +62,14 @@ jobs:
period: '300', period: '300',
mute_until: 'forever', mute_until: 'forever',
published: 'true', published: 'true',
apdex_t: '1.0',
alias: instanceHostname, alias: instanceHostname,
string_match: 'An alternative front-end to YouTube' } }; string_match: 'An alternative front-end to YouTube' } };
request(optionsAddNewCheck, async function (error, response, body) { request(optionsAddNewCheck, async function (error, response, body) {
if (error) throw new Error(error); if (error) throw new Error(error);
console.log(body);
if (body.token) { if (body.token) {
var optionsGetStatusPages = {
method: 'GET',
url: 'https://updown.io/api/status_pages?api-key=${{ secrets.UPDOWN_API_KEY }}',
json: true
};
request(optionsGetStatusPages, async function (error, response, body) {
if (error) throw new Error(error);
const statusPage = body.filter(element => element.token === "resvf");
let checksOfStatusPage = statusPage[0].checks;
checksOfStatusPage.push(body.token)
var optionsAddCheckToStatusPage = {
method: 'PUT',
url: 'https://updown.io/api/status_pages/resvf?api-key=${{ secrets.UPDOWN_API_KEY }}',
headers: {
'content-type': 'application/json'
},
json: {checks: checksOfStatusPage}
};
request(optionsAddCheckToStatusPage, async function (error, response, body) {
if (error) throw new Error(error);
console.log(body)
});
});
var replyComment = var replyComment =
['Hello! Your instance has been added to our monitoring system: https://updown.io/' + body.token, ['Hello! Your instance has been added to our monitoring system: https://updown.io/' + body.token,
'You need to wait 30 days before we add your instance, this is to evaluate that your instance will keep a good uptime for one month.', 'You need to wait 30 days before we add your instance, this is to evaluate that your instance will keep a good uptime for one month.',