timdaman / check_docker

Nagios plugin to check docker containers
GNU General Public License v3.0
152 stars 60 forks source link

Greater than 100% CPU utilization is not documented #73

Open SmitaPatankar opened 4 years ago

SmitaPatankar commented 4 years ago

Steps to Reproduce:

My Setup:

Output at times, initially:

CRITICAL: {containername} cpu is 103%
|{containername}_cpu=103;80;95;0;100

Reason behind the output:
It seems that when CPU utilization exceeds the limit slightly, it gets under control i.e. there is some margin.

Additional logs:

docker inspect {containername}|grep -i cpu
            "CpuShares": 0,
            "NanoCpus": 0,
            "CpuPeriod": 100000,
            "CpuQuota": 75000,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "CpuCount": 0,
            "CpuPercent": 0,

Issue: The documentation(README file) only talks about the values from 0-100, not beyond that.
In this case, we should ideally set the warning:critical to something like 110:125 instead.

timdaman commented 4 years ago

Hmm, that is an issue I had not considered. Thanks for sharing.

I just want to ensure my change makes sense to you. All I am doing is updating the help string and documentation to remove the suggestion of a 0-100% range. That seems like it should be enough as well as being a bit more accurate since I do allow values bigger than 100.

Does that sound right to you?

SmitaPatankar commented 4 years ago

Yes, sounds good. Thanks.