Giter VIP home page Giter VIP logo

raspberrypi-temperature-telegraf's Introduction

raspberrypi-temperature-telegraf

Collect RaspberryPi CPU and GPU temperature with telegraf

How to use (No script required ๐Ÿ”ฅ)

  1. Locate vcgencmd binary by executing shell command /usr/bin/which vcgencmd. Location may vary depending on libraspberrypi-bin package version.
  2. Before adding this to your telegraf.conf, replace replace_with_vcgencmd_location with real path returned in previous step. (ex./usr/bin/vcgencmd).
[[inputs.file]] 
  files = ["/sys/class/thermal/thermal_zone0/temp"]
  name_override = "cpu_temperature"
  data_format = "value"
  data_type = "integer"
  
[[inputs.exec]]
  commands = [ "replace_with_vcgencmd_location measure_temp" ]
  name_override = "gpu_temperature"
  data_format = "grok"
  grok_patterns = ["%{NUMBER:value:float}"]
  1. Add telegraf user to video group sudo usermod -a -G video telegraf
  2. sudo service telegraf stop;sudo service telegraf start
  3. Run test telegraf -config /etc/telegraf/telegraf.conf -test

How to use (Old way)

  1. Copy telegraf_pi_temp.sh to /usr/local/bin/telegraf_pi_temp.sh
  2. Modify file permissions chmod +x /usr/local/bin/telegraf_pi_temp.sh
  3. Add telegraf user to video group sudo usermod -a -G video telegraf
  4. sudo service telegraf restart or sudo reboot
  5. Add to your telegraf.conf snippet from telegraf.conf
  6. Run test telegraf -config /etc/telegraf/telegraf.conf -test

Data format

To get a human readable cpu temperature divide it by 1000 (in grafana use the math(/ 1000) function

{"cpu":54768, "gpu":54.8}

raspberrypi-temperature-telegraf's People

Contributors

krikk avatar themickeymike avatar webermax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

raspberrypi-temperature-telegraf's Issues

use -a flag for usermod

Hi, thanks for sharing your work! โค๏ธ

You should add the -a flag to the usermod command.
As it is now, it would remove telegraf from all other groups.

sudo usermod -a -G video telegraf

I have telegraf also assigned to the docker and unbound group, your original command would remove it from those.

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.