Add configuration for uptime-kuma monitoring

This commit is contained in:
Christopher Cookman 2024-05-12 02:03:28 -06:00
parent 325bd25f07
commit e70cdd972c
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 21 additions and 7 deletions

View file

@ -25,5 +25,11 @@
"enabled": false,
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
},
,
"uptime-kuma": {
"enabled": false,
"url": "",
"interval": 60
}
}

View file

@ -432,6 +432,14 @@ xmpp.on("stanza", (stanza) => {
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;
// Start listening on all channels, (dont ban me funny man)