File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 66NONOK=1
77UNKNOWN=2
88
9- which lsof > /dev/null
10- if [ $? -ne 0 ]; then
11- echo " lsof is not support"
12- exit $UNKNOWN
13- fi
9+ cd /host/proc
1410
15- count=$( lsof | wc -l)
16- max=$( cat /proc/sys/fs/file-max)
11+ count=$( find -maxdepth 1 -type d -name ' [0-9]* ' | xargs -I {} ls {}/fd | wc -l)
12+ max=$( cat /host/ proc/sys/fs/file-max)
1713
18- echo " current fd is $count and max is $max "
19- if [[ $count -gt $(( max* 8 / 10 )) ]]; then
20- echo " more than 80 percent of fd has been used($count :$max )"
14+ if [[ $count -gt $(( max* 80 / 100 )) ]]; then
15+ echo " current fd usage is $count and max is $max "
2116 exit $NONOK
2217fi
23- echo " fd is ok "
24- exit $OK
18+ echo " node has no fd pressure "
19+ exit $OK
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ data:
130130 echo "current fd usage is $count and max is $max"
131131 exit $NONOK
132132 fi
133- echo "fd usage is ok "
133+ echo "node has no fd pressure "
134134 exit $OK
135135kind : ConfigMap
136136metadata :
You can’t perform that action at this time.
0 commit comments