DM-ServerStatusPingFiveM
DM-ServerStatusPingFiveM is a FiveM script designed to enhance your server's uptime monitoring by pinging a status logger endpoint (e.g., BetterStack) and sending notifications to a Discord channel. This ensures your server status is always accurately monitored.
Features
- Ping Status Logger: Automatically pings a provided URL at regular intervals for uptime tracking.
- Discord Integration: Sends status notifications to a Discord Webhook.
- Alternating Pings: Alternates between sending pings to the logger endpoint and Discord notifications.
- Configurable Intervals: Easily adjust the ping frequency in the configuration file.
- Custom Headers: Supports custom headers (e.g., API tokens) for added flexibility.
- Lightweight: Minimal resource impact on your server.
Installation
-
Download and Extract:
-
Download the script and place the folder
DM-ServerStatusPingFiveM
into yourresources
directory.
-
Download the script and place the folder
-
Configure:
-
Open the
config.lua
file. -
Replace
Config.StatusLoggerURL
with your status logger endpoint (e.g., BetterStack heartbeat URL). -
Replace
Config.DiscordWebhookURL
with your Discord Webhook URL. -
Adjust
Config.PingInterval
(in milliseconds) to set the frequency of pings. Default is 1 minute (60000
ms). -
Add or modify headers in
Config.StatusLoggerHeaders
andConfig.DiscordHeaders
if required.
-
Open the
-
Add to Server Configuration:
-
Open your
server.cfg
file. -
Add the following line:
ensure DM-ServerStatusPingFiveM
-
Open your
-
Start the Server:
- Start your FiveM server to initialize the script.
Notes
- The script alternates between sending pings to the status logger and Discord notifications to optimize efficiency.
-
Ensure the URLs and tokens provided in the
config.lua
file are valid and active.
Edited by DeputyRyan
Desc Edit
What's New in Version 2.0 See changelog
Released
Change Log: DM-ServerStatusPingFiveM v2.0
Added
- Discord Integration: Sends status notifications to a Discord Webhook.
- Alternating Pings: Alternates between sending pings to the status logger and Discord every interval.
Improved
- Enhanced Comments: Added detailed comments for better code readability and maintenance.
Fixed
- None in this release.
Removed
- None in this release.
FAQ: DM-ServerStatusPingFiveM
What is DM-ServerStatusPingFiveM?
DM-ServerStatusPingFiveM is a FiveM script designed to send periodic pings to status logger endpoints (e.g., BetterStack) to keep your server's uptime status updated.
How do I configure the script?
Edit the config.lua
file to:
-
Set the
StatusLoggerURL
to your status logger's endpoint. -
Adjust the
PingInterval
to control how often the script sends pings. - Add any required headers, such as API tokens.
Which services does this support?
The script is compatible with any status logging service that accepts HTTP requests, such as BetterStack, UptimeRobot, or other monitoring platforms.
What payload does the script send?
The script sends a simple JSON payload ({status: "online"}
by default) to indicate the server is operational. This can be modified in server.lua
.
What happens if the endpoint is down?
If the endpoint is unreachable or returns an error, the script will log a failure message and the HTTP status code in the server console.
How do I troubleshoot issues?
-
Verify the
StatusLoggerURL
is correct. - Ensure the FiveM server has an active internet connection.
- Check the server console for error messages or status codes.
- Confirm the headers and payload match the status logger’s requirements.
Where can I get support?
For support, visit:
Can I contribute to the project?
Yes! Contributions are welcome. Fork the project on GitHub, make your changes, and submit a pull request.
Author
- Author: DeputyRyan - DeputyMods
Recommended Comments
There are no comments to display.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.