hyperic / sigar

System Information Gatherer And Reporter
http://sigar.hyperic.com/
Apache License 2.0
1.52k stars 503 forks source link

Does sigar support monitoring in docker #107

Open grubbyhou opened 7 years ago

grubbyhou commented 7 years ago

I nead to run java program in docker @AlexYaruki

hiergiltdiestfu commented 7 years ago

Shouldn't be a problem as long as the OS you're running inside your container is supported by Sigar.

xuleiorray commented 7 years ago

I have try again ,sigar can not collect data ,such as cpu usage ,mem status from docker container ,but the data set collected are belong to the machine holds the docker.

is there any way to solve this problem ? any advice is welcome!

xuleiorray commented 7 years ago

@hiergiltdiestfu there isnt any stain encontered when run sigar on docker, but it collect the data set is not from docker's but is from holder's, i need collect the information from docker

hiergiltdiestfu commented 7 years ago

If I recall correctly, Docker isn't pulling up a true VM, but shepherds all its containers' contents on the host machine. So there is no virtual machine involved which could be interrogated, everything runs on the host, even if in the isolation of a container..

This appears to be a slightly separate problem from the original question?

xuleiorray commented 7 years ago

@hiergiltdiestfu Thanks for your explaination,Ive got it, I wanna kown how to calculate the cpu,mem,net applications on the docker consume, do u have any other solutions?

hiergiltdiestfu commented 7 years ago

Check out the cli tools docker brings along: https://docs.docker.com/engine/reference/commandline/stats/ -- you'll need some kind of script in the host context. This is outside Sigar's scope tho.

xuleiorray commented 7 years ago

@hiergiltdiestfu OK, Thanks alot ,I ve find one way to solve, just like you provided.