g4-bot-monitor
is a lightweight, single-file SignalR client designed to shadow a bot and sync its status to a central SignalR hub. It also exposes a tiny HTTP listener so the bot can report its own status via local HTTP requests.
g4-bot-monitor --HubUri=<hub-url> --Name=<bot-name> --Type=<bot-type> --ListenerUri=<listener-url> --Id=<bot-id>
All parameters are required:
Parameter | Description |
---|---|
--HubUri |
SignalR hub URL (e.g., http://localhost:9944 ) |
--Name |
Human-readable bot name (e.g., "InvoiceBot" ) |
--Type |
Bot type/category (e.g., "Static Bot" , "File Listener" ) |
--ListenerUri |
Base URI where the monitor listens (e.g., http://localhost:8080 ) |
--Id |
The unique identifier of the bot instance used for hub registration and tracking. |
After startup, the monitor begins listening at:
<ListenerUri>/monitor/<Id>/
Simple health check — always returns 200 OK
.
curl http://localhost:8080/monitor/ping
Response:
{ "message": "pong" }
Used by the bot to send status updates to the SignalR hub.
Expected payload:
{ "status": "Working" }
Example request:
curl -X POST http://localhost:8080/monitor/update \
-H "Content-Type: application/json" \
-d '{ "status": "Working" }'
Success Response:
{ "message": "Connected bot successfully updated." }
Failure Response:
{
"error": "ExceptionType",
"message": "Stack trace or reason"
}
./g4-bot-monitor-linux-x64 \
--HubUri=http://localhost:9944 \
--Name=Bot42 \
--Type="Static Bot" \
--ListenerUri=http://localhost:8080 \
--Id=1234567890
- Retries connection and registration up to 10 minutes
- Exposes
/monitor/ping
and/monitor/update
endpoints - Listens for
ReceiveHeartbeat
andReceiveRegisterBot
from the hub - Handles Ctrl+C, shutdown signals, and graceful cleanup
- Skips failed update attempts (non-blocking)