Created
May 7, 2015 01:40
-
-
Save mlandauer/5d0a0725fe2232c4fd6a to your computer and use it in GitHub Desktop.
Monitor number of open file handles for a process over time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Provide pid of process for which you want to monitor the number of file handles | |
# You probably want to use it somewhat like this | |
# ./file_handle_mon.sh 1877 | tee file_handle_mon.out | |
while [ 1 ] | |
do | |
number=$(lsof -p $1 | wc -l) | |
date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
echo "$date,$number" | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment