New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
bash script to monitor OpenVZ containers
Hello,
today on one of my clients server i was searching who loads disk read and write, there was lot of containers so i created small script to monitor it.
By request i can add any type of resource print to putty (even network statistics like mails/s, udp packages, tcp packages, fyn packages, syn packages and so on)
There is the script:
https://github.com/bacarrdy/openvz-monitor
I created it only few hours ago so there can be some bugs, but form me it worked.
This is only example, i cerated it only for disk read/write, but later in few minutes added other resourses like hdd usage, ram usage, cpu usage
Comments
Why are you using vzctl exec? You can easily get resource usage using vzlist.
i can get limits, but not real usage. And i dont know a way to get for example CPU usage with vzlist
Yes with -j option you can extract some values, ill change it for thouse resourses like memory, disk usage, or load averages
Vzlist -j gives you pretty much everything
how i already told i created it for read/write and ill change it to use json output this will save some operations
i have changed it https://github.com/bacarrdy/openvz-monitor/commit/d07261847f61014ba40d3b86f80334ab432bcb5d