Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Linux Volume Manager input plugin #9771

Merged
merged 5 commits into from
Sep 21, 2021

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Sep 16, 2021

The Logical Volume Management (LVM) input plugin collects information about
physical volumes, volume groups, and logical volumes. This will only
work on Linux and *BSDs as OS X and Windows do not have support for
these types of disks.

The metrics are broken out into the various LVM types.

Resolves: #345

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in conventional commit format (e.g. feat: or fix:)

The Logical Volume Management (LVM) input plugin collects information about
physical volumes, volume groups, and logical volumes. This will only
work on Linux and *BSDs as OS X and Windows do not have support for
these types of disks.

The metrics are broken out into the various LVM types.
@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin new plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Sep 16, 2021
@sjwang90 sjwang90 mentioned this pull request Sep 20, 2021
2 tasks
Copy link
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, some minor comments.

plugins/inputs/lvm/lvm.go Outdated Show resolved Hide resolved
plugins/inputs/lvm/lvm.go Outdated Show resolved Hide resolved
@powersj
Copy link
Contributor Author

powersj commented Sep 20, 2021

Comments addressed, read for re-review

Copy link
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@powersj powersj merged commit 3eebfd2 into influxdata:master Sep 21, 2021
@powersj powersj deleted the input/lvm branch September 21, 2021 21:51
@rafaelreis-r
Copy link

Hey @powersj !

Just tried using your pluigin on Ubuntu 18.04 and noticed the pvs bin path is hardcoded:

[inputs.lvm] Error in plugin: failed to run command sudo -n /usr/sbin/pvs --reportformat json --units b --nosuffix -o pv_name,vg_name,pv_size,pv_free,pv_used: exit status 1 -

which pvs /sbin/pvs

Could you maybe expand the configuration to allow different paths or use system envs to do so?

@powersj
Copy link
Contributor Author

powersj commented May 17, 2022

@rafaelreis-r please file a bug and it is definitely something we can look at! Thanks!

@c4baceira
Copy link

hello @powersj !

Is this plugin ready to be used by the docker version of Telegraf?

I'm getting:

2022-06-15T15:22:30Z E! [inputs.lvm] Error in plugin: failed to run command /usr/sbin/pvs --reportformat json --units b --nosuffix -o pv_name,vg_name,pv_size,pv_free,pv_used: fork/exec /usr/sbin/pvs: no such file or directory -

Using:

version: '3'

services:

 telegraf:
   image: telegraf
   container_name: telegraf
   restart: always
   volumes:
     - /var/run/docker.sock:/var/run/docker.sock:z
     - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
   links:
     - influxdb
   ports:
     - "8092:8092/udp"
     - "8094:8094"
     - "8125:8125/udp"
   networks:
     - tick
   user: telegraf:118
telegraf --version
Telegraf 1.23.0 (git: HEAD 806dc283)

@powersj
Copy link
Contributor Author

powersj commented Jun 15, 2022

@c4baceira,

The docker image does not contain all the possible dependencies that every plugins would require. If we did, the docker image size would be huge to meet those requirements.

If you want to use this plugin with docer you will need to create a custom image that includes those binaries as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin new plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LVM plugin
4 participants