Add open file descriptor monitoring (#5655) (#5656)

automerge
This commit is contained in:
mergify[bot]
2019-08-26 15:44:47 -07:00
committed by Grimes
parent a86dc44c96
commit fe419db5b4
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