반응형

#!/bin/sh

 

CONTROLLER_IP=127.0.0.1

CONTROLLER_PORT=9999

DATE=`date +%Y%m%d%H%M%S`

 

echo "###DATE: " $DATE

 

echo "#################SERVER-STATE####################"

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command=:"read-attribute(name=server-state)" |grep result |tr -d ' ' |tr -d '"' |tr '=>' ': ' |tr -d ','

echo ""

 

echo "###################THREAD-STATE##################"

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command="/core-service=platform-mbean/type=threading:read-resource" |grep daemon-thread-count |tr -d ' ' |tr -d '"' |tr '=>' ': ' |tr -d ','

echo ""

 

 

echo "##################HEAP-STATE#####################"

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command="/core-service=platform-mbean/type=memory :read-attribute(name=heap-memory-usage)" |grep max |tr -d ' ' |tr -d '"' |tr '=>' ': ' |tr -d ','

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command="/core-service=platform-mbean/type=memory :read-attribute(name=heap-memory-usage)" |grep used |tr -d ' ' |tr -d '"' |tr '=>' ': ' |tr -d ','

echo ""

 

 

echo "##############DATASOURCE-STATE###################"

echo "#DATASOURCE1"

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$CONTROLLER_IP:$CONTROLLER_PORT --command="/subsystem=datasources/data-source=ExampleDS/statistics=pool :read-resource(recursive=true, include-runtime=true)" |grep  ActiveCount |tr -d ' ' |tr -d '"' |tr '=>' ': ' |tr -d ','

echo ""

 

 

echo "###########Connection-STATE######################"

lsof -u jboss |grep TCP |grep ajp| wc -l

echo ""

echo "#################################################"

반응형

+ Recent posts