1.6 KiB
Octonet Exporter
This is a Java application that exports metrics from a Digital Devices OctopusNET to Prometheus.
How to run?
Option 1: Using Maven
This requires an installed Java Development Kit (JDK) version 17 or higher.
Set the OCTONET_IP environment variable to the IP address of your OctopusNET device and run the application using mvn exec:java.
Option 2: Using the precompiled binary
This requires an installed Java Runtime Environment (JRE) version 17 or higher.
There's a pre-built binary supplied in the download archive. You can use this by setting the OCTONET_IP environment variable to the IP address of your OctopusNET device and then run the application using java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar.
HINT: If you're using a Unix-based system like macOS or Linux, you can manipulate the environment variables non-permanently on the fly by using something like OCTONET_IP=172.20.20.121 java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar
Option 3 (recommended): Using Docker or Podman
Use the provided Dockerfile to build a container and run this application in Docker or Podman. Don't forget to supply an -e OCTONET_IP=<your_octonet_ip> to the container.
For example:
docker build -t octonet-exporter .
docker run -d -p 9401:9401 -e OCTONET_IP=172.20.20.121 octonet-exporter
How to compile a binary?
To compile a binary, run mvn clean compile assembly:single in the project directory. This will create a JAR file in the target directory that you can run using java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar.