Giter VIP home page Giter VIP logo

check_lxc's People

Contributors

barbuk avatar napsty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

barbuk safly 772424

check_lxc's Issues

Syntax Error after Upgrade

OS: Ubuntu 18.04.1 LTS
LXC: 3.0.2

Check doesn't work since the last updates:

Error:
/usr/lib/nagios/plugins/check_lxc.sh: line 253: + : syntax error: operand expected (error token is "+ ")

Syntax error: operand expected

Hi, I'm running check_lxc on a Proxmox server. I haven't updated the system for some time. But I've updated the Proxmox server today and since then, check_lxc fails:

# LANG=C /usr/local/bin/check_lxc -n 509 -t mem
/usr/local/bin/check_lxc: line 157: 0 * 100 / : syntax error: operand expected (error token is "/ ")

Lines 156 and 157 are:

        limit=$(lxc-cgroup -n ${container} memory.limit_in_bytes)
        used_perc=$(( $used * 100 / $limit))

Unfortunately, lxc-cgroup is returning no result. So this is the reason why check_lxc fails.

But I don't have a clue so far what's wrong with the lxc-cgroup command...

Kind regards,
Bernd

No cgroup entry in /proc/cmdline on Ubuntu

The mem check doesn't work on Ubuntu when the recently added "cgroup_active" is used. Ubuntu seems to have cgroup support enabled by default without having to manually enable it as kernel boot parameter:

./check_lxc.sh -n mylxc -t mem -w 90 -c 93
cgroup is not defined as kernel boot parameter

cmdline does not contain a cgroup entry:

cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.2.0-38-generic root=/dev/mapper/vgroot-lvroot ro

But lxc-cgroup works:

lxc-cgroup -n mylxc memory.memsw.limit_in_bytes
8589934592

Wrong CPU percent

Hi
Host PC have 8 cpus. so i set cpu number 2 in container.
lxc-cgroup -n name cpuset.cpus 2

and i made cpu load 100 % in container. comand is below.
dd if=/dev/zero of=/dev/null

and run the check_lxc.
./check_lxc.sh -n name -t cpu
but result is CPU Usage: 52%.

I think the result should be 100 %..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.