Skip to content

Commit 7333b4f

Browse files
committed
add fd support
1 parent 3a81029 commit 7333b4f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

deployment/node-problem-detector-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ data:
9292
"timeout": "90s",
9393
"max_output_length": 80,
9494
"concurrency": 3,
95-
"enable_message_change_based_condition_update": false
95+
"enable_message_change_based_condition_update": true
9696
},
9797
"source": "fd-custom-plugin-monitor",
9898
"conditions": [
@@ -104,10 +104,11 @@ data:
104104
],
105105
"rules": [
106106
{
107-
"type": "temporary",
108-
"reason": "TooManyOpenFiles",
107+
"type": "permanent",
108+
"condition": "FDPressure",
109+
"reason": "NodeHasFDPressure",
109110
"path": "/config/plugin/check_fd.sh",
110-
"message": "more than 80% fd has been used"
111+
"message": "too many fds have been used"
111112
}
112113
]
113114
}
@@ -125,12 +126,11 @@ data:
125126
count=$(find -maxdepth 1 -type d -name '[0-9]*' | xargs -I {} ls {}/fd | wc -l)
126127
max=$(cat /host/proc/sys/fs/file-max)
127128
128-
echo "current fd is $count and max is $max"
129-
if [[ $count -gt $((max*8/10)) ]]; then
130-
echo "more than 80% fd has been used($count:$max)"
129+
if [[ $count -gt $((max*80/100)) ]]; then
130+
echo "current fd usage is $count and max is $max"
131131
exit $NONOK
132132
fi
133-
echo "fd is ok"
133+
echo "fd usage is ok"
134134
exit $OK
135135
kind: ConfigMap
136136
metadata:

0 commit comments

Comments
 (0)