Visual Dashboard - Grafana Mon: 24hr Docker log > Telegraf > InfluxDB

You could try on Telegraf.conf

precision = "s"

I think you’re currently on nano second. https://docs.influxdata.com/telegraf/v1.11/administration/configuration/#agent-configuration

Also, remove -input-filter exec. The process shouldn’t already be running

Did it - no chance. Read last Post befor yours again and on more above

And here my telegraf.conf

[    agent]
      ## Default data collection interval for all inputs
      interval = "10s"
      ## Rounds collection interval to 'interval'
      ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
      round_interval = true

      ## Telegraf will send metrics to outputs in batches of at most
      ## metric_batch_size metrics.
      ## This controls the size of writes that Telegraf sends to output plugins.
      metric_batch_size = 1000

      ## Maximum number of unwritten metrics per output.
      metric_buffer_limit = 10000

      ## Collection jitter is used to jitter the collection by a random amount.
      ## Each plugin will sleep for a random time within jitter before collecting.
      ## This can be used to avoid many plugins querying things like sysfs at the
      ## same time, which can have a measurable effect on the system.
      collection_jitter = "0s"

      ## Default flushing interval for all outputs. Maximum flush_interval will be
      ## flush_interval + flush_jitter
      flush_interval = "10s"
      ## Jitter the flush interval by a random amount. This is primarily to avoid
      ## large write spikes for users running a large number of telegraf instances.
      ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
      flush_jitter = "0s"

      ## By default or when set to "0s", precision will be set to the same
      ## timestamp order as the collection interval, with the maximum being 1s.
      ##   ie, when interval = "10s", precision will be "1s"
      ##       when interval = "250ms", precision will be "1ms"
      ## Precision will NOT be used for service inputs. It is up to each individual
      ## service input to set the timestamp at the appropriate precision.
      ## Valid time units are "ns", "us" (or "µs"), "ms", "s".
      precision = "s"

      ## If set to true, do no set the "host" tag in the telegraf agent.
      omit_hostname = false


    ###############################################################################
    #                            OUTPUT PLUGINS                                   #
    ###############################################################################


    # Configuration for sending metrics to InfluxDB
    [[outputs.influxdb]]
      ## The full HTTP or UDP URL for your InfluxDB instance.
      ##
      ## Multiple URLs can be specified for a single cluster, only ONE of the
      ## urls will be written to each interval.
      # urls = ["unix:///var/run/influxdb.sock"]
      # urls = ["udp://127.0.0.1:8089"]
    #   urls = ["http://192.168.10.41:8086"]

      ## The target database for metrics; will be created as needed.
      ## For UDP url endpoint database needs to be configured on server side.
       database = "StorJ"
       precision = "s"

    ###############################################################################
    #                            INPUT PLUGINS                                    #
    ###############################################################################


    # Read metrics about cpu usage
    [[inputs.cpu]]
      ## Whether to report per-cpu stats or not
      percpu = true
      ## Whether to report total system cpu stats or not
      totalcpu = true
      ## If true, collect raw CPU time metrics.
      collect_cpu_time = false
      ## If true, compute and report the sum of all non-idle CPU states.
      report_active = false


    # Read metrics about disk usage by mount point
    [[inputs.disk]]
      ## By default stats will be gathered for all mount points.
      ## Set mount_points will restrict the stats to only the specified mount points.
     mount_points = ["/DriveShare"]

      ## Ignore mount points by filesystem type.
      ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]


    # Read metrics about disk IO by device
    [[inputs.diskio]]


    # Get kernel statistics from /proc/stat
    [[inputs.kernel]]
      # no configuration


    # Read metrics about memory usage
    [[inputs.mem]]
      # no configuration


    # Get the number of processes and group them by status
    [[inputs.processes]]
      # no configuration


    # Read metrics about swap memory usage
    [[inputs.swap]]
      # no configuration


    # Read metrics about system load & uptime
    [[inputs.system]]
      ## Uncomment to remove deprecated metrics.
      # fielddrop = ["uptime_format"]


    # # Read metrics about docker containers
    [[inputs.docker]]
    #   ## Docker Endpoint
    #   ##   To use TCP, set endpoint = "tcp://[ip]:[port]"
    #   ##   To use environment variables (ie, docker-machine), set endpoint = "ENV"
       endpoint = "unix:///var/run/docker.sock"
    #
    #   ## Set to true to collect Swarm metrics(desired_replicas, running_replicas)
       gather_services = false
    #
    #   ## Only collect metrics for these containers, collect all if empty
       container_names = []
    #
    #   ## Containers to include and exclude. Globs accepted.
    #   ## Note that an empty array for both will include all containers
       container_name_include = []
       container_name_exclude = []
    #
    #   ## Container states to include and exclude. Globs accepted.
    #   ## When empty only containers in the "running" state will be captured.
    #   # container_state_include = []
    #   # container_state_exclude = []
    #
    #   ## Timeout for docker list, info, and stats commands
       timeout = "5s"
    #
    #   ## Whether to report for each container per-device blkio (8:0, 8:1...) and
    #   ## network (eth0, eth1, ...) stats or not
       perdevice = true
    #   ## Whether to report for each container total blkio and network stats or not
       total = false
    #   ## Which environment variables should we use as a tag
    #   ##tag_env = ["JAVA_HOME", "HEAP_SIZE"]
    #
    #   ## docker labels to include and exclude as tags.  Globs accepted.
    #   ## Note that an empty array for both will include all labels as tags
       docker_label_include = []
       docker_label_exclude = []
    #
    #   ## Optional TLS Config
    #   # tls_ca = "/etc/telegraf/ca.pem"
    #   # tls_cert = "/etc/telegraf/cert.pem"
    #   # tls_key = "/etc/telegraf/key.pem"
    #   ## Use TLS but skip chain & host verification
    #   # insecure_skip_verify = false

    # # Read metrics about network interface usage
    [[inputs.net]]
    #   ## By default, telegraf gathers stats from any up interface (excluding loopback)
    #   ## Setting interfaces will tell it to gather these explicit interfaces,
    #   ## regardless of status.
    #   ##
      interfaces = ["docker0"]
    #   ##
    #   ## On linux systems telegraf also collects protocol stats.
    #   ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
    #   ##
    #   # ignore_protocol_stats = false
    #   ##


    [[inputs.exec]]
       commands = ["/home/juerg/storj_telegraf_mon/successrate.sh" ] #some configs may need "sh " before /
       timeout = "60s" #If you want to run faster than 180s be sure to change this
       interval = "3m" #Comment this out if you already declare it earlier in the config.
       #name_suffix = "_foo" # Will result as "StorjHealth_foo" Uploaded dashboard will not use
       data_format = "influx"

    [[inputs.exec]]
       commands = ["/home/juerg/storj_telegraf_mon/tokens.sh" ] #some configs may need "sh " before /
       timeout = "60s"
       interval = "1h" # if you don't care to track STORJ price, you can increase it to 24h
       data_format = "influx"

    [[inputs.exec]]
       commands = ["/home/juerg/storj_telegraf_mon/folder_size.sh /DriveShare/StorjNode"]
       timeout = "60s"
       interval = "30m"
       data_format = "influx"
    (END)

The only problem I notice at first glance it this item shouldn’t be commented out.

urls = [“http://192.168.10.41:8086”]

And maybe
precision = “1s”

Please continue issue on GitHub if possible.

mby someone can help to set up monitoring for win 10 64bit?

1 Like

I got a good start to the docker-compose package, but it does not work yet. Anyone can check it out and contribute. This could get it working for docker on win10

1 Like

added live tracking for version#

Hi,

are there any kind of brief setup instructions?

docker-compose.yml

- - /mnt/iscsi/StorjV3:/mnt/storjshare:ro
+ - /mnt/storagenode01:/mnt/storjshare:ro

successrate.sh

- CONTAINER_NAME=“storagenode”
+ CONTAINER_NAME=“storagenode01”

telegraf.conf

- # mount_points = ["/"]
+ mount_points = ["/mnt/storagenode01"]

tokens.sh

- WALLET_ADDRESS=“0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF”
+ WALLET_ADDRESS=“0x151…”

- ETHERSCAN_API_KEY=“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”
+ ETHERSCAN_API_KEY=“1VX…”

I’m facing this issue:

root@raspberrypi:~/workspace/storj/storagenode01/storj_telegraf_mon# docker exec -i -t telegraf /bin/bash

root@8c06b76fef3a:/# telegraf --debug --config /etc/telegraf/telegraf.conf --input-filter exec --test
2019-09-14T21:39:12Z I! Starting Telegraf 1.12.1
2019-09-14T21:39:12Z D! [agent] Initializing plugins
2019-09-14T21:39:13Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 3:77: “StorJHealth,NodeId=1UwfLQ GETRepairFail=0,GETRepairSuccess=0,GETRepairRatio=nan,PUTRepairFailed=0,PUTRepairSuccess=0,PUTRepairRatio=nan 1568497153663696339”
> StorJToken,WalletAddress=“0x151…”,host=8c06b76fef3a,stat=tokens BalanceEUR=22.7078,BalanceSTORJ=169.335,BalanceUSD=25.214 1568497155000000000
> StorJToken,host=8c06b76fef3a,stat=prices STORJPriceEUR=0.1341,STORJPriceUSD=0.1489 1568497155000000000
> StorJHealth,host=8c06b76fef3a,path="/mnt/storjshare" directory_size_kilobytes=84392588 1568497155000000000
2019-09-14T21:39:14Z E! [telegraf] Error running agent: One or more input plugins had an error

Thanks

Please use GitHub for issues. Are you trying to use docker-compose? That project is not complete yet, but you can run the script in the host.

HI there, im looking for a guide to setup this dashboard on StorJ. can anyone assist?

Hi FlipSideZA. I’m working on the docker-compose file to do basically a one command install and it’ll be working - however, i have not had a lot of time lately to be able to dedicate to it. But, it’s coming soonTM.

Some basic requirements are
1)TIG Stack (Telegraf, InfluxDB, Grafana)
2) Telegraf config (my github above) collecting from the storj docker and dumping to influxDB (The I in the TIG stack)

The github above is the telegraf portion of the config. The custom TIG Stack is a WIP.

You can try to piece together you own in the meantime from these resources:


2 Likes

Thank you @KernelPanick i will give this a try over the weekend. I have been installing each as its own separate container however TIG stack is one container so no cross container communication is required other than to storagenode which takes a lot of complexity out of it.

hi all, how I can install it on Synology please ?

This looks really good but by now I have mysql, elasticsearch and prometheus for different stuff installed on my server… With this I could add InfluxDB to that list too but I’d rather use prometheus for it. Any chance that is “easily” possible?

You can use prometheus, but you’d have to customize the grafana dashboard to pick up the correct values. That part may be easy if you can convert the telegraf github script to export in an identical Prometheus format.

My instructions above would work the same for Synology, look at the TIG stack for docker. Otherwise please wait for docker-compose full script to completed on gsxryan github.

1 Like

I will wait anxiously. thanks for your work and your time

1 Like

If you want help on dockerization (even testing), let me know. I would like to get this working as well, especially on ARM. I can also help with Doc.

Hi, I tweaked some configs a bit to make it runnable with Windows based dockerhost and container based monitoring TIG stack, feel free to check it out https://github.com/turvas/storj_telegraf_mon

Very cool! Interesting, it doesn’t look like too much was required to get the docker-compose working on windows. I was having permissions issues on ubuntu. One thing i’m missing, what/where is the build-docker-images.bat?