Client to push monitoring data from local or remote queried agents to the Agent-Push-Server. The Agent-Push-Client was developed as an alternative to the missing push agent for checkmk Community.
-
Always use TLS in production.
Clients authenticate with a bearer token sent in the
Authorizationheader. Without TLS this secret is transmitted in cleartext. Always use https URLs for the server connection. -
Remote agent data is unencrypted.
Data collected remotely from check_mk_agent via TCP Port 6556 is unencrypted and not authenticated. This should only be used in trusted networks.
-
Always check configuration permissions.
The access rights for the configuration files are fundamental to the security of the stored access credentials. Please refer to the documentation in the "Copy example configuration files" sections.
- git
- python3 (tested with 3.12)
- python3-venv
- see requirements.txt
Please note: Running as a docker container, query local agent is disable as it would query the agent inside container.
Docker needs to be installed.
-
Clone repository
git clone https://github.com/mape2k/agent-push-client
-
Build docker image
docker build -t mape2k/agent-push-client:latest agent-push-client/.
-
Copy example configuration files
sudo cp agent-push-client/config/config.example.toml agent-push-client/config.toml sudo chown 10001:10001 agent-push-client/config.toml sudo chmod 0400 agent-push-client/config.toml
-
Adjust configuration file agent-push-client/config.toml
-
Copy example docker compose file
sudo cp agent-push-client/docker-compose.example.yml agent-push-client/docker-compose.yml
-
Adjust docker compose file agent-push-client/docker-compose.yml
-
Run docker image with compose
cd agent-push-client docker compose up
You should run this application using a dedicated user.
Install system requirements and create user.
sudo apt-get update
sudo apt-get install python3-venv git
sudo useradd --no-create-home --home-dir /nonexistent \
--shell /usr/sbin/nologin --user-group agent-push-clientsudo emerge dev-vcs/git
sudo useradd --no-create-home --home-dir /nonexistent \
--shell /usr/sbin/nologin --user-group agent-push-client-
Clone repository
cd /opt sudo git clone https://github.com/mape2k/agent-push-client sudo chown --recursive root:root /opt/agent-push-client -
Initialize virtual environment
sudo python3 -m venv /opt/agent-push-client/virtualenv
-
Install python requirements in virtual environment
sudo /opt/agent-push-client/virtualenv/bin/pip install -r /opt/agent-push-client/requirements.txt
-
Copy example configuration files
sudo mkdir /etc/agent-push-client sudo cp /opt/agent-push-client/config/config.example.toml /etc/agent-push-client/config.toml sudo chown root:agent-push-client /etc/agent-push-client/config.toml sudo chmod 0640 /etc/agent-push-client/config.toml
-
Adjust configuration file /etc/agent-push-client/config.toml
-
Copy systemd unit file
sudo cp /opt/agent-push-client/contrib/systemd/agent-push-client.service /etc/systemd/system/agent-push-client.service
-
Adapt /etc/systemd/system/agent-push-client.service if you change installation directory or use another user.
-
Copy sudoers file (if you want to collect data from local agent with sudo)
sudo cp /opt/agent-push-client/contrib/sudo/agent-push-client /etc/sudoers.d/agent-push-client
-
Reload systemd daemon to reload unit file and start and enable service
sudo systemctl daemon-reload sudo systemctl enable agent-push-client.service --now
-
Copy OpenRC config and init file
sudo cp /opt/agent-push-client/contrib/openrc/agent-push-client.confd /etc/conf.d/agent-push-client sudo cp /opt/agent-push-client/contrib/openrc/agent-push-client.initd /etc/init.d/agent-push-client
-
Copy logrotate file
sudo cp /opt/agent-push-client/contrib/logrotate/agent-push-client /etc/logrotate.d/agent-push-client
-
Copy sudoers file (if you want to collect data from local agent with sudo)
sudo cp /opt/agent-push-client/contrib/sudo/agent-push-client /etc/sudoers.d/agent-push-client
-
Add agent-push-client to default start and start service
sudo rc-update add agent-push-client sudo /etc/init.d/agent-push-client start
-
Update repository
cd agent-push-client git pull -
Rebuild docker image
docker build -t mape2k/agent-push-client:latest . -
Adjust configuration file config/config.toml
-
Check for differences in docker-compose.examle.yml to your docker-compose.yml.
-
Re-run docker image with compose
docker compose down docker compose up
-
Update repository
cd /opt/agent-push-client git pull -
Update virtual environment
sudo python3 -m venv --upgrade /opt/agent-push-client/virtualenv
-
Update python requirements in virtual environment
sudo /opt/agent-push-client/virtualenv/bin/pip install --upgrade -r /opt/agent-push-client/requirements.txt
-
Adjust configuration file /etc/agent-push-client/config.toml
-
Check for differences in systemd service and sudo files.
-
Restart
sudo systemctl restart agent-push-client.service
-
Check for differences in init, conf.d and sudo files.
-
Restart
sudo /etc/init.d/agent-push-client restart
- Breaking
- Source timeout is now the total budget per collection (connect and data transfer), previously it applied per connect/read operation
- Security
- Limit collected agent data to 5 MiB to protect client memory
- Warn when the server URL uses plain http
- Restrict sudoers rule to check_mk_agent without arguments
- Document config file permissions (plaintext secret) and add security notes to README
- Fixed
- Validate server.url and server.secret at startup with clear error messages
- SIGHUP no longer terminates the daemon (reload was never supported); remove ExecReload
- Align OpenRC respawn behavior with systemd (fail loudly on crash)
- Log "collected" only after successful collection; fix log message typo
- Changed
- Declare urllib3 as direct dependency
- Initial implementation
Parts of this project were generated or assisted using Claude Code.