Git Product home page Git Product logo

lmsensorsbeat's Introduction

Lmsensorsbeat

Welcome to Lmsensorsbeat. This Beat strives to pull data from lm-sensors so that you can monitor a variety of I2C/SMBus sensors, such as CPU/motherboard temperatures, fan speeds, voltages, etc. To run this, you may need to:

  1. Install the lm-sensors library and headers (e.g. libsensors4-dev) for your distribution
  2. Load (modprobe) various kernel modules for your sensors if you don't already. Once you install lm-sensors, you can usually do this automatically by running the "sensors-detect" command

Ensure that this folder is at the following location: ${GOPATH}/github.com/eskibars

Getting Started with Lmsensorsbeat

Init Project

To get running with Lmsensorsbeat, run the following commands:

glide update --no-recursive
make update

To push Lmsensorsbeat in the git repository, run the following commands:

git init
git add .
git commit
git remote set-url origin https://github.com/eskibars/lmsensorsbeat
git push origin master

For further development, check out the beat developer guide.

Build

To build the binary for Lmsensorsbeat run the command below. This will generate a binary in the same directory with the name lmsensorsbeat.

make

Run

To run Lmsensorsbeat with debugging output enabled, run:

./lmsensorsbeat -c lmsensorsbeat.yml -e -d "*"

Test

To test Lmsensorsbeat, run the following commands:

make testsuite

alternatively:

make unit-tests
make system-tests
make integration-tests
make coverage-report

The test coverage is reported in the folder ./build/coverage/

Update

Each beat has a template for the mapping in elasticsearch and a documentation for the fields which is automatically generated based on etc/fields.yml. To generate etc/lmsensorsbeat.template.json and etc/lmsensorsbeat.asciidoc

make update

Cleanup

To clean Lmsensorsbeat source code, run the following commands:

make fmt
make simplify

To clean up the build directory and generated artifacts, run:

make clean

Clone

To clone Lmsensorsbeat from the git repository, run the following commands:

mkdir -p ${GOPATH}/github.com/eskibars
cd ${GOPATH}/github.com/eskibars
git clone https://github.com/eskibars/lmsensorsbeat

For further development, check out the beat developer guide.

lmsensorsbeat's People

Contributors

eskibars avatar jakommo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lmsensorsbeat's Issues

Sensor names are not unique

I have this running but the resulting document is kind of useless as the sensor names are not unique.
Output of sensors command on that machine looks like this:

# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +105.0°C)
temp2:        +29.8°C  (crit = +105.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +51.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:         +48.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:         +48.0°C  (high = +100.0°C, crit = +100.0°C)

nct6776-isa-0a00
Adapter: ISA adapter
Vcore:          +1.74 V  (min =  +0.00 V, max =  +1.74 V)
in1:            +1.35 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:           +3.34 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:          +3.33 V  (min =  +2.98 V, max =  +3.63 V)
in4:            +1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:            +0.00 V  (min =  +0.00 V, max =  +0.00 V)
3VSB:           +3.31 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:           +3.18 V  (min =  +2.70 V, max =  +3.63 V)
fan1:             0 RPM  (min =    0 RPM)  ALARM
fan2:          3698 RPM  (min =    0 RPM)  ALARM
fan3:             0 RPM  (min =    0 RPM)  ALARM
SYSTIN:        +123.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = CPU diode
CPUTIN:         +45.5°C  (high = +80.0°C, hyst = +75.0°C)  sensor = CPU diode
AUXTIN:         +49.5°C    sensor = CPU diode
PECI Agent 0:   +51.0°C  (high = +80.0°C, hyst = +75.0°C)
PCH_CHIP_TEMP:   +0.0°C  (high = +80.0°C, hyst = +75.0°C)
PECI Agent 1:    +0.0°C  (high = +80.0°C, hyst = +75.0°C)
cpu0_vid:      +0.000 V
intrusion0:    ALARM
intrusion1:    ALARM

Resulting in the following document:

  {
  "temp1": 27.8
},
{
  "temp2": 29.8
},
{
  "temp1": 51
},
{
  "temp2": 49
},
{
  "temp3": 48
},
{
  "in0": 1.72
},
{
  "in1": 1.344
},
{
  "in2": 3.328
},
{
  "in3": 3.328
},
{
  "in4": 1.008
},
{
  "in5": 0
},
{
  "in7": 3.312
},
{
  "in8": 3.184
},
{
  "fan1": 0
},
{
  "fan2": 3698
},
{
  "fan3": 0
},
{
  "temp1": 123
},
{
  "temp2": 45
},
{
  "temp3": 48.5
},
{
  "temp6": 51
},
{
  "temp7": 0
},
{
  "temp8": 0
},
{
  "cpu0_vid": 0
},
{
  "intrusion0": 1
},
{
  "intrusion1": 1
}

As you can see there are several fields with the same name in the same doc, representing different sensors. This makes it impossible to use Kibana on this.
E.g. temp1 is 3 times in that doc, making it impossible to use this.
It would be nice to have unique names. One of the temp1 fields seems to be SYSTIN: +123.0°C in the shell sensors output.
Thoughts on this:

  • Use the name as reported by the sensors command.
  • Structure the sensor values under the name of the sensor, e.g. acpitz-virtual-0.temp1, nct6776-isa-0a00.fan2

dual socket temperature readings

I have two sockets reporting readings in lmsensor but lmsensors only picks up one of them. Is there support to get readings for both cpus?

update dependencies and test against Elasticsearch 6.x

Probably more than a few breaking changes in there, one might be the Application/Json strict content type header requirement.

With the current code, you'll see:

2018/04/04 06:35:07.595267 client.go:131: ERR Failed to perform any bulk index operations: 406 Not Acceptable
2018/04/04 06:35:07.595289 single.go:78: INFO Error publishing events (retrying): 406 Not Acceptable
2018/04/04 06:35:07.595314 single.go:142: INFO send fail

Build not working: etc/beat.yml missing

@eskibars thanks for creating this Beat. I was playing around with execbeat to achieve this until I realized there is a dedicated lmsensors beat. 😄

Trying to build this following the README instructions, results in the following error:

jakommo@es-jre ../src/github.com/eskibars/lmsensorsbeat (git)-[master] % glide update --no-recursive
[WARN] The name listed in the config file (.) does not match the current location (github.com/eskibars/lmsensorsbeat)
[INFO] Downloading dependencies. Please wait...
[INFO] Fetching updates for github.com/elastic/beats.
[INFO] Setting version for github.com/elastic/beats to ae30528774fffa5879392388f651286785118d38.
[WARN] Skipping lockfile generation because full dependency tree is not being calculated
jakommo@es-jre ../src/github.com/eskibars/lmsensorsbeat (git)-[master] % make update
bash ./vendor/github.com/elastic/beats/libbeat/scripts/update.sh lmsensorsbeat github.com/eskibars/lmsensorsbeat ./vendor/github.com/elastic/beats/libbeat
Beat name: lmsensorsbeat
Beat path: ../lmsensorsbeat
Start modifying beat
Update config file
cat: etc/beat.yml: No such file or directory
Update fields
Traceback (most recent call last):
  File "./vendor/github.com/elastic/beats/libbeat/scripts/generate_fields_docs.py", line 118, in <module>
    input = open(beat_path + "/etc/fields.yml", 'r')
IOError: [Errno 2] No such file or directory: '/home/jakommo/go/src/github.com/eskibars/lmsensorsbeat/etc/fields.yml'
make: *** [update] Error 1

Cant find beat.yml in the repo, should it be lmsensorsbeat.yml?

Redo document structure to work better with kibana

Looking at the data produces by this beat in kibana, I get the following warning:
selection_146

Because of #4 I'm not able to verify if this is really causing issues or if it is just a warning that can be ignored.

Would it be possible to use another structure for these docs, instead of pushing everything into one array?

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.