All Projects → Napsty → check_lxc

Napsty / check_lxc

Licence: GPL-2.0 license
Monitoring plugin to check LXC (Linux Container)

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to check lxc

check zpools
Monitor the usage and status of ZFS Pools (zpools)
Stars: ✭ 16 (+23.08%)
Mutual labels:  nagios-plugins, monitoring-plugins
icp-ce-on-linux-containers
Multi node IBM Cloud Private Community Edition 3.2.x w/ Kubernetes 1.13.5 in a Box. Terraform, Packer and BASH based Infrastructure as Code script sets up a multi node LXD cluster, installs ICP-CE and clis on a metal or VM Ubuntu 18.04 host.
Stars: ✭ 52 (+300%)
Mutual labels:  lxc, linux-containers
netapp-cdot-nagios
Nagios-Checks for monitoring NetApp cDOT-Systems via NetApp Perl API
Stars: ✭ 40 (+207.69%)
Mutual labels:  nagios-plugins, monitoring-plugins
harbour-containers
A Linux containers manager for SailfishOS
Stars: ✭ 30 (+130.77%)
Mutual labels:  lxc, lxc-containers
nagios-plugins-openshift
Nagios/Icinga 2 Plugins for monitoring OpenShift clusters
Stars: ✭ 24 (+84.62%)
Mutual labels:  nagios-plugins, monitoring-plugins
check netapp ontap
🍀 Check NetApp Ontap 🍀
Stars: ✭ 38 (+192.31%)
Mutual labels:  nagios-plugins, monitoring-plugins
Ansible Lxc
Ansible Connection Plugin for lxc containers (https://linuxcontainers.org/)
Stars: ✭ 18 (+38.46%)
Mutual labels:  lxc
Lxdhub
Display, search and copy LXD images using a web interface.
Stars: ✭ 122 (+838.46%)
Mutual labels:  lxc
Piston
A high performance general purpose code execution engine.
Stars: ✭ 658 (+4961.54%)
Mutual labels:  lxc
Lxcfs
FUSE filesystem for LXC
Stars: ✭ 602 (+4530.77%)
Mutual labels:  lxc
Proxmox
Proxmox Helper Scripts
Stars: ✭ 3,882 (+29761.54%)
Mutual labels:  lxc
Distrobuilder
System container image builder for LXC and LXD
Stars: ✭ 211 (+1523.08%)
Mutual labels:  lxc
Yahm
Yet Another Homematic Management - Skripte zur Einrichtung der Homematic CCU Oberfläche in einem LXC Container unter Debian Jessie auf ARM CPU (z.B.: Raspberry Pi & Co)
Stars: ✭ 113 (+769.23%)
Mutual labels:  lxc
Lxc Pkg Ubuntu
LXC Ubuntu packaging
Stars: ✭ 11 (-15.38%)
Mutual labels:  lxc
Cv4pve Autosnap
Automatic snapshot tool for Proxmox VE
Stars: ✭ 123 (+846.15%)
Mutual labels:  lxc
Cv4pve Api Java
Proxmox VE Client API JAVA
Stars: ✭ 17 (+30.77%)
Mutual labels:  lxc
Lxc Web Panel
LXC Web Panel improved for lxc 1.0+
Stars: ✭ 223 (+1615.38%)
Mutual labels:  lxc
Amicontained
Container introspection tool. Find out what container runtime is being used as well as features available.
Stars: ✭ 638 (+4807.69%)
Mutual labels:  lxc
Lxc Ci
LXC continuous integration and build scripts
Stars: ✭ 110 (+746.15%)
Mutual labels:  lxc
Node Libvirt
libvirt bindings for google v8 javascript engine (nodejs addon)
Stars: ✭ 162 (+1146.15%)
Mutual labels:  lxc

check_lxc

Monitoring plugin to check LXC (Linux Container)

Full documentation: https://www.claudiokuenzler.com/monitoring-plugins/check_lxc.php

Usage

sudo ./check_lxc.sh -n container -t type [-u unit] [-w warning] [-c critical]

sudo needed

check_lxc.sh requires to be run with root privileges because certain commands within the plugin require elevated permissions. Therefore create an entry in /etc/sudoers similar to this (adapt to your own environment):

nagios          ALL = NOPASSWD: /usr/lib/nagios/plugins/check_lxc.sh

If you use NRPE, the corresponding command definition could look like this:

command[check_lxc]=sudo /usr/lib/nagios/plugins/check_lxc.sh -n $ARG1$ -t $ARG2$

Options and check types explained

Options:
    -n name of container (or ALL for some types)
    -t type to check (see list below)
    [-u unit of output values (k|m|g)]
    [-w warning threshold] (makes only sense if limit is set in lxc config)
    [-c critical threshold] (makes only sense if limit is set in lxc config)
    [-s sleep in seconds between cpu checks]
    
Types:
    mem -> Check the memory usage of the given container (thresholds in percent)
    swap -> Check the swap usage (thresholds in MB)
    cpu -> Check cpu usage (percentage) of a container (thresholds in percent)
    auto -> Check autostart of container (-n ALL possible)

Examples (container name: lxctest01)

./check_lxc.sh -n lxctest01 -t mem 
LXC lxctest01 OK - Used Memory: 96 MB|mem_used=100941824B;0;0;0;

./check_lxc.sh -n lxctest01 -t mem -w 2 -c 54 
LXC lxctest01 WARNING - Used Memory: 2% (97 MB)|mem_used=101982208B;0;0;0;4294967296

./check_lxc.sh -n lxctest01 -t mem -w 85 -c 95 -u k
LXC lxctest01 OK - Used Memory: 2% (98600 KB)|mem_used=100966400B;0;0;0;4294967296

./check_lxc.sh -n ALL -t auto 
LXC AUTOSTART CRITICAL: lxctest01

./check_lxc.sh -n lxctest01 -t swap -w 50 -c 70
LXC lxctest01 CRITICAL - Used Swap: 81 MB|swap=85680128B;52428800;73400320;0;0

./check_lxc.sh -n lxctest01 -t cpu -w 80 -c 90
LXC lxctest01 OK - CPU Usage: 27%|cpu=27%;80;90;0;0

Enable cgroup memory for memory check

To be able to run the memory check (-t mem), the cgroup subsys "memory" must be enabled. You can verify this manually by running:

cat /proc/cgroups | grep memory

If the first value is not enabled (0), then add the following options as your kernel boot parameter: "cgroup_enable=memory" and "swapaccount=1". In Debian this can be done by modifying /etc/default/grub2 followed by a update of the grub2 and reboot:

# cat /etc/default/grub | grep CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1"

update-grub2
reboot

Then verify if you can get the memory statistics of a container:

lxc-cgroup -n lxctest01 memory.stat
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].