|
2 | 2 | # check-container-stats |
3 | 3 |
|
4 | 4 | ## About |
5 | | -* this repository contains a collection of Icinga / Nagios plugins to check Docker / PodMan containers |
6 | | -* Written for python3 |
7 | | -* Only requires standard python modules, no additional dependencies |
8 | | -* To be executed i.e. via NRPE on the container host, uses the local "docker"/"podman" binary to query container metrics |
| 5 | +- this repository contains a collection of Icinga / Nagios plugins to check Docker / PodMan containers |
| 6 | +- Written for python3 |
| 7 | +- Only requires standard python modules, no additional dependencies |
| 8 | +- To be executed i.e. via NRPE on the container host |
| 9 | + - Uses local Docker daemon socket file to query Docker |
| 10 | + - Uses `podman`-binary to query PodMan |
9 | 11 |
|
10 | | -## Documentation |
11 | | - |
12 | | -### Usage example |
13 | | - |
14 | | -```bash |
15 | | -# default usage |
16 | | -./check_container_stats_docker.py -c containername |
17 | | -OK - containername (b343972b5de9) is Up 3 days - CPU: 8.65%, Memory: 10.62 GiB, PIDs: 304 | cpu=8.65%;;;; pids=304;;;; mem=11403138171B;;;;33565169418 net_send=2570000000B;;;; net_recv=2750000000B;;;; disk_read=1580000000B;;;; disk_write=3760000000B;;;; |
18 | | - |
19 | | -# With custom socket file location (i.e. for rootless docker or multiple instances of docker daemon on one host) |
20 | | -./check_container_stats_docker.py -c containername --socket 'unix:///run/user/1000/docker.sock' |
21 | | - |
22 | | -# Search for a container that matches *<containername>* (default is to only search for exact matches) |
23 | | -./check_container_stats_docker.py -c containername --wildcard |
24 | | -``` |
25 | | - |
26 | | -### Usage |
27 | | -``` |
28 | | -usage: check_container_stats_docker.py [-h] -c CONTAINER_NAME [-t TIMEOUT] |
29 | | - [-s SOCKET] [--wildcard] |
30 | | - [--cpuwarn CPUWARN] [--cpucrit CPUCRIT] |
31 | | - [--memwarn MEMWARN] [--memcrit MEMCRIT] |
32 | | - [--pidwarn PIDWARN] [--pidcrit PIDCRIT] |
33 | | -
|
34 | | -Icinga/Nagios plugin which checks health and statistics of a Container |
35 | | -
|
36 | | -optional arguments: |
37 | | - -h, --help show this help message and exit |
38 | | - -c CONTAINER_NAME, --container CONTAINER_NAME |
39 | | - Name of the Container which should be checked |
40 | | - -t TIMEOUT, --timeout TIMEOUT |
41 | | - timeout in seconds |
42 | | - -s SOCKET, --socket SOCKET |
43 | | - Path to Docker socket, sets environment variable |
44 | | - DOCKER_HOST |
45 | | - --wildcard --container is a wildcard, not an exact match |
46 | | -
|
47 | | -Thresholds: |
48 | | - --cpuwarn CPUWARN warning threshold for CPU usage (in %) |
49 | | - --cpucrit CPUCRIT critical threshold for CPU usage (in %) |
50 | | - --memwarn MEMWARN warning threshold for memory usage (in Bytes) |
51 | | - --memcrit MEMCRIT critical threshold for memory usage (in Bytes) |
52 | | - --pidwarn PIDWARN warning threshold for number of processes in container |
53 | | - --pidcrit PIDCRIT critical threshold for number of processes in |
54 | | - container |
55 | | -``` |
56 | | - |
57 | | - |
58 | | - |
| 12 | +## Documentation / plugins |
59 | 13 |
|
| 14 | +- [check_container_stats_docker.py](docs/check_container_stats_docker.md) : check state & metrics of a single Docker container |
| 15 | +- [check_docker_system.py](docs/check_docker_system.md) : check metrics of a Docker daemon |
| 16 | +- [check_container_stats_podman.py](docs/check_container_stats_podman.md): check state & metrics of a single PodMan container |
60 | 17 |
|
61 | 18 | ## Contributing |
62 | | -* You're welcome to open issues or pull requests |
| 19 | +- You're welcome to open issues or pull requests |
63 | 20 |
|
0 commit comments