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

Extend HOST metrics: CPU util, Disk usage, system uuid #23

Open
MyungChi opened this issue Nov 7, 2018 · 10 comments
Open

Extend HOST metrics: CPU util, Disk usage, system uuid #23

MyungChi opened this issue Nov 7, 2018 · 10 comments

Comments

@MyungChi
Copy link

MyungChi commented Nov 7, 2018

Hi.

Thanks for quick fix and release.
kvmtop is good solution for me. It is very helpful.

I want to ask enhancement of several feature for "--host", If possible.
Would U enhance below feature of package( at least 3 ) ?

  1. "CPU utilization for Host" (cat /proc/stat )
  2. "Disk Usage Info for Host" ( It might be difficult. )
    3. "UUID for Host" ( dmidecode -s system-uuid )
    It might be get as below using "github.com/dselans/dmidecode"
@cha87de
Copy link
Owner

cha87de commented Nov 7, 2018

  1. host cpu utilisation is actually a good idea to integrate, and shouldn't be too hard
  2. is already planned in issue disk utilisation: use proc fs and extend metrics #8
  3. is there an easy way to get the system uuid from the /proc filesystem? The repo you linked simply executes the dmidecode binary, which is not something I want to do in kvmtop. If there is any other simple lookup mechanism to get this value, I am happy to integrate it.

@cha87de cha87de changed the title Add CPU utilization for HOST collection Extend HOST metrics: CPU util, Disk usage, system uuid Nov 7, 2018
@MyungChi
Copy link
Author

MyungChi commented Nov 7, 2018

Hi.

For 3, I don't know how can get uuid from /proc filesystem. I am googling it. almost of code execute cmd to get this value.

@MyungChi
Copy link
Author

MyungChi commented Nov 7, 2018

According to man page for dmidecode. I can read from file "/sys/devices/virtual/dmi/id/product_uuid".

Note: on Linux, most of these strings can alternatively be read directly from sysfs, typically  from  files under /sys/devices/virtual/dmi/id.  Most of these files are even readable by regular users.

@MyungChi
Copy link
Author

MyungChi commented Nov 8, 2018

If possible, I want to release package which is included uuid for host, urgently.

@MyungChi
Copy link
Author

I am trying to build kvmtop. It is showing as below. my system os is CentOS 7.

I'v clone & checked out latest source code in /opt/gopath/ from github.
If add dmidecode is not direction of kvmtop, I need workagound. So, I try to build and test it.

[root@mec-test _builder]# ./build
Sending build context to Docker daemon 3.072 kB
Step 1/8 : FROM ubuntu:18.04
---> ea4c82dcd15a
Step 2/8 : USER root
---> Using cache
---> e352fd9c386d
Step 3/8 : RUN apt-get update && apt-get install -y golang-go
---> Using cache
---> a32ffd46080b
Step 4/8 : VOLUME /opt/gopath
---> Using cache
---> d7b9c8332455
Step 5/8 : WORKDIR /opt/gopath
---> Using cache
---> b04f8a63a3ff
Step 6/8 : ENV GOPATH /opt/gopath
---> Using cache
---> 4a237cc7ed08
Step 7/8 : RUN apt-get install -y libvirt-dev pkg-config libncurses5-dev
---> Using cache
---> 8009cbb308c9
Step 8/8 : CMD go build github.com/cha87de/kvmtop
---> Using cache
---> f16eef18a4f2
Successfully built f16eef18a4f2
start build ...
can't load package: package github.com/cha87de/kvmtop: no Go files in /opt/gopath/src/github.com/cha87de/kvmtop
[root@mec-test _builder]# ls /opt/gopath/src/github.com/cha87de/kvmtop/
_builder/ config/ docs/ LICENSE README.md util/
cmd/ connector/ .git/ models/ runners/
collectors/ Dockerfile .goreleaser.yml printers/ .travis.yml
[root@mec-test _builder]# pwd
/opt/gopath/src/github.com/cha87de/kvmtop/_builder
[root@mec-test _builder]# echo $GOPATH
/opt/gopath

@cha87de
Copy link
Owner

cha87de commented Nov 12, 2018

@MyungChi absolutely, contributions are welcome, I would be happy to include pull requests!

For developing it is not necessary to build the binary with the scripts in the _builder folder. You can just follow these commands: https://github.com/cha87de/kvmtop/blob/master/README.md#development-guide

@cha87de
Copy link
Owner

cha87de commented Nov 12, 2018

ca1190e now implements kvmtop with uuid if you specify --host --verbose. I put it in verbose mode, since it requires root privileges to read the uuid from the /sys file system. To avoid a release with only one commit, please either build it by yourself or use the binary from the docker image cha87de/kvmtop:master.

With "Disk Usage Info for Host" do you mean space allocation, or I/O (which is already implemented)?

@MyungChi
Copy link
Author

Disk Usage info for Host means space allocation for each partition.

@MyungChi
Copy link
Author

MyungChi commented Nov 13, 2018 via email

@cha87de
Copy link
Owner

cha87de commented Jun 3, 2019

cpu util for host is added in e314bd5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants