Remote agent #295

Closed
opened 2026-02-28 01:41:45 -05:00 by deekerman · 11 comments
Owner

Originally created by @amastelek on GitHub (Oct 2, 2021).

I have a request for a remote agent, This can be a docker one that can be loaded on any operating system.
The remote agent polls a tcp port on the uptime kuma server, e.g. 3010. It measures the latency and then posts it to the server using JSON. That post can include additional metrics such as CPU usage, hard disk health, wifi signal strength, etc.
When a new monitor is created on the server it generates a random unique key. That key is used as a parameter in the remote agent and is embedded in the JSON posting the metrics.
This will allow monitoring of systems behind a firewall such as work from home users. Even servers and desktops in a normal work environment being monitored by a cloud vps.

Originally created by @amastelek on GitHub (Oct 2, 2021). I have a request for a remote agent, This can be a docker one that can be loaded on any operating system. The remote agent polls a tcp port on the uptime kuma server, e.g. 3010. It measures the latency and then posts it to the server using JSON. That post can include additional metrics such as CPU usage, hard disk health, wifi signal strength, etc. When a new monitor is created on the server it generates a random unique key. That key is used as a parameter in the remote agent and is embedded in the JSON posting the metrics. This will allow monitoring of systems behind a firewall such as work from home users. Even servers and desktops in a normal work environment being monitored by a cloud vps.
deekerman 2026-02-28 01:41:45 -05:00
Author
Owner

@gaby commented on GitHub (Oct 2, 2021):

@amastelek Push based notifications are available in the mightly image tag, see here: #279

The metrics data sounds more of a "Health and Status", instead of an Uptime Status which is Uptime-Kuma

@gaby commented on GitHub (Oct 2, 2021): @amastelek Push based notifications are available in the mightly image tag, see here: #279 The metrics data sounds more of a "Health and Status", instead of an Uptime Status which is Uptime-Kuma
Author
Owner

@theoneandonly-vector commented on GitHub (Nov 1, 2021):

still since we have push now.. we can actually monitor if a host runs out of memory or has a high cpu load. I think we should gather simple commands/scripts to make this happen (without the need of an agent).

@theoneandonly-vector commented on GitHub (Nov 1, 2021): still since we have push now.. we can actually monitor if a host runs out of memory or has a high cpu load. I think we should gather simple commands/scripts to make this happen (without the need of an agent).
Author
Owner

@Tchoupinax commented on GitHub (Jan 21, 2022):

Hello,

I continue this topic to talk about the agent. The push notification is a very good feature to monitor not exposed service, but you should have access to this service and have to edit it to send the request.

For this case, I think an agent is necessary. For exemple, I will take a drone-runner service, within a Docker container, with is a service written with Go. I would like to monitor this service but it is not exposed, and I do not want edit the container (even if I could because the code is open source).

For this case, I imagine this feature. I made the POC with bash

IP=$(docker inspect drone-runner | jq '.[].NetworkSettings.Networks.bridge.IPAddress' -r)
PORT=$(docker inspect drone-runner | jq '.[].NetworkSettings.Ports' | jq 'keys []' -r | cut -d "/" -f 1)

URI="http://$IP:$PORT/healthz"

CODE=$(curl -s -o /dev/null -w "%{http_code}" $URI)

if [[ $CODE == 200 ]]; then
  curl https://UPTIME_KUMA_URL/api/push/lB95pTNgVI?msg=OK &> /dev/null
fi

I could edit this project to create the agent but I do not really know if this pattern is ok and how to implement this feature. Let's discuss about it :)

TL;DR : How to monitor not exposed service without the ability to edit this service to add a push notification ?

I think this feature could create an agent that register to the master when starting. On the dashboard, we can choose a method and specify an agent if we need it to make the check (e.g. PING this url with Agent #1). For performing the action, in the case an agent has been specified, the master will contact the agent to execute the query instead of executing itself. When the agent received the answer, it forward it to the master.

What do you think ?

@Tchoupinax commented on GitHub (Jan 21, 2022): Hello, I continue this topic to talk about the `agent`. The push notification is a very good feature to monitor not exposed service, but you should have access to this service and have to edit it to send the request. For this case, I think an agent is necessary. For exemple, I will take a `drone-runner` service, within a Docker container, with is a service written with Go. I would like to monitor this service but it is not exposed, and I do not want edit the container (even if I could because the code is open source). For this case, I imagine this feature. I made the POC with bash ```bash IP=$(docker inspect drone-runner | jq '.[].NetworkSettings.Networks.bridge.IPAddress' -r) PORT=$(docker inspect drone-runner | jq '.[].NetworkSettings.Ports' | jq 'keys []' -r | cut -d "/" -f 1) URI="http://$IP:$PORT/healthz" CODE=$(curl -s -o /dev/null -w "%{http_code}" $URI) if [[ $CODE == 200 ]]; then curl https://UPTIME_KUMA_URL/api/push/lB95pTNgVI?msg=OK &> /dev/null fi ``` I could edit this project to create the agent but I do not really know if this pattern is ok and how to implement this feature. Let's discuss about it :) **TL;DR** : How to monitor not exposed service without the ability to edit this service to add a push notification ? I think this feature could create an agent that register to the master when starting. On the dashboard, we can choose a method and specify an agent if we need it to make the check (e.g. PING this url with Agent #1). For performing the action, in the case an agent has been specified, the master will contact the agent to execute the query instead of executing itself. When the agent received the answer, it forward it to the master. What do you think ?
Author
Owner

@theoneandonly-vector commented on GitHub (Jan 21, 2022):

@Tchoupinax
I think you should create agents in a seperate Agent-Repository where we as a community gather different agents for different usecases (add a little readme for every usecase/agent) and just run it using crontab or windows service etc..

@theoneandonly-vector commented on GitHub (Jan 21, 2022): @Tchoupinax I think you should create agents in a seperate Agent-Repository where we as a community gather different agents for different usecases (add a little readme for every usecase/agent) and just run it using crontab or windows service etc..
Author
Owner

@theoneandonly-vector commented on GitHub (Jan 21, 2022):

and I must say I really see a big potential in all sizes of companys.. as they often have "monitoring for everything" but in the end it's never as good as a specific monitor for specific usecases.

@theoneandonly-vector commented on GitHub (Jan 21, 2022): and I must say I really see a big potential in all sizes of companys.. as they often have "monitoring for everything" but in the end it's never as good as a specific monitor for specific usecases.
Author
Owner

@Tchoupinax commented on GitHub (Jan 21, 2022):

Is this repository already exists ? (can I have the link ? :D)

I do not really understand your reasoning, uptime-kuma is a monitoring for everything : it accepts HTTP, TCP, Ping... a lot of protocol and it supports a lot of service for notifications. The purpose of agent is just to extend the capability for not exposed service. The push notification feature is the right way, but incomplete as my sense... To complete this, the project misses agents, in my sens always; I'm asking and expose my idea because I do not know if it is good.

I can create an agent like the code I published, but It could be integrated to the project as a native feature and I think it could be better for configuring and handle all your monitoring. We have just to improve a little the push notification feature, make an agent and modify the UI to specify an agent.

If I understand your idea : why uptime kuma supports so many notifcation type ? Kuma could only send a webhook and tells "if you want to notify on XX, please use our agent for this usecase". But it is simpler to select your notification type on the list and click on "valid".

I really need think agent could be a good part of this project but I would love to read your explanation if you think it is not the case.

@Tchoupinax commented on GitHub (Jan 21, 2022): Is this repository already exists ? (can I have the link ? :D) I do not really understand your reasoning, uptime-kuma **is** a monitoring for everything : it accepts HTTP, TCP, Ping... a lot of protocol and it supports a lot of service for notifications. The purpose of agent is _just_ to extend the capability for not exposed service. The push notification feature is the right way, but incomplete as my sense... To complete this, the project misses agents, in my sens always; I'm asking and expose my idea because I do not know if it is good. I can create an agent like the code I published, but It could be integrated to the project as a native feature and I think it could be better for configuring and handle all your monitoring. We have _just_ to improve a little the push notification feature, make an agent and modify the UI to specify an agent. If I understand your idea : why uptime kuma supports so many notifcation type ? Kuma could only send a webhook and tells "if you want to notify on XX, please use our agent for this usecase". But it is simpler to select your notification type on the list and click on "valid". I really need think agent could be a good part of this project but I would love to read your explanation if you think it is not the case.
Author
Owner

@theoneandonly-vector commented on GitHub (Jan 21, 2022):

I don't see enough improvement in bloating uptime-kuma for this.
you could just create a few installer-scripts where you put in the url and auto-create a crontab.

there are limitless amounts of agents.. so including them in the UI is quite useless as soon as the numbers build up

@theoneandonly-vector commented on GitHub (Jan 21, 2022): I don't see enough improvement in bloating uptime-kuma for this. you could just create a few installer-scripts where you put in the url and auto-create a crontab. there are limitless amounts of agents.. so including them in the UI is quite useless as soon as the numbers build up
Author
Owner

@kobozo commented on GitHub (Aug 30, 2022):

I need to monitor servers that are hidden from the network where Kuma is running. However I have, what we call, a jump server that has access to these hidden servers. The jump server can see both the hidden and Kuma. In this case a passthrough agent would be nice...

@kobozo commented on GitHub (Aug 30, 2022): I need to monitor servers that are hidden from the network where Kuma is running. However I have, what we call, a jump server that has access to these hidden servers. The jump server can see both the hidden and Kuma. In this case a passthrough agent would be nice...
Author
Owner

@FrankSanabria commented on GitHub (Feb 28, 2023):

Hello,

I continue this topic to talk about the agent. The push notification is a very good feature to monitor not exposed service, but you should have access to this service and have to edit it to send the request.

For this case, I think an agent is necessary. For exemple, I will take a drone-runner service, within a Docker container, with is a service written with Go. I would like to monitor this service but it is not exposed, and I do not want edit the container (even if I could because the code is open source).

For this case, I imagine this feature. I made the POC with bash

IP=$(docker inspect drone-runner | jq '.[].NetworkSettings.Networks.bridge.IPAddress' -r)
PORT=$(docker inspect drone-runner | jq '.[].NetworkSettings.Ports' | jq 'keys []' -r | cut -d "/" -f 1)

URI="http://$IP:$PORT/healthz"

CODE=$(curl -s -o /dev/null -w "%{http_code}" $URI)

if [[ $CODE == 200 ]]; then
  curl https://UPTIME_KUMA_URL/api/push/lB95pTNgVI?msg=OK &> /dev/null
fi

I could edit this project to create the agent but I do not really know if this pattern is ok and how to implement this feature. Let's discuss about it :)

TL;DR : How to monitor not exposed service without the ability to edit this service to add a push notification ?

I think this feature could create an agent that register to the master when starting. On the dashboard, we can choose a method and specify an agent if we need it to make the check (e.g. PING this url with Agent #1). For performing the action, in the case an agent has been specified, the master will contact the agent to execute the query instead of executing itself. When the agent received the answer, it forward it to the master.

What do you think ?

Great solution, don't need a agent in a local computer, with a simple script we can do it.

For example, I adjust your script to this:

#/usr/bin/bash
DATE=$(date +'%Y_%m_%d')
UK="UPTIMEKUMAURLPUSH"
SERVER=192.168.8.11
PORT=9392
netcat -z  ${SERVER} ${PORT}
if [ $? -eq 0 ]
then
        curl $UK &> /dev/null
        echo "$DATE - $SERVER:$PORT - RESULT: $? (CERO IS ONLINE)" 
fi


I will run this over local RPI computer with crontab and deploy it in local network for monitoring local servers and send to Cloud.

**Important:** Uptime Kuma Monitor define every 35 Segs. twice
@FrankSanabria commented on GitHub (Feb 28, 2023): > Hello, > > I continue this topic to talk about the `agent`. The push notification is a very good feature to monitor not exposed service, but you should have access to this service and have to edit it to send the request. > > For this case, I think an agent is necessary. For exemple, I will take a `drone-runner` service, within a Docker container, with is a service written with Go. I would like to monitor this service but it is not exposed, and I do not want edit the container (even if I could because the code is open source). > > For this case, I imagine this feature. I made the POC with bash > > ```shell > IP=$(docker inspect drone-runner | jq '.[].NetworkSettings.Networks.bridge.IPAddress' -r) > PORT=$(docker inspect drone-runner | jq '.[].NetworkSettings.Ports' | jq 'keys []' -r | cut -d "/" -f 1) > > URI="http://$IP:$PORT/healthz" > > CODE=$(curl -s -o /dev/null -w "%{http_code}" $URI) > > if [[ $CODE == 200 ]]; then > curl https://UPTIME_KUMA_URL/api/push/lB95pTNgVI?msg=OK &> /dev/null > fi > ``` > > I could edit this project to create the agent but I do not really know if this pattern is ok and how to implement this feature. Let's discuss about it :) > > **TL;DR** : How to monitor not exposed service without the ability to edit this service to add a push notification ? > > I think this feature could create an agent that register to the master when starting. On the dashboard, we can choose a method and specify an agent if we need it to make the check (e.g. PING this url with Agent #1). For performing the action, in the case an agent has been specified, the master will contact the agent to execute the query instead of executing itself. When the agent received the answer, it forward it to the master. > > What do you think ? Great solution, don't need a agent in a local computer, with a simple script we can do it. For example, I adjust your script to this: ``` #/usr/bin/bash DATE=$(date +'%Y_%m_%d') UK="UPTIMEKUMAURLPUSH" SERVER=192.168.8.11 PORT=9392 netcat -z ${SERVER} ${PORT} if [ $? -eq 0 ] then curl $UK &> /dev/null echo "$DATE - $SERVER:$PORT - RESULT: $? (CERO IS ONLINE)" fi I will run this over local RPI computer with crontab and deploy it in local network for monitoring local servers and send to Cloud. **Important:** Uptime Kuma Monitor define every 35 Segs. twice
Author
Owner

@Sid-Sun commented on GitHub (Oct 1, 2023):

Not exactly remote agents but I've created a small script on top of uptime kuma to do "replication" at database layer through restic https://github.com/Sid-Sun/replicator-kuma there are a few quirks though

@Sid-Sun commented on GitHub (Oct 1, 2023): Not exactly remote agents but I've created a small script on top of uptime kuma to do "replication" at database layer through restic https://github.com/Sid-Sun/replicator-kuma there are a few quirks though
Author
Owner

@CommanderStorm commented on GitHub (Dec 5, 2023):

still since we have push now.. we can actually monitor [...]

This part of the issue is resolved.
I think we should track the rest of the issue in #84 instead, being the more poplar issue and contentwise a duplicate
=> closing as a duplicate

@CommanderStorm commented on GitHub (Dec 5, 2023): > still since we have push now.. we can actually monitor [...] This part of the issue is resolved. I think we should track the rest of the issue in #84 instead, being the more poplar issue and contentwise a duplicate => closing as a duplicate
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#295
No description provided.