Created
January 16, 2020 16:58
-
-
Save alphabraga/5ec0a3474073fce2018db5d44c6e1754 to your computer and use it in GitHub Desktop.
realiza o flush do poll do jboss
This file contains hidden or 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 | |
tipo=$1 | |
if [ -z $tipo ] | |
then | |
echo "Parâmetro obrigatório info ou o tipo de operacao [all, idle]" | |
exit 1; | |
fi | |
jbosscli='/home/jboss/appServer_EMAP/bin/jboss-cli.sh' | |
jbossserver='tos.emap.ma.gov.br:1000' | |
info(){ | |
echo "==========informações sobre as conexões==========" | |
$jbosscli --connect --controller="'$jbossserver'" --command="/subsystem=datasources/data-source=tosp/statistics=pool:read-resource(include-runtime=true)" | |
echo "==========informações sobre as conexões==========" | |
} | |
flushall(){ | |
echo "Realizando o flush all (removendo TODAS as conexões)" | |
$jbosscli --connect --controller="'$jbossserver'" --command="/subsystem=datasources/data-source=tosp/:flush-all-connection-in-pool" | |
} | |
flushidle(){ | |
echo "Realizando o flush idle (removendo as conexões IDLE)" | |
$jbosscli --connect --controller="'$jbossserver'" --command="/subsystem=datasources/data-source=tosp/:flush-idle-connection-in-pool" | |
} | |
if [ "$tipo" = 'all' ] | |
then | |
flushall | |
fi | |
if [ "$tipo" = 'idle' ] | |
then | |
flushidle | |
fi | |
if [ "$tipo" = "info" ] | |
then | |
info | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment