question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[How-To] Valheim monitoring or other udp services

See original GitHub issue

I was looking for a way to monitor valheim with uptime kuma which is not (yet?) possible with Uptime Kuma. But I found a workaround which could help a few people.

I’ve installed nginx on my valheim server. I’ve added a cronjob which checks every minute if the process is running and post a 1 into a html file, if not echo a 0 into it.

* * * * * if [ $(pidof ./valheim_server.x86_64) ]; then echo 1 > /var/www/html/index.html; else echo 0 > /var/www/html/index.html;fi

Then I used the HTTP(s) Keyword request to look for a 1 at given address.

keyword

Note: If this “Issue” isnt valid just delete it.

#551 #9

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
takaze212commented, Nov 4, 2021
  1. Create script nano /opt/check_service.sh
#!/bin/bash

service=$1
url=$2

if [ -z "$url" ] || [ -z "$service"]
  then
    echo "argument missing"
    echo "usage check_service.sh [servicename] [push URL]"
    exit
fi

/bin/systemctl -q is-active "$service.service"
status=$?
if [ "$status" == 0 ]; then
    curl --silent --output /dev/null $url
fi
  1. make executable chmod +x /opt/check_service.sh

  2. create contab, run every minute crontab -e * * * * * /opt/check_service.sh [[YOUR_SERVICENAME_HERE]] [[YOUR_UPTiME_PUSH_URL_HERE]] > /dev/null

  3. enjoy 😃

//edit: typos fixed

2reactions
louislamcommented, Nov 10, 2021

Could be more reliable and easier to check your Valheim Server status using the steam api…

You get your api key here: https://steamcommunity.com/dev/apikey

This would be the link to a site that gives you all information available for your server in json format: https://api.steampowered.com/IGameServersService/GetServerList/v1/?filter=\appid\892970\addr\your-server-ip:port&key=steamapikey

The “appid” above is already the Valheim app ID - you can of course get this info for other servers, too, just check on steam.

You can see an example of how it is implemented on a website here

If it is using steam server, uptime kuma is already supported it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Valheim: how to set up a dedicated server - Rock Paper Shotgun
Valheim Port-Forwarding and IP Address explained · Hit Start+R and type in "wf. · Click on "Inbound Rules", then right-click it and select...
Read more >
Dedicated Server setup and management with GSM
Takes you through the process of setting up a Valheim server with Game Server Manager which automates things & provides a host of...
Read more >
How to set up a Valheim Dedicated Server | Shacknews
Valheim Dedicated Server troubleshooting · Search Windows Defender Firewall and open it · Select Advanced settings · Select Inbound Rules · Choose ...
Read more >
Valheim | Grafana Labs
You must have your Valheim server set to PUBLIC and have port forwarding setup for your steam query port (Valheim Port number +1),...
Read more >
Valheim dedicated server windows firewall. They can be ...
They can be encoded using the following tran Valheim uses several UDP ports for ... Valheim Dedicated Server Setup | Host a FREE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found