Add open file descriptor monitoring (#5655)

This commit is contained in:
Michael Vines
2019-08-26 15:17:19 -07:00
committed by GitHub
parent 6979a17674
commit 81bb208a62
6 changed files with 196 additions and 18 deletions

20
scripts/fd-monitor.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Reports open file descriptors for the current user
#
set -e
[[ $(uname) == Linux ]] || exit 0
cd "$(dirname "$0")"
# shellcheck source=scripts/configure-metrics.sh
source configure-metrics.sh
while true; do
count=$(lsof -u $UID | wc -l)
./metrics-write-datapoint.sh "open-files,hostname=$HOSTNAME count=$count"
sleep 10
done
exit 1