Ad Widget

Collapse

Tomcat JDBC Pool monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hakanozanlagan
    Member
    • Nov 2021
    • 35

    #1

    Tomcat JDBC Pool monitoring

    hi I enabled jmx on my test server and I am monitoring jvm metrics like heap, thread etc but I can't monitor jdbc pool information. My context.xml file is below. can you write a jmx key example for this configuration. I tried many examples but allways getting error like ("Object or attribute not found: Catalina:type=javax.sql.DataSource,host=localhost, class=my.cryptoutils.ds.EncryptedDataSourceFactory ,name="MyDS"").



    <Resource name="MyDS"
    keysPropertiesPath="/data/config/qwe/"
    auth="Application"
    type="javax.sql.DataSource"
    factory="my.cryptoutils.ds.EncryptedDataSourceFact ory"
    testWhileIdle="true"
    testOnBorrow="true"
    testOnReturn="true"
    validationQuery="SELECT 2 FROM DUAL"
    validationInterval="30000"
    timeBetweenEvictionRunsMillis="60000"
    maxActive="40"
    maxIdle="10"
    minIdle="1"
    maxWait="20000"
    initialSize="10"
    removeAbandonedTimeout="300"
    removeAbandoned="true"
    logAbandoned="true"
    minEvictableIdleTimeMillis="30000"
    jmxEnabled="true"
    jdbcInterceptors="org.apache.tomcat.jdbc.pool.inte rceptor.ConnectionState;org.apache.tomcat.jdbc.poo l.interceptor.StatementFinalizer"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbcracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(H OST=myhost.local)(PORT=1521))(CONNECT_DATA=(SERVER =dedicated)(SERVICE_NAME=myservice)))"
    username="**********"
    password="*******" />​
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    There's a tool called "jmxterm" it will help you to connect to your thing and look around, what is available - domains, beans etc...
    Interactive command line JMX client. Contribute to jiaqi/jmxterm development by creating an account on GitHub.


    Code:
    java -jar jmxterm-1.0.4-uber.jar
    
    $>help
    #following commands are available to use:
    about - Display about page
    bean - Display or set current selected MBean.
    beans - List available beans under a domain or all domains
    bye - Terminate console and exit
    close - Close current JMX connection
    domain - Display or set current selected domain.
    domains - List all available domain names
    exit - Terminate console and exit
    get - Get value of MBean attribute(s)
    help - Display available commands or usage of a command
    info - Display detail information about an MBean
    jvms - List all running local JVM processes
    open - Open JMX session or display current connection
    option - Set options for command session
    quit - Terminate console and exit
    run - Invoke an MBean operation
    set - Set value of an MBean attribute
    subscribe - Subscribe to the notifications of a bean
    unsubscribe - Unsubscribe the notifications of an earlier subscribed bean
    watch - Watch the value of one MBean attribute constantly
    $>
    ​

    Comment

    Working...