Closed mspencerl87 closed 1 year ago
Issue-Label Bot is automatically applying the label type: feature request
to this issue, with a confidence of 0.90. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
If there is an API in a similar vein to discord telegram etc then it would be possible. Of you can post any docs about sending messages via an API then I can take a look :)
@dgibbs64 Are you familiar with Telegraf? Here is the github page https://github.com/telegraf/telegraf https://github.com/influxdata/telegraf https://www.influxdata.com/time-series-platform/telegraf/
GitHubModern Telegram Bot Framework for Node.js. Contribute to telegraf/telegraf development by creating an account on GitHub.
GitHubThe plugin-driven server agent for collecting & reporting metrics. - influxdata/telegraf
@dgibbs64 Generally people have been using Grafana to display metrics over the last few years. These setups generally include the following. Grafana (Visiual) + Influxdb + Telegraf (Metrics Collector)
Telegraf can work in a push or pull configuration, alot of people use telegraf on Linux/Windows systems also SNMP, IPMI etc. To pull metrics
You can see all the out of the box supported inputs here https://github.com/influxdata/telegraf/tree/master/plugins/inputs
GitHubThe plugin-driven server agent for collecting & reporting metrics. - influxdata/telegraf
I am aware of it but never the used it myself. If I can send stuff to an API endpoint/webhook via curl then It's pretty easy for me to setup. But don't know if that's possible here. Check out alert_discord.sh in my code for an example of what I mean.
not finding alert_discord.sh in code. Can you share a link? And thank you for the consideration.
This might be a better example https://github.com/anderssonoscar0/influxdb_srcds_exporter This guy is exporting SRCDS to influxdB This is only on CSGO, but may serve you better.
I wish i could be more help!
GitHubInfluxDB Exporter for SRCDS game servers, currently working with CSGO - anderssonoscar0/influxdb_srcds_exporter
I've used telegraf quite a bit, maybe I can be of help. I would also be interested in exposing useful stats to telegraf/influxdb.
First we probably need to find out what data is available. I'm running ARK with LGSM and the monitor command doesn't return anything useful except the number of players online. So if that is easy to get (without installing gamedig
as this enlarges my docker image by 300%), I'm happy to provide a small command that can expose it as telegraf metrics.
The second question that comes to mind is: what common metrics are available for all servers? Ideally one could have a command that works for all servers to get version, players online etc.
@dgibbs64 I'm not so familiar with the Query or RCON port. I tried using rcon (which is fast and small), but it no longer works for my ARK server. I've seen code in LGSM (gsquery) which seems obsolete. gamedig
is too large for me as it requires installing nodejs. Is there an easier way to get status from the Query port?
gamedig is by far the best way to get info useful from game servers. Since game servers can be very large im not sure why increasing the size of a container and installing nodejs matters. gsquery is not obsolete and is used if gamedig is not installed, but gsquery only used to check if query is responding and not gather stats.
The main metric is player numbers and if the server is online.
if number of players is the only "common" metric (and if the server is online), then I'd prefer a lightweight solution.
One can easily extend my docker image or install gamedig
on the host and then create a small script to fetch the result from the log.
BUT I've figured out whats wrong with RCON, so I will fix that and use it to export online players to telegraf.
@dgibbs64 most of what's inside the "details" result that you posted can directly fetched from the system (cpu, mem, disk, ...) so the only interesting metric (for me) so far is the number of players online. Maybe along with the server name/map/type.
So, with the fixed RCON script, I can now read the number of online players
python3 rcon-ark.py listplayers | grep -v 'No Players Connected' | wc -l
(see https://github.com/DrPsychick/docker-linuxgsm-ark)
it would indeed be great if LGSM could provide the metric generically with a command as not all games work the same. And gamedig
seems to be able to provide the data, right? The only requirement would be that the command executes (or fails) fast and returns machine readable output.
> myserver status
status: online
players: 5
max_players: 10
to use that with telegraf would then be easy with a script that returns influx protocol and is executed with inputs.exec
in the telegraf.conf
:
#!/bin/bash
stat=$(myserver status)
online=0
if [ -n "$(echo "$stat" | grep 'status: online')" ]; then
online=1
fi
players=$(echo "$stat" | grep ^players | cut -d: -f2)
max=$(echo "$stat" | grep ^max_players | cut -d: -f2)
echo "players,host=myhost,game=mygame online=$online,players=$players,max_players=$max $(date +%s)000000000"
GitHubLinuxGSM + Steam ARK server base (shared image for ARK servers) - DrPsychick/docker-linuxgsm-ark
NO update on this. If there is an api endpoint that can be used to send data like the other alerting systems then it will be worth taking a look. I have no knowledge in telegraf currently so closing for now
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
User Story
Is there anyway to export ./gameserver monitor metics to grafana? Or is there anyway to export metrics, server stats, uptime, players, ports etc, to telegraf?
Basic info
Further Information
Would like to monitor servers status remotely, currently the only thing I can think to monitor is systemd but this will mostly only show CPU/Memory usage
Further Reading
As an example, i run docker. I can export the docker hosts metrics via telegraf and display them in grafana like the link below. It would be awesome to be able to do this with LinuxGSM https://grafana.com/grafana/dashboards/10585 Another example https://github.com/ratibor78/srvstatus