mirror of
https://ark.sudovanilla.org/Korbs/Netweak-Agent-Docker.git
synced 2024-12-23 03:53:52 +00:00
127 lines
4.4 KiB
Markdown
Executable file
127 lines
4.4 KiB
Markdown
Executable file
# Netweak Agent for Docker
|
|
![Cover](https://md.sudovanilla.org/images/network-plus-docker.png)
|
|
|
|
> This is an unofficial Docker Image for Netweak's agent.
|
|
|
|
## Running
|
|
### Requirements
|
|
- Supported OS:
|
|
- Linux
|
|
- macOS
|
|
- Windows 10 or newer
|
|
- Supported Architecture:
|
|
- x86_64 / amd64
|
|
- arm64 / aarch64
|
|
- Docker Engine:
|
|
- [Linux](https://docs.docker.com/engine/install/#supported-platforms)
|
|
- [macOS](https://richstone.io/best-way-to-install-docker-on-a-mac/) ([Homebrew](https://brew.sh/), without Docker Desktop)
|
|
- [Windows](https://dev.to/felipecrs/simply-run-docker-on-wsl2-3o8) ([WSL2](https://learn.microsoft.com/en-us/windows/wsl/install), without Docker Desktop)
|
|
|
|
> For some setups, having `sudo` access may be required.
|
|
|
|
### Docker Compose
|
|
Create a folder somewhere on your server called `netweak-agent`:
|
|
```bash
|
|
mkdir ./netweak-agent
|
|
cd ./netweak-agent
|
|
```
|
|
|
|
Create new files called `docker-compose.yml` and `token.conf`:
|
|
```bash
|
|
touch docker-compose.yml
|
|
touch token.conf
|
|
```
|
|
|
|
In the `docker-compose.yml` file, add the following:
|
|
```yml
|
|
services:
|
|
netweak-agent:
|
|
# For AMD64 Machines:
|
|
image: oci.registry.sudovanilla.org/netweak-agent:amd64
|
|
# For ARM64/V8 Machines:
|
|
# image: oci.registry.sudovanilla.org/netweak-agent:arm64
|
|
restart: always
|
|
container_name: netweak_agent
|
|
volumes:
|
|
- ./token.conf:/etc/netweak/token.conf
|
|
```
|
|
|
|
Run the Docker Pull command to get download the Docker image:
|
|
```
|
|
docker compose pull
|
|
```
|
|
|
|
![Banner](https://md.sudovanilla.org/images/nafd-int-token.png)
|
|
|
|
Now, try adding a new server to your Netweak dashboard and grab the token. The instructions on screen will show a command, you don't need this command for this setup, but you need the randomly generated token that is at the end of the provided command. Copy that and paste it into the `token.conf` file.
|
|
|
|
Once done, click Continue in Netweak.
|
|
|
|
Run the agent:
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
After a few moment, Netweak will detect the agent if you've setup things correctly.
|
|
|
|
## Build
|
|
### Docker
|
|
To build the image, use the Docker Build command line:
|
|
```bash
|
|
docker build -t netweak-agent . -f Dockerfile.default
|
|
```
|
|
> Using `sudo` may be required depending on your setup.
|
|
|
|
### Buildah
|
|
SudoVanilla uses Buildah over Docker Engine to build it's Docker images, since the SudoVanilla Registry is powered by Zot.
|
|
|
|
To build the image, use the Buildah Build command line:
|
|
```bash
|
|
buildah build -t oci.registry.sudovanilla.org/netweak-agent:amd64
|
|
```
|
|
|
|
## Questions and Answers
|
|
**Does this support macOS and Windows?**
|
|
|
|
Yes, by using Docker it does support both of these operating systems. This has been tested successfully on a Mac Mini M2 running macOS 13/14.
|
|
|
|
**It doesn't run on ARM64/v7**
|
|
|
|
SudoVanilla builds it's Docker images on ARM64/v8 and AMD64 only. You'll need to build the image itself on your ARM64/v7 server, which is not too hard to do. Just follow the build instructions.
|
|
|
|
**Can I really trust providing my server's token?**
|
|
|
|
SudoVanilla does not have access to any Docker containers you run on your server and does not have access to your Netweak account.
|
|
|
|
**Metric information is wrong, why is this?**
|
|
|
|
This depends on how Docker is setup, I've not yet looked into correcting this behavior.
|
|
|
|
**CPU information is wrong, why is this?**
|
|
|
|
The CPU may show up as "N/A" on certain machines. A real example is a Mac Mini M2 running Asahi Linux. If you don't want it to show up as "N/A" anymore, switch to the custom Docker image by adding `-custom` before the tag in the image name. The custom build will modify the Agent file to show the CPU model as "Docker Engine".
|
|
|
|
`oci.registry.sudovanilla.org/netweak-agent-custom:amd64`
|
|
|
|
**Why does it say I'm running Debian? I'm not.**
|
|
|
|
This Docker Image is based on slim edition of Debian 12. When the Netweak agent runs in this Docker Image, it will detect this and assume you're using Debian 12. This is expected behavior.
|
|
|
|
https://ark.sudovanilla.org/Korbs/-/packages/container/debian-slim/amd64
|
|
|
|
**Is this an official Docker Image for Netweak?**
|
|
|
|
No, SudoVanilla is not affiliated with Netweak in any way. This is NOT an official Docker image. SudoVanilla is only an enterprise customer of Netweak and wanted to monitor other non-Linux servers.
|
|
|
|
|
|
**How do I uninstall the agent?**
|
|
|
|
In Netweak, skip the uninstall instructions and just delete the server.
|
|
|
|
As for on your server, run:
|
|
```
|
|
cd ./netweak-agent
|
|
docker compose down
|
|
```
|
|
|
|
Then delete the `netweak-agent` folder you created. |