Add heartbeat functionality to Uptime Kuma monitoring

This commit is contained in:
Christopher Cookman 2024-05-12 02:05:26 -06:00
parent e70cdd972c
commit 6fada9d3fc
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -433,10 +433,17 @@ xmpp.on("stanza", (stanza) => {
xmpp.on("online", async (address) => {
if (config["uptime-kuma"].enabled) {
fetch(config["uptime-kuma"].url, {
method: 'POST'
}).then(() => {
console.log(`${colors.cyan("[INFO]")} Sent heartbeat to Uptime Kuma`)
})
setInterval(() => {
// Send POST request to config["uptime-kuma"].url
fetch(config["uptime-kuma"].url, {
method: 'POST'
}).then(() => {
console.log(`${colors.cyan("[INFO]")} Sent heartbeat to Uptime Kuma`)
})
}, config["uptime-kuma"].interval * 1000) // Every X seconds
}