louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
56.84k stars 5.12k forks source link

[Discord] status pages using auto-edited embeds #3508

Open shadowgamingyt opened 1 year ago

shadowgamingyt commented 1 year ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

New Notification, Other

πŸ”– Feature description

i beleve there should be a way to be able to embed the status page in discord where it can be auto updated and/or have the bot create a message with a list of chosen servers where it can say if its online or offline maintenance etc, i think this would be more useful for users to be able to see then have a channel where they can just see all the data for the servers as in ips, container ids etc.

βœ”οΈ Solution

i would like to be able to choose a option to have a weblink or a discord bot option to show the status of a list of servers without having to use the alert link that sends a message every time its up/ or down. something that auto updates only has to be put in once and people can quickly check it to see which servers are up/down

❓ Alternatives

No response

πŸ“ Additional Context

No response

CommanderStorm commented 1 year ago

What would be the advantage compared to a channel in which the down/up notifications are piped? The current solution also lets users get pinged when something is down.

Side-note: Could you edit the tile to Discord: implement sticky embed alternative

shadowgamingyt commented 1 year ago

The advantage is its smoother neater and cleaner, imagine having a channel thats locked one message thats edited over and over again now yes the pings are nice but i rather keep those private cause of the ips or container ids, yes i can propbably go digging to edit it but i rather see first if there is a way to do a embed option if not get the badges to be embeded so it could look neater also because i host my own rack servers i dont want people mass pinged (only if they got the role)when there is a slight issue with the internet. Pinging is nice and constant flooding is to but id like it where someone can check a channel without having to go to the website and see a list of servers i chose there and glance at it and have it say up/down/pending/maintenance

CommanderStorm commented 1 year ago

Could you edit the tile to Discord: status pages using auto-edited embeds? The current title does not convey the content of your feature request accurately β‡’ this is reducing the chances of this issue gaining traction a lot

What you are requesting is to build a discord bot which edits a message on discord. Rationale: Editing can only be done via the sdk and not via a simple api-call or webhook.

Said discord bot does not really fit into the current notification structure. Rationale: Our notifications don't have enough context to render a status page.

If you would like to help in this effort despite the considerable changes needed, here is the contribution guide: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md For the changes required, opening a Pull-Request with a solid work-plan would be a good idea.

shadowgamingyt commented 1 year ago

@CommanderStorm Another option for this would be that the new badge system i noticed recently can make a link to be sent, if that link was able to be embeded to show the image that is on that page it would auto update it self cause if it goes down the image would change which the link since its embeded would auto change it

CommanderStorm commented 1 year ago

Not possible, a bade is an svg-image => Embeds requre open-graph-metatdata to be present => as far as I can research impossible in svgs, given that they don't support meta-tags

See this example https://nav-monitoring.mm.rbg.tum.de/api/badge/5/uptime/720?label=Website%20Uptime/30&labelSuffix=d

CommanderStorm commented 1 year ago

also: discord likely does not auto-update embeds except via a bot => your status site would be quite limited

also note (source: https://www.reddit.com/r/discordapp/comments/d79hsm/embedding_links_on_discord/)

It is not possible to send an embed through a user account without breaking the tos that discord has. refer to this article from discord: https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-

CommanderStorm commented 10 months ago

@Allard-B noted in #1889 that this may be possible via custom discord bots: https://stackoverflow.com/questions/65970556/discord-py-edit-webhook-message-embed-in-on-message

nathanapples commented 6 months ago

I think this is doing something similar to what some might be looking for here: https://github.com/finlaysawyer/discord-uptime?tab=readme-ov-file 68747470733a2f2f692e6779617a6f2e636f6d2f36643565306334666264623566663532363139643836656566383237653336392e706e67

Kamiikaze commented 5 months ago

I added a command to my discord bot, which grabs data from the public UptimeKuma status page api /api/status-page/<status-page-name>. So there is no need to pass an api key via the discord bot, just the url to the status page. refreshes on an x interval and displays everything whats public available.

image

koimoee commented 4 months ago

I added a command to my discord bot, which grabs data from the public UptimeKuma status page api /api/status-page/<status-page-name>. So there is no need to pass an api key via the discord bot, just the url to the status page. refreshes on an x interval and displays everything whats public available.

image

can you give this source code? i just need that more api

Kamiikaze commented 4 months ago

can you give this source code? i just need that more api

I only use the API mentioned above. Source code wouldn't be useful as the bot uses a self made framework and is built modular.

Which info do u exactly need?

koimoee commented 4 months ago

I only use the API mentioned above. Source code wouldn't be useful as the bot uses a self made framework and is built modular.

Which info do u exactly need?

i see, i just need an api to get services name, avg.Uptime, etc, to use in my discord bot using axios.

Kamiikaze commented 4 months ago

i see, i just need an api to get services name, avg.Uptime, etc, to use in my discord bot using axios.

I am extracting this all from /api/status-page/<status-page-name>

Example: http://45.91.101.83:3001/api/status-page/test

iirc I calculate the avg. uptime by myself using the status-page heartbeat API

Example: http://45.91.101.83:3001/api/status-page/heartbeat/test

koimoee commented 4 months ago

I am extracting this all from /api/status-page/<status-page-name>

Example: http://45.91.101.83:3001/api/status-page/test

iirc I calculate the avg. uptime by myself using the status-page heartbeat API

Example: http://45.91.101.83:3001/api/status-page/heartbeat/test

thanks for your information!

skyelillith commented 4 months ago

can you give this source code? i just need that more api

I only use the API mentioned above. Source code wouldn't be useful as the bot uses a self made framework and is built modular.

Which info do u exactly need?

Whitch Bot are you using? Is it the yagpb w/ custom Commands, if yes could you provide the Code? :)

Kamiikaze commented 4 months ago

Whitch Bot are you using? Is it the yagpb w/ custom Commands, if yes could you provide the Code? :)

No its a custom bot with a self made framework. You can invite him via this Link