beszel icon indicating copy to clipboard operation
beszel copied to clipboard

[Feature]: Download the agent from the hub

Open cquike opened this issue 1 month ago • 4 comments

Component

Hub & Agent

Describe the feature you would like to see

I think it would be useful that the hub has a copy of the agent so that the systems added to beszel download the agent directly from the hub using a specially crafted command when adding a new host.

Today I have tried to add a few systems to beszel but I could not since cloudflare was down.

patchmon (https://github.com/PatchMon/PatchMon) uses that approach, when you add a host the command line to install the agent contains only URLs from the server being installed and is therefore self-consitent.

Motivation / Use Case

Being less exposed to errors in the infrastructure of beszel and depend purely on the self-hosted infrastructure.

Describe how you would like to see this feature implemented

When adding a system to beszel, the command line that can be optionally copied to install the agent in the system would depend only on self-hosted URLs, for instance: curl -s https://example.org/api/hosts/install -H "X-API-TOKEN: 9e38d162-289b-4aa3-857e-59cd0733418e" | sh (this is inspired in the patchmon command).

Screenshots

No response

Category

Installation

Affected Metrics

CPU

cquike avatar Nov 18 '25 21:11 cquike

Just to be more clear, the patchmon script is then downloading the specific agent with a command like this:

# Download the binary
curl $CURL_FLAGS \
    -H "X-API-ID: $API_ID" \
    -H "X-API-KEY: $API_KEY" \
    "$PATCHMON_URL/api/v1/hosts/agent/download?arch=$ARCHITECTURE&force=binary" \
    -o /usr/local/bin/patchmon-agent

after proper detection of the architecture.

cquike avatar Nov 18 '25 21:11 cquike

Attaching to https://github.com/henrygd/beszel/issues/1057 and https://github.com/henrygd/beszel/issues/1266 for later ref.

svenvg93 avatar Nov 19 '25 06:11 svenvg93

The Patchmon equivalent of the Hub still needs to connect to GitHub to download the binaries. Wouldn't you run into the same problem if GitHub is down? Maybe I'm missing the point.

henrygd avatar Nov 24 '25 20:11 henrygd

Yes, that's correct, the hub in the case of patchmon still needs to download the binaries. The difference is that after that the hub can serve the agent to all the clients. So if you have a dozen of systems as I have it, once the hub has the agent you can update and install new systems just connecting to the hub. That might also be useful for networks in which the systems to be monitored are behind a firewall which allows them to connect to just some domains, including the one from the hub, of course but not necessarily github.

cquike avatar Nov 25 '25 15:11 cquike