We have crated this article because JBoss AS 6 has a command line utility which is very useful to use when in production environments if your JMS console is been disabled then twiddle really comes handy. However there can be n-numbers of twiddle commands available but in this article we would be sharing few of the very useful commands which is been used in day to activity for an JBoss administrators.
If you feel like you have any twiddle commands which can be useful for other then feel free to share it with us and others so that other fellow JBoss administrators can get the benefits out of them. We would also like to share that most of the changes made using these twiddle commands are not permanent, meaning if you restart the JBoss server then the changes which were made by the twiddle commands would be overridden by the configuration which are given in the respective XML files.
To make is user friendly I have break down this commands in different sections so you can concentrate on your interests list of commands.
System utility twiddle commands
Shutdown JBoss
./twiddle.sh -s localhost:1099 -u admin -p admin invoke jboss.system:type=Server shutdown
Taking Theard Dump
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:type=ServerInfo" listThreadDump >> threadDump.html
List Memory Pools
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:type=ServerInfo" listMemoryPools true > memory.html
List Thread Cpu Utilization
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:type=ServerInfo" listThreadCpuUtilization > cpu.html
Application related twiddle commands
Deploy
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=MainDeployer" deploy "file:///home/rmody/JBoss_Data/Jboss/AS6/jboss-as/server/d-1/deploy/Test_WAR.war"
UnDeploy
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=MainDeployer" undeploy "file:///home/rmody/JBoss_Data/Jboss/AS6/jboss-as/server/d-1/deploy/Test_WAR.war"
ReDeploy
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=MainDeployer" redeploy "file:///home/rmody/JBoss_Data/Jboss/AS6/jboss-as/server/d-1/deploy/Test_WAR.war"
Maximum processing time of a request
./twiddle.sh -s localhost:1099 -u admin -p admin get "jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/Test_WAR,j2eeType=Servlet,name=jsp" maxTime
Number of requests processed by this wrapper
./twiddle.sh -s localhost:1099 -u admin -p admin get "jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/Test_WAR,j2eeType=Servlet,name=jsp" requestCount
JMS related twiddle commands
Creat a Queue
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.messaging:service=ServerPeer" deployQueue "testQueue" "testQueue-JNDIname"
Remove a Queue
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.messaging:service=ServerPeer" undeployQueue "TestQ"
Creat a Topic
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.messaging:service=ServerPeer" deployTopic "testTopic" "testTopic-JNDIname"
Remove a Topic
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.messaging:service=ServerPeer" undeployTopic "testTopic"
The number of messages in the queue
./twiddle.sh -s localhost:1099 -u admin -p admin get "jboss.messaging.destination:name=TestQ,service=Queue" MessageCount
Remove all messages in the queue
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.messaging.destination:name=TestQ,service=Queue" removeAllMessages
DataSource related twiddle commands
Connections currently in use
./twiddle.sh -s localhost:1099 -u admin -p admin get "jboss.jca:name=DefaultDS,service=ManagedConnectionPool" InUseConnectionCount
Logging Log4j related twiddle commands
Sets the log level for a given logger
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=Logging,type=Log4jService" setLoggerLevel "org.jboss" "TRACE"
Sets the levels of each logger specified by the given comma seperated list of logger names.
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=Logging,type=Log4jService" setLoggerLevels "org.jboss,org.jboss.system" "ERROR"
Displays the log level of a given logger.
./twiddle.sh -s localhost:1099 -u admin -p admin invoke "jboss.system:service=Logging,type=Log4jService" getLoggerLevel "org.jboss"
November 17th, 2012 on 12:46 am
Hi Team,
Thanks for such a informative post. can you please help me with email alerts service available in Jboss. I heard about two related files.
mail-service.xml and
monitoring-service.xml
How we can use them for monitoring jboss OR monitoring deployed applications.
May 8th, 2014 on 12:41 am
Hi,
Do we have twiddle command to get a list of war files and their details respectively?
Regards,
Priyesh