[fix] rabbtimq check file descriptors

"rabbitmqctl status" changed output and check_rabbtimq_file_descriptors.sh
stop to work. This is fixing the issue.

Tested on rabbitmq 3.8.3 Openstack Victoria.

Story: 2008299

Change-Id: I5c28fa275712a2d22e080ead52290ad1326643d6
Signed-off-by: Cyril Lopez <cylopez@redhat.com>
This commit is contained in:
Cyril Lopez 2021-04-30 10:47:33 +02:00
parent 50d3005bb2
commit 5a3368abf8
1 changed files with 5 additions and 5 deletions

View File

@ -67,14 +67,14 @@ while true; do
esac
done
limits=`sudo /sbin/rabbitmqctl status | grep file_descriptors -A 4`
limits=`sudo /sbin/rabbitmqctl status | grep "File Descriptors" -A 4`
[ $? -ne 0 ] && echo "rabbitmqctl status command failed" && exit $STATE_UNKNOWN
total_limit=`echo ${limits} | grep total_limit | sed -r 's/^.+total_limit,([[:digit:]]+).*$/\1/'`
total_used=`echo ${limits} | grep total_used | sed -r 's/^.+total_used,([[:digit:]]+).*$/\1/'`
total_limit=`echo ${limits} | grep Total | sed -r 's/^.+limit: ([[:digit:]]+).*$/\1/'`
total_used=`echo ${limits} | grep Total | sed -r 's/^.+Total: ([[:digit:]]+).*$/\1/'`
sockets_limit=`echo ${limits} | grep sockets_limit | sed -r 's/^.+sockets_limit,([[:digit:]]+).*$/\1/'`
sockets_used=`echo ${limits} | grep sockets_used | sed -r 's/^.+sockets_used,([[:digit:]]+).*$/\1/'`
sockets_limit=`echo ${limits} | grep Sockets | sed -r 's/^.+limit: ([[:digit:]]+).*$/\1/'`
sockets_used=`echo ${limits} | grep Sockets | sed -r 's/^.+Sockets: ([[:digit:]]+).*$/\1/'`
total_pct=`echo \( $total_used/$total_limit \) \* 100 | bc -l | awk '{printf "%3.2f", $0}'`
sockets_pct=`echo \( $sockets_used/$sockets_limit \) \* 100 | bc -l | awk '{printf "%3.2f", $0}'`