Skip to content

Commit 94e92bb

Browse files
authored
Merge pull request #4 from ringtail/master
change file count
2 parents 3d272bc + b9f677b commit 94e92bb

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

deployment/node-problem-detector-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ data:
8888
{
8989
"plugin": "custom",
9090
"pluginConfig": {
91-
"invoke_interval": "300s",
92-
"timeout": "120s",
91+
"invoke_interval": "30s",
92+
"timeout": "15s",
9393
"max_output_length": 80,
9494
"concurrency": 3,
9595
"enable_message_change_based_condition_update": false
@@ -121,18 +121,13 @@ data:
121121
UNKNOWN=2
122122
123123
cd /host/proc
124-
sum=0
125-
for pid in [0-9]*
126-
do
127-
sum=$(($sum+$(ls /host/proc/$pid/fd/ | wc -l)))
128-
done
129124
130-
count=$(sum)
125+
count=$(find -maxdepth 1 -type d -name '[0-9]*' | xargs -I {} ls {}/fd | wc -l)
131126
max=$(cat /host/proc/sys/fs/file-max)
132127
133128
echo "current fd is $count and max is $max"
134129
if [[ $count -gt $((max*8/10)) ]]; then
135-
echo "more than 80% fd has been used($count:$max)"
130+
echo "more than 80% fd has been used($count:$max)"
136131
exit $NONOK
137132
fi
138133
echo "fd is ok"

0 commit comments

Comments
 (0)