Code Monkey home page Code Monkey logo

fronius-exporter's Introduction

Fronius Exporter

Build Maintainability Tests Releases License

About

Scrapes a Fronius Photovoltaic power installation and converts sensor data to Prometheus metrics. It has been tested with Fronius Symo 8.2-3-M (Software version 3.14.1-10).

Grafana

Installing

Binary

  1. Download latest binary from the Releases page

  2. chmod +x fronius-exporter && mv fronius-exporter /usr/local/bin/

Package

Comes with systemd unit file.

  1. Download latest package from the Releases page

  2. sudo dpkg -i fronius-exporter_linux_amd64.deb (Debian/Ubuntu)

  3. sudo rpm -i fronius-exporter_linux_amd64.rpm (CentOS)

  4. sudo systemctl daemon-reload

  5. Edit the settings in /etc/default/fronius-exporter

  6. sudo systemctl enable fronius-exporter

  7. sudo systemctl restart fronius-exporter

Docker

  1. docker run -d --name fronius-exporter -p "8080:8080" ghcr.io/ccremer/fronius-exporter --help

Helm Chart

  1. helm repo add ccremer https://ccremer.github.io/charts

  2. helm install fronius ccremer/fronius-exporter

Usage

fronius-exporter --symo.url http://symo.ip.or.hostname

Upon each call to /metrics, the exporter will do a GET request on the given URL, and translate the JSON response to Prometheus metrics format.

Configuration

fronius-exporter can be configured with CLI flags. Call the binary with --help to get a list of options.

πŸ’‘

All flags are also configurable with Environment variables.

  • Replace the - char with _ in the names and uppercase the names

  • Replace the . delimiter with __

  • CLI flags take precedence

Following calls are equivalent
fronius-exporter --symo.url http://...
SYMO__URL=http://... fronius-exporter

As a client API

See Example

Developing

Requirements

  • Go

  • Docker

Building

Run make help to see available goals

Platform related builds are handled by goreleaser:

export GOOS=linux
export GOARCH=arm64
export IMAGE_REPOSITORY=ccremer/fronius-exporter
goreleaser build --snapshot --rm-dist --single-target

On the other hand you can also use the actual make build in combination with docker buildx

export GOOS=linux
export GOARCH=arm64
export IMAGE_REPOSITORY=ccremer/fronius-exporter

make build
# you now have a binary with arm64 arch

docker buildx build --platform linux/arm64 -t $IMAGE_REPOSITORY --push .

Test metrics

If you don’t have a Symo device at hand, you can fake one:

# In its own terminal
python3 -m http.server 8081

# In another terminal
go run . -v --symo.url http://localhost:8081/pkg/fronius/testdata/example_1.json

# Yet another terminal or browser
curl -L http://localhost:8080/metrics

fronius-exporter's People

Contributors

ccremer avatar renovate-bot avatar renovate[bot] avatar mabunixda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.