Check file-descriptors

Overview

Checks the number of assigned file handles in percent. Also shows the top 3 processes that currently have the highest number of open file descriptors (not cumulative). Depending on the user (e.g. running as icinga), sudo (sudoers) is needed.

Fact Sheet

Check Plugin Download

https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/file-descriptors

Check Interval Recommendation

Once a minute

Can be called without parameters

Yes

Available for

Python 2, Python 3

Requirements

Python module psutil

Help

usage: file-descriptors [-h] [-V] [--always-ok] [-c CRIT] [-w WARN]

Checks the number of allocated file handles in percent.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  --always-ok           Always returns OK.
  -c CRIT, --critical CRIT
                        Set the critical threshold for file descriptor usage
                        (in percent). Default: 95
  -w WARN, --warning WARN
                        Set the warning threshold for file descriptor usage
                        (in percent). Default: 90

Usage Examples

./file-descriptors --warning 90 --critical 95

Output:

2.2% file descriptors used (2.1K/94.1K)

Top3 processes opening file descriptors:
1. mongod: 183 FD
2. master: 91 FD
3. mariadbd: 75 FD

States

  • WARN or CRIT if usage of file descriptors in % is above a given threshold.

Perfdata / Metrics

  • File descriptors (%)

Credits, License