mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 22:25:59 +03:00
[GH-ISSUE #2493] MQTT-support for alerts. Proof-of-concept implemented. Feedback requested #1832
Labels
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#1832
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @insensitiveclod on GitHub (Aug 29, 2019).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/2493
TLDR:
I have implemented a method to get LGSM alerts to be distributed via the MQTT protocol.
I am looking for feedback on it , review the implementation AND on guidance on how to get it prepped for inclusion into the base LGSM package.
A proof of concept is in 'insensitiveclod/LinuxGSM'
Long version:
I have implemented:
alert_mqtt.sh
And altered:
alert_sh (to know what to do)
core_functions.sh (to know about it)
core_dl.sh (to define mqttpubpath... Is possibly not the right place ?)
Also, an example config has been made for rust:
rustserver/_default.cfg
Since I only started using LGSM about a month ago, and I just checked out the source 4 days ago, I dont know if there's particular requirements/ideas that I am missing in my implementation.
I aim to re-write json-format of the alert_mqtt.sh message somewhat to more correspond to something that'll be easily parseable by something like NodeRed
I am thinking of doing this with a 'mqttjsontemplate' config-param that'll allow formatting things from the config-file, as it would be quite a pain to have to edit alert_mqtt.sh for most users.
The config currently knows about:
mqttalert on/off
mqtthost server-name/ip
mqttport service-port
mqttuser user to login with (anonymous-user support coming)
mqttpassword password for user (see above)
mqtttopic mqtt 'topic' name.
The mqtttopic is currently 'fixed'. That is, '/lgsm/rustserver' for the rust-server example.
I am thinking of changing it to "mqtttopicbase" instead, so the full topic of any alert will be in the form of /lgsm/rustserver/$instancename/
If you know how MQTT works, this will mean you can subscribe to /lgsm/rustserver/# and get messages from ALL instances; of /lgsm/rustserver/rustserver1 for the 'rustserver1' instance , only.
Comments very welcome.
Keen to have this be available for anyone/everyone.
@issue-label-bot[bot] commented on GitHub (Aug 29, 2019):
Issue-Label Bot is automatically applying the label
type: feature requestto this issue, with a confidence of 0.81. Please mark this comment with 👍 or 👎 to give our bot feedback!Links: app homepage, dashboard and code for this bot.
@BrutalBirdie commented on GitHub (Aug 30, 2019):
IMHO
MQTT is a nice addition. Some people won't know what do with it.
I like it! With MQTT enabled for LGSM I can add my Server(s) to my SmartHome via. openHAB.
If I get time I will test and check your code.
@insensitiveclod commented on GitHub (Sep 9, 2019):
Cheers, thanks for your response.
The nice thing is that it integrates with quite a few services 'under the hood' as well.
A lot of the Internet of Things infrastructure has chosen MQTT as it's default method of communication. ITTT, TheThingsNetwork (Lorawan), etc.. So that makes it nice to be able to recieve these kinds of game-server messages on your devices OR remix them in other ways.
Lemme know what changes/modifications might be useful to have it be ready for inclusion or a pull-request.
@noldona commented on GitHub (Jul 11, 2022):
+1 for this feature. I use Home Assistant would would love to be able to automatically report the server's status to it.