Add configuration for uptime-kuma monitoring
This commit is contained in:
parent
325bd25f07
commit
e70cdd972c
|
@ -25,5 +25,11 @@
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"username": "YOUR_USERNAME",
|
"username": "YOUR_USERNAME",
|
||||||
"password": "YOUR_PASSWORD"
|
"password": "YOUR_PASSWORD"
|
||||||
|
},
|
||||||
|
,
|
||||||
|
"uptime-kuma": {
|
||||||
|
"enabled": false,
|
||||||
|
"url": "",
|
||||||
|
"interval": 60
|
||||||
}
|
}
|
||||||
}
|
}
|
8
index.js
8
index.js
|
@ -432,6 +432,14 @@ xmpp.on("stanza", (stanza) => {
|
||||||
|
|
||||||
|
|
||||||
xmpp.on("online", async (address) => {
|
xmpp.on("online", async (address) => {
|
||||||
|
if (config["uptime-kuma"].enabled) {
|
||||||
|
setInterval(() => {
|
||||||
|
// Send POST request to config["uptime-kuma"].url
|
||||||
|
fetch(config["uptime-kuma"].url, {
|
||||||
|
method: 'POST'
|
||||||
|
})
|
||||||
|
}, config["uptime-kuma"].interval * 1000) // Every X seconds
|
||||||
|
}
|
||||||
|
|
||||||
errCount = 0;
|
errCount = 0;
|
||||||
// Start listening on all channels, (dont ban me funny man)
|
// Start listening on all channels, (dont ban me funny man)
|
||||||
|
|
Loading…
Reference in a new issue