Menu

How to get a Discord alert when your Minecraft server goes down
📰

How to get a Discord alert when your Minecraft server goes down

DEV Community: tutorial·Ridh Grg·6 days ago
#qMTF3zwv
#devtotutorial#devto#dev#server#discord
Reading 0:00
15s threshold

If you run a Minecraft server at home, the first sign it's down is usually a message from a player. Here's a free way to hear about it first, with a short script, a cron job and a Discord webhook. It takes about ten minutes on any Linux box.

1. Make a Discord webhook

In your Discord server, open the channel you want alerts in, then Edit Channel, Integrations, Webhooks, New Webhook. Copy the webhook URL and keep it private, since anyone with it can post to that channel.

2. Install netcat

On Debian or Ubuntu:

sudo apt install netcat-openbsd

Enter fullscreen mode

Exit fullscreen mode

3. Save the script

Save this as ~/mc-check.sh , put your webhook URL in, and make it runnable with chmod +x ~/mc-check.sh :

#!/usr/bin/env bash # Posts to Discord when the Minecraft server stops answering, and again when it's back.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.