Giter VIP home page Giter VIP logo

2jciebu-prometheus's Introduction

2JCIE-BU to Prometheus

Docker Cloud Automated build Docker Cloud Build Status

OMRON USB環境センサ 2JCIE-BUから取得した値を、exporterを通じてPrometheusに投入するスクリプトです。

Dockerコンテナで動作します。

準備

用意するもの

73063

  • 常時稼働させられる端末

raspi

friendryelec

など

手順

udevルール作成

/etc/udev/rules.d/10-2JCIE-BU.rules

ACTION=="add", \
ATTRS{idVendor}=="0590", \
ATTRS{idProduct}=="00d4", \
RUN+="/sbin/modprobe ftdi_sio" \
RUN+="/bin/sh -c 'echo 0590 00d4 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'", \
SYMLINK+="2JCIE-BU"

udevd restart

systemctl udevd restart

2JCIE-BU取付

リポジトリクローン

git clone https://github.com/yasu-hide/2jciebu-prometheus

設定編集

詳細は 設定ファイル (.envファイル) を参照

cd 2jciebu-prometheus
cat <<'EOF' > .env
SENSOR_SERIAL_DEVICE=/dev/ttyUSB0
SERVER_HTTP_PORT=8000
EOF

Dockerコンテナ起動

docker-compose up -d

Enjoy!

設定ファイル (.envファイル)

SENSOR_SERIAL_DEVICE

シリアルポートのデバイスファイルを指定

/dev/ttyUSB0以外を指定する場合、docker-compose.ymlの devices も見直すこと

無指定の場合は /dev/ttyUSB0

SERVER_HTTP_PORT

exporter用HTTPサーバの待ち受けポート番号を指定

無指定の場合は 8000

参考情報

2jciebu-prometheus's People

Contributors

yasu-hide avatar snyk-bot avatar

Watchers

 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.