• zabbix 监控 tomcat jmx


    
    
    zabbix_server:
    
    zabbix_server.conf :
    
    # Add
    JavaGateway=127.0.0.1
    JavaGatewayPort=10052
    StartJavaPollers=5
    
    # restart service
    service zabbix_server restart
    
    
    /usr/sbin/zabbix_java/settings.sh
    
    # modify
    LISTEN_IP="0.0.0.0"
    LISTEN_PORT=10052
    PID_FILE="/tmp/zabbix_java.pid"
    START_POLLERS=5
    
    # 启动 
    /usr/sbin/zabbix_java/startup.sh
    
    ####################################
    
    Tomcat & zabbix agent:
    # 下载jar包
    wget http://xxx/catalina-jmx-remote.jar
    
    # 复制到要监控的tomcat的lib里面,例如cms
    cp catalina-jmx-remote.jar /usr/local/tomcat/lib/
    
    # modify /usr/local/tomcat/bin/catalina.sh
    Add
    CATALINA_OPTS="
    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=18097 # jmx端口
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
    -Djava.rmi.server.hostname=172.16.2.21" # 客户端(本机)ip地址
    
    # 重启Tomcat
    
    
    #####################################
    
    zabbixserver端
    
    下载cmdline测试是否可获取到数据:
    
    wget http://repo.typesafe.com/typesafe/repo/cmdline-jmxclient/cmdline-jmxclient/0.10.3/cmdline-jmxclient-0.10.3.jar
    
    # java -jar cmdline-jmxclient-0.10.3.jar - 10.9.2.20:18097 java.lang:type=Memory NonHeapMemoryUsage 
    
    04/07/2016 10:37:16 +0800 org.archive.jmx.Client NonHeapMemoryUsage: 
    committed: 139460608
    init: 136773632
    max: 318767104
    used: 57493856
  • 相关阅读:
    Solaris引导和关闭
    systemctl
    [Poj3281]Dining(最大流)
    [Poj1149]Pigs(最大流)
    [Bzoj2588]Count on a tree(主席树+LCA)
    [BZOJ3524]区间问题(主席树)
    [Poj2761]Feed the dogs(主席树)
    [BZOJ1597][Usaco2008 Mar]土地购买(斜率优化)
    [BSOJ2684]锯木厂选址(斜率优化)
    [Hdu3507]Print Article(斜率优化)
  • 原文地址:https://www.cnblogs.com/topicjie/p/5363201.html
Copyright © 2020-2023  润新知