Coder Social home page Coder Social logo

telemetry-opcua-exporter's Introduction

telemetry_opcua_exporter

Server Configuration

info to set in execution flag :

bindAddress := flag.String("bindAddress", ":4242", "Address to listen on for web interface.")
configFile = flag.String("configFile", "opcua.yaml", "Path to configuration file.")
endpoint := flag.String("endpoint", "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer", "OPC UA Endpoint URL")
auth := flag.String("auth-mode", "UserName", "Authentication Mode: one of Anonymous, UserName, Certificate")
verbosity := flag.String("verbosity", "info", "Log verbosity (debug/info/warn/error/fatal)")

To choose policy and mode :

policy := flag.String("sec-policy", "None", "Security Policy URL or one of None, Basic128Rsa15, Basic256, Basic256Sha256")
mode := flag.String("sec-mode", "auto", "Security Mode: one of None, Sign, SignAndEncrypt")

"auto" mode will find the highest security level according to selected endpoint beware that both policy and mode cannot be set to None

If auth is set to "Certificate" are mandatory :

certfile := flag.String("cert", "cert.crt", "Path to certificate file")
keyfile := flag.String("key", "cert.key", "Path to PEM Private Key file")

If auth is set to "UserName" are mandatory :

username := flag.String("user", "admin", "Username to use in auth-mode UserName")
password := flag.String("password", "admin", "Password to use in auth-mode UserName")

Metrics Configuration

metrics configuration should be through yaml file following this pattern :

metrics:
  - name: Temperature   # MANDATORY
    help: get metrics for machine temperature # MANDATORY
    nodeid: ns=2;i=10853 # MANDATORY and UNIQUE for each metric
    labels: # if metrics share the same name they can be distinguis by labels
      site: MLK
    type: gauge # MANDATORY metric type can be counter, gauge, Float, Double
  - name: Temperature
    help: get metrics for machine temperature
    nodeid: ns=2;i=10852
    labels: 
      site: Paris
    type: gauge

Https Routes

show current metrics

curl 127.0.0.1:4242/metrics

show current config

curl 127.0.0.1:4242/config

reload config from opcua.yaml file

curl 127.0.0.1:4242/reload/config

change config from body's request data

curl --request POST \      
  --url 127.0.1:4242/config/update \
  --header 'content-type: x-yaml' \
  --data "metrics:
  - name: plop
    help: plop
    nodeid: ns=2;i=10853
    labels: {}
    type: gauge"

Please take note that it's also rewrite opcua.yaml with the input file

telemetry-opcua-exporter's People

Contributors

ahuret avatar stefanvandyck avatar jbguerraz 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.