精华内容
下载资源
问答
  • 编译zabbix的时候需要添加参数--enable-java备份zabbix_server.conf和zabbix_agentd.conf文件,重新编译安装zabbix[root@nginxzabbix-2.2.0]#./configure--enable-server--enable-agent--with-mysql--enable-ipv6...

    zabbix监控tomcat

    1.编译zabbix的时候需要添加参数--enable-java

    备份zabbix_server.conf和zabbix_agentd.conf文件,重新编译安装zabbix[root@nginx zabbix-2.2.0]# ./configure --enable-server --enable-agent     --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-ssh2 --enable-java

    2.zabbix_server端安装jdk

    安装jdk[root@nginx tmp]# tar xf jdk-7u9-linux-x64.tar.gz -C /usr/local/

    [root@nginx tmp]# ls /usr/local/jdk1.7.0_09/

    bin        jre      README.html                         THIRDPARTYLICENSEREADME.txt

    COPYRIGHT  lib      release

    db         LICENSE  src.zip

    include    man      THIRDPARTYLICENSEREADME-JAVAFX.txt

    3.修改zabbix_java相关选项

    然后进入到下面的目录下面进行seeting.sh脚本编辑[root@nginx zabbix-2.2.0]# find / -name zabbix_java

    /usr/local/sbin/zabbix_java

    /tmp/zabbix-2.2.0/src/zabbix_java

    [root@nginx zabbix-2.2.0]#

    [root@nginx zabbix-2.2.0]# ls

    bin  lib  settings.sh  shutdown.sh  startup.sh

    该文件默认全部注释的,启用下面几项即可[root@nginx zabbix_java]# vim settings.sh

    [root@nginx zabbix_java]# sed -e '/^#/d;/^$/d' settings.sh

    LISTEN_IP="0.0.0.0"

    LISTEN_PORT=10052

    PID_FILE="/tmp/zabbix_java.pid"

    START_POLLERS=5

    [root@nginx zabbix_java]#

    4.修改zabbix_server文件

    启用其中的几项[root@nginx zabbix_java]# sed -e '/^#/d;/^$/d' /usr/local/etc/zabbix_server.conf

    LogFile=/tmp/zabbix_server.log

    DBName=zabbix

    DBUser=zabbix

    DBPassword=zabbix

    [root@nginx zabbix_java]# vim /usr/local/etc/zabbix_server.conf

    [root@nginx zabbix_java]# sed -e '/^#/d;/^$/d' /usr/local/etc/zabbix_server.conf

    LogFile=/tmp/zabbix_server.log

    DBName=zabbix

    DBUser=zabbix

    DBPassword=zabbix

    JavaGateway=127.0.0.1

    JavaGatewayPort=10052

    StartJavaPollers=5

    5.启动zabbix_java

    找到zabbix_java目录路径,然后执行命令./startup.sh[root@nginx zabbix-2.2.0]# find / -name zabbix_java

    /usr/local/sbin/zabbix_java

    /tmp/zabbix-2.2.0/src/zabbix_java

    [root@nginx zabbix-2.2.0]#

    [root@nginx zabbix-2.2.0]# ls

    bin  lib  settings.sh  shutdown.sh  startup.sh

    [root@nginx zabbix-2.2.0]# ss -tunlp | grep 10052

    tcp    LISTEN     0      50                    :::10052                    :::*      users:(("java",16405,12))

    6.调整tomcat端,安装catalina-jmx-remote.jar

    下载来安装:root@tomcat5 tmp]# wget  http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.8/bin/extras/catalina-jmx-remote.jar

    将下载好的文件存放到tomcat子目录目录lib录下[root@tomcat5 tmp]# mv catalina-jmx-remote.jar /usr/local/tomcat/lib/

    [root@tomcat5 tmp]#

    7.修改catalina.sh文件

    修改catalina.sh文件,添加CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=**ip**"

    8.重启启动tomcat服务和zabbix_agentd服务

    9.服务器端测试是否能正常获取信息[root@nginx zabbix-2.2.0]# java -jar /root/cmdline-jmxclient-0.10.3.jar  - 192.168.146.130:9999 java.lang:type=Memory NonHeapMemoryUsage

    05/24/2014 15:42:02 +0800 org.archive.jmx.Client NonHeapMemoryUsage:

    committed: 47316992

    init: 24313856

    max: 136314880

    used: 47012784

    10.服务器端自定义监控项添加jmx监控端口

    自定义监控项

    查看绘图结果

    直接上图,自己看吧

    添加jmx监控端口

    7d55d9bfcd2f5da57f6d3b17102303f2.png

    自定义监控项

    21d346c3478434bfb704506020a3c07a.png

    查看绘图结果

    893cde1bbb9eae3d993ef52f1251d959.png

    11.参考网站

    展开全文
  • zabbix实现JMX模块的使用 scp jdk-8u121-linux-x64.rpm apache-tomcat-8.5.24.tar.gz server2:/root/ server2 作为javaMX 用到了tomcat yum install jdk-8u121-linux-x64.rpm -y tar zxf apache-tomcat-8.5.24...

     

    方法一

    zabbix实现JMX模块的使用

    scp jdk-8u121-linux-x64.rpm apache-tomcat-8.5.24.tar.gz server2:/root/

    server2 作为javaMX  用到了tomcat

    yum install  jdk-8u121-linux-x64.rpm  -y

    tar zxf  apache-tomcat-8.5.24.tar.gz  -C /usr/local/

    [root@server2 ~]# cd /usr/local/
    [root@server2 local]# ln -s apache-tomcat-8.5.24/  tomcat


    cd /usr/local/tomcat/bin/

    vim catalina.sh

    CATALINA_OPTS='-Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=8888
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false'

      /usr/local/tomcat/bin/startup.sh

    server1  充当java-gateway

    安装java-gateway

    yum install zabbix-java-gateway-4.0.5-1.el7.x86_64.rpm -y

    systemctl start zabbix-java-gateway

    [root@server1 4.0]# netstat -tnapl |grep 10052
    tcp6       0      0 :::10052                :::*                    LISTEN      28466/java

    vim /etc/zabbix/zabbix_server.conf

    JavaGateway=172.25.11.1

    JavaGatewayPort=10052

    StartJavaPollers=5

    [root@server1 4.0]# zabbix_server -R config_cache_reload
    zabbix_server [29256]: command sent successfully

    systemctl restart zabbix-server

    但是这个监控项太少了

     

    所以删掉重新添加了一个监控项多的

    补充dell服务器的使用

    ipmitool -H 172.25.254.201  -U root -P westos power status

    ipmitool -H 172.25.254.201  -U root -P westos power on

    开机

    获取传感器信息

    ipmitool -H 172.25.254.201  -U root -P westos sensor

     

    方法二节省server2被动资源

    选择全克隆

     

     

    再模板选择你的备份模板,然后选择监控项,下面全选后批量更新

     

    更换为你的主动模板

     

    server2

    vim /etc/zabbix/zabbix_agentd.conf

    StartAgents=0

    systemctl restart zabbix-agent

    就可以节省被动资源

     

    方法三 使用zabbix-proxy-mysql

    节省server资源

    实现数据流 server -> proxy ->agent

    修改serve3 名字为proxy

    hostnamectl set-hostname proxy

     systemctl stop zabbix-agent

    修改解析

    有上角添加代理

    proxy端

    yum install fping-3.10-1.el7.x86_64.rpm zabbix-proxy-mysql-4.0.5-1.el7.x86_64.rpm mariadb-server -y

    systemctl start mariadb

    mysql

    create database zabbix_proxy character set utf8 collate utf8_bin;

    grant all privileges on zabbix_proxy.* to zabbix@localhost identified by 'westos';

    zcat /usr/share/doc/zabbix-proxy-mysql-4.0.5/schema.sql.gz |mysql zabbix_proxy

    vim /etc/zabbix/zabbix_proxy.conf

    Server=172.25.11.1

    ServerPort=10051

    Hostname=proxy

    DBPassword=westos

    JavaGateway=172.25.11.1

    JavaGatewayPort=10052

    StartJavaPollers=5

    systemctl start zabbix-proxy

     

     

    server2

    vim /etc/zabbix/zabbix_agentd.conf

    Server=172.25.11.3

    StartAgents=5

    ServerActive=172.25.11.3

    server2

    systemctl restart zabbix-agent

    /usr/local/tomcat/bin/startup.sh

    proxy

    systemctl restart zabbix-proxy

    server1

    zabbix_server -R config_cache_reload

    systemctl restart zabbix-server  zabbix-agent

     

     

    zabbix总结

    聚合图形集中显示

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    展开全文
  • Zabbix 1.8以前,只能使用Zapcat来监控JMX,并需要修改源代码来支持,非常麻烦。另一种方法是使用jmx-cmd-client,他的作用是从命令行去获取JMX信息,可以在它的上层包装一个程序,用来获取JMX数据。 从Zabb...

    JMX的全称是Java Management Extensions,即Java管理扩展。Java程序会开放一些端口,用来获取运行状况。在Zabbix 1.8以前,只能使用Zapcat来监控JMX,并需要修改源代码来支持,非常麻烦。另一种方法是使用jmx-cmd-client,他的作用是从命令行去获取JMX信息,可以在它的上层包装一个程序,用来获取JMX数据。

        从Zabbix 2.0开始,内置了监控JMX的功能,叫做“Zabbix Java Gateway”,在Zabbix Server和Zabbix Proxy上启动名为“Zabbix Java Gateway”的进程,当需要获取JMX数据时,Zabbix Server会“问”JMX Gateway,然后JMX Gateway根据JMX管理API去查询需要的数据。在使用时,Java程序不需要在代码中新增任何东西,只需要在启动的时候加上一些JVM参数,使得它可以支持使用端口监控JMX。

     

       配置JDK

    JDK官网为http://www.oracle.com/technetwork/java/javase/downloads

    下载jdk安装包,解压并移动到/usr/local, 重命名为jdk目录

    添加jdk的系统环境变量

    vim /etc/profile

    export JAVA_HOME=/usr/local/jdk

    export PATH=$JAVA_HOME/bin:$PATH

    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    系统立即生效

    source /etc/profile

    使用java -version查看安装好的JDK

    Zabbix服务端的配置操作(已有环境则不需要重复此步骤,即二、三步骤)

    zabbix编译时添加的编译参数,需要重新编译zabbix,备份zabbix_server.conf和zabbix_agentd.conf文件

    ./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --enable-java         

    添加JMX监控支持--enable-java   

    报错configure: error: Unable to find "javac" executable in path   安装sudo yum install java*

     

     修改zabbix_java相关路径

    设定Java gateway 监听的端口和进程个数

    cd /usr/local/zabbix/sbin/zabbix_java

    sudo vim settings.sh

    # vim settings.sh

     

    LISTEN_IP="0.0.0.0"

    LISTEN_PORT=10052

    PID_FILE="/tmp/zabbix_java.pid"

    START_POLLERS=5

     

        其中 LISTEN_PORT 和 LISTEN_IP 可以不配置,zabbix_java 会采用默认值。但是 PID_FILE 和 START_POLLERS 必须配置,尤其主意 START_POLLERS,若不配置 zabbix_java 依旧可以启动但是是不工作的。

     

    2、修改zabbix_server文件

        既然java gateway运行了,你要告诉zabbix server去×××java gateway,在配置文件中开启如下几项参数。  

    zabbix_server添加以下文件
    vi /usr/local/zabbix/etc/zabbix_server.conf
    JavaGateway=127.0.0.1
    JavaGatewayPort=10052         #和上面的LISTEN_PORT一样
    StartJavaPollers=5      #这个数值要小于上面的START_POLLERS

     

        这三项都需要配置,其中StartJavaPollers会被视为开关性质的参数。0或者未配置将被系统认为不具有Java信息抓取能力。这点在Zabbix JMX Monitoring Wiki中未提及,但是实际效果就是这样。同时Zabbix Proxy的配置文件解析中也有介绍此参数的含义。

     

    3、启动zabbix_java

    zabbix的安装目录下找到zabbix_java目录路径,然后执行命令./startup.sh,并重启zabbix server。

    查看zabbix_java进程:ps -aux |grep zabbix_java

    自此Server端已经配置完成,下面配置Agent端的设定。

     

     

     agent端的tomcat环境安装

    安装JDK环境(请跳至第一步),并使用java -version查看安装好的JDK

     

    值得注意的是使用yum安装的tomcat下极其不容易配置JMX,建议使用源码包安装

    下载需要版本的tomcat源码包文件

    解压并移动到/usr/local/目录下,重命名为tomcat

    进入tomcat/bin/,执行./startup.sh

     

    如果出现报错

    touch: cannot touch ‘/usr/local/tomcat/logs/catalina.out’:No such file or directory

    需要创建目录

    mkdir /usr/local/tomcat/logs/

     

    问题:使用tomcat/bin下的sh文件启动停止服务会出现

    错误: 找不到或无法加载主类 org.apache.catalina.startup.Bootstrap  的报错

    需要从官网下载非源码需要编译安装的源码包文件,其bin目录下会包含.jar文件

    centos7下使用systemctl管理tomcat服务

    /usr/lib/systemd/system/下创建tomcat.service,写入如下的启动配置内容

    [Unit]

    Description=Tomcat

    After=syslog.target network.target remote-fs.target nss-lookup.target

    [Service]

    Type=forking

    Environment='JAVA_HOME=/usr/local/jdk'

    Environment='CATALINA_PID=/usr/local/tomcat/bin/tomcat.pid'

    Environment='CATALINA_HOME=/usr/local/tomcat/'

    Environment='CATALINA_BASE=/usr/local/tomcat/'

    Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'

    WorkingDirectory=/usr/local/tomcat

    ExecStart=/usr/local/tomcat/bin/startup.sh

    ExecReload=/bin/kill -s HUP $MAINPID

    ExecStop=/bin/kill -s QUIT $MAINPID

    PrivateTmp=true

    [Install]

    WantedBy=multi-user.target

    更新systemd管理库:systemctl daemon-reload

    配置开机启动

    systemctl enable tomcat

    启动tomcat 
    systemctl start tomcat 
    停止tomcat 
    systemctl stop tomcat 
    重启tomcat 
    systemctl restart tomcat

     

     

     agent端配置

    1、修改tomcat/bin/catalina.sh文件

    修改catalina.sh文件,添加

    CATALINA_OPTS="-Xms1024m -Xmx1024m

    -XX:NewRatio=4 

    -XX:PermSize=192m

    -XX:MaxPermSize=192m

    -Xss256k

    -XX:SurvivorRatio=4

    -Dcom.sun.management.jmxremote

    -Dcom.sun.management.jmxremote.authenticate=false   #不进行验证

    -Dcom.sun.management.jmxremote.port=12345           #jmx远程监控端口

    -Dcom.sun.management.jmxremote.ssl=false 

    -Djava.rmi.server.hostname=10.0.1.13"               #10.0.0.15是Agent的本地IP

     

        就这种方式而言,需要注意的是catalina.sh中提供的默认变量名JAVA_OPTS和CATALINA_OPTS。由于JAVA_OPTS所添加的参数会在tomcat开启和关闭时都运行,所以如果你把 -Dcom.sun.management.jmxremote.port=12345写在JAVA_OPTS中,就会在关闭tomcat时出现如下错误,从而无法关闭。

    Error: Exception thrown by the agent : java.rmi.server.ExportException : Port

    already in use: 12345;nested exception is:

    java.net.BindException: Address already in use: JVM_Bind

     

        而CATALINA_OPTS只会在开启tomcat的时候运行,所以应该将这些配置写在CATALINA_OPTS中。

     

     

    经过N多次测试在catalina.sh文件中添加上面的配置启动不了JMX程序,未做深入研究

    后在网上找出以下配置,修改为以下配置则正确启动jmx,配置大概在242行左右

    JAVA_OPTS="-Dcom.sun.management.jmxremote

    -Djava.rmi.server.hostname=192.168.1.108

    -Dcom.sun.management.jmxremote.port=6666

    -Dcom.sun.management.jmxremote.ssl=false

    -Dcom.sun.management.jmxremote.authenticate=false $JAVA_OPTS"

     

     

     添加zabbix监控自定义项

    1-1.添加监控主机


     

     1-2.添加tomcat端catalina.sh中配置的信息,如:tomcat端的主机ip地址及启动监听的端口号


     

     2-1.查看数据生成的图表


     

     以上均是从网络上筛选并通过实际验证的解决结果进行总结




    具体添加jmx监控主机详情请见附件中的图片


    转载于:https://blog.51cto.com/xiangcc/1964333

    展开全文
  • Setting up Zabbix monitoring for JBoss EAP 6 turns out te be quite different as for JBoss EAP 5. This is because the method of fetching JMX data in EAP 5 is no longer available in EAP 6.In ...

    Setting up Zabbix monitoring for JBoss EAP 6 turns out te be quite different as for JBoss EAP 5. This is because the method of fetching JMX data in EAP 5 is no longer available in EAP 6.

    In this post I’ll describe a method on how to enable JMX monitoring for JBoss EAP 5 and JBoss EAP 6 within the same Zabbix installation.


    Update 22-01-2014: You can download a custom zabbix-java-gateway RPM file for Zabbix 2.2.1 on RHEL/CentOS6 64-bit from my site here. The process of creating the RPM can be found here.

    Please note: You still need to add the remoting-libraries from your EAP installation to /usr/sbin/zabbix_java/lib if you use my RPM.

    Problem:

    JBoss EAP 5 supports JMX monitoring using RMI, where JBoss EAP 6 does not. EAP 6 uses “remoting-jmx” instead of “rmi”. This is a problem because the Zabbix Java Gateway only supports RMI for the JMX interface, preventing us from monitoring JBoss EAP 6 using JMX monitoring.

    Goal:

    My goal in this blogpost is to enable JMX monitoring for JBoss EAP 5 and JBoss EAP 6 on the same Zabbix Server.

    Steps:
    1.Modify source code of the Zabbix Java Gateway to enable both RMI and remoting-jmx
    2.Add the required libraries to the Zabbix Java Gateway
    3.Enable remote management in JBoss EAP 6
    4.Configure a JBoss EAP 5 and JBoss EAP 6 host to test the new configuration
    5.Using JConsole to identify items you want to monitor in Zabbix

    Let’s get started.

    1. Modify source code of the Zabbix Java Gateway to enable both RMI and remoting-jmx

    Like stated before, the Zabbix Java Gateway component only supports JMX over RMI. This is because the service URL it is using to connect to the remote server is hardcoded in JMXItemChecker.java:
    url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + conn + ":" + port + "/jmxrmi");

    At the time of writing the most current version of Zabbix is 2.2.1, and there is no way to customise this JMX url. JBoss EAP 6 doesn’t support RMI and expects remoting-jmx.

    Replacing the url with this one will enable remoting-jmx, at the cost of losing RMI monitoring:
    url = new JMXServiceURL("service:jmx:remoting-jmx://" + conn + ":" + port);

    In my environment I want to monitor both JBoss EAP 5 and EAP 6, and I don’t want to add a second zabbix server to do so. So while searching for a way to do this with minimal changes to the zabbix source code I had the idea of using a different port number for different JBoss versions.

    It’s far from ideal and just a workaround until the Zabbix people come up with a real solution, but it requires only a tiny bit of modifying the source code.

    Here are my notes of modifying the source code and building new binaries on a clean CentOS 6.5 machine.

    Preparing the build server:
     # yum -y update
     # reboot
     # yum groupinstall "Development Tools"
     # yum -y install mysql-server httpd php mysql-devel php-mysql libxml2-devel libcurl-devel php-mbstring php-bcmath php-gd php-xml

    Getting the software:
     # cd /opt
     # wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.1/zabbix-2.2.1.tar.gz/download
     # tar -xvzf zabbix-2.2.1.tar.gz

    Modify the JMXItemChecker.java:
    # vi zabbix-2.2.1/src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java

    Change:




    1 String conn = request.getString(JSON_TAG_CONN);
    2 int port = request.getInt(JSON_TAG_PORT);
    3
     
    4 url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + conn + ":" + port + "/jmxrmi");
    5 jmxc = null;
    6 mbsc = null;

    view raw JMXItemChecker.java hosted with by GitHub
    To:
     



    1 String conn = request.getString(JSON_TAG_CONN);
    2 int port = request.getInt(JSON_TAG_PORT);
    3
     
    4 //Dirty solution for ZBXNEXT-1274
    5 Integer remoting = new Integer("7777");
    6 int retval = remoting.compareTo(port);
    7
     
    8 if (retval == 0)
    9 {
    10         url = new JMXServiceURL("service:jmx:remoting-jmx://" + conn + ":" + port);
    11 }
    12 else
    13 {
    14         url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + conn + ":" + port + "/jmxrmi");
    15 }
    16 jmxc = null;
    17 mbsc = null;

    view raw JMXItemChecker.java hosted with by GitHub

    This enables remoting-jmx for hosts with a JMX Interface on port 7777 only, while keeping RMI for any other port. Of course you can change this port to be whatever you need, just be sure to match the port you configure in JBoss.

    That is all there is to it, let’s compile  the binaries and install our modified version of Zabbix:
    # cd zabbix-2.2.1
    # ./configure --enable-server --enable-agent --with-mysql --with-libcurl --with-libxml2 --enable-java
    # make install

    Configure the Java Pollers:
    # vi /usr/local/etc/zabbix_server.conf

    Add these values and save:
    JavaGateway=10.37.129.2
    StartJavaPollers=5
    JavaGatewayPort=10052

    3. Add the required libraries to the Zabbix Java Gateway

    Before we can start the java gateway we need to tell it how to use remoting-jmx. We can use the jar files from our JBoss EAP 6 installation to do this.

    Find the following jar files in your <EAP_6_HOME>/modules/system/layers/base/<sub_dirs>:
    $ cat needed_modules.txt
    jboss-as-remoting
    jboss-logging
    jboss-logmanager
    jboss-marshalling
    jboss-marshalling-river
    jboss-remoting
    jboss-sasl
    jcl-over-slf4j
    jul-to-slf4j-stub
    log4j-jboss-logmanager
    remoting-jmx
    slf4j-api
    xnio-api
    xnio-nio

    Place these in the java gateway lib directory:
    $ for i in $(cat needed_modules.txt); do find /opt/jboss-eap-6.0 -iname ${i}*.jar -exec cp {} /usr/local/sbin/zabbix_java/lib/ \; ; done

    If you’re reading this post I assume setting up the Zabbix database and web frontend is trivial so I won’t cover it here. Let’s start the java gateway and zabbix server and add a JBoss EAP 5 and JBoss EAP 6 host to test our modifications.

    3. Enable remote management in JBoss EAP 6

    I’m using a .zip deployment of JBoss EAP 6, unzipped in /opt/jboss-eap-6.0 and running on a host with an external IP number of 10.37.129.5.

    In this version of JBoss a user is required to do remote monitoring. Fortunately JBoss comes with the add-user.sh script to do this for you:
    [root@jboss6 bin]# cd /opt/jboss-eap-6.0/bin/
    [root@jboss6 bin]# ./add-user.sh

    What type of user do you wish to add?
    a) Management User (mgmt-users.properties)
    b) Application User (application-users.properties)
    (a):

    Enter the details of the new user to add.
    Realm (ManagementRealm) :
    Username : zabbix
    Password : zabbix_1
    Re-enter Password : zabbix_1
    About to add user 'zabbix' for realm 'ManagementRealm'
    Is this correct yes/no? yes
    Added user 'zabbix' to file '/opt/jboss-eap-6.0/standalone/configuration/mgmt-users.properties'
    Added user 'zabbix' to file '/opt/jboss-eap-6.0/domain/configuration/mgmt-users.properties'
    Is this new user going to be used for one AS process to connect to another AS process?
    e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
    yes/no? no

    We can now use the user “zabbix” with a password of “zabbix_1” for remote management. We also need to configure the management interface of JBoss to listen on port 7777.

    I’m going to run my JBoss instance in standalone mode with the standalone-full profile. To configure the management port, open:
    /opt/jboss-eap-6.0/standalone/configuration/standalone-full.xml

    Search for this line:
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

    Change the port number to 7777:
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:7777}"/>

    Save the file and start the JBoss instance:
    /opt/jboss-eap-6.0/bin/standalone.sh --server-config=standalone-full.xml -b 10.37.129.5 -Djboss.bind.address.management=10.37.129.5

     

    4. Configure a JBoss EAP 5 and JBoss EAP 6 host to test the new configuration

    In the Zabbix web interface go to: Configuration -> Hosts -> Create host.

    The first host I will add is a JBoss EAP 5 host, so it will require JMX RMI monitoring:
    Hostname: jboss.kanbier.lan
    Groups: Linux servers
    JMX Interfaces: jboss.kanbier.lan DNS 9999

    5. Using JConsole to identify items you want to monitor in  Zabbix

    There are at least 2 ways to get the JMX keys fron JBoss so you can add them  to Zabbix. In my example for JBoss EAP 6 I use the key:

    "jboss.as:subsystem=datasources,data-source=ExampleDS","jndiName"

    This fetches the “jndiName” from the ExampleDS data-source. How to construct  this key? You can easily browse the items that are available for monitoring  using either JConsole or jboss-cli.sh.  In this example I’ll be using  JConsole.

    JConsole is a Java GUI application that connects to the management interface  of JBoss in very much the same way as the Zabbix Java Gateway. It is shipped  with JBoss and located in <JBOSS_HOME>/bin.

    Before you start it, make sure your JBoss EAP 6 instance is running using the  configuration described in the instructions above.

    These are the steps I took to get it started on jboss6.kanbier.lan with  external ip 10.37.129.5.

    $ export PATH=/usr/java/latest/bin:$PATH
    $ export JAVA_HOME=/usr/java/latest
    $ /opt/jboss-eap-6.0/bin/jconsole.sh

    This should start a GUI if you have an X session available. Fill in:

    Check: Remote Process
    service:jmx:remoting-jmx://10.37.129.5:7777
    Username: zabbix
    Password: zabbix_1

    But there is one downside, the data available is only realtime. So no history  unless you keep JConsole running forever. This is where Zabbix comes in. You can  pull the data from the management interface just like JConsole does and store it  in Zabbix so you can build up a history, analyse trends and all things Zabbix  does best.

    Let’s say you want to monitor the HeapMemoryUsage in Zabbix. This requires  some knowledge of JBoss, but here is how to find it in JConsole.

    Click on the MBeans tab -> java.lang -> Memory -> Attributes ->  HeapMemoryUsage:


    转载于:https://blog.51cto.com/leeli/1712365

    展开全文
  • zabbix 部署jmx监控tomcat

    万次阅读 热门讨论 2016-12-12 20:19:48
    zabbix 部署jmx监控tomcat zabbix提供了一个java gateway的应用去监控jmx(Java Management Extensions,即Java管理扩展)是一个为应用程序、设备、系统等植入管理功能的框架。JMX可以跨越一系列异构操作系统...
  • zabbixZabbix使用JMX监控ActiveMQ
  • zabbix jmx监控

    2017-11-15 11:18:00
    【前提】 安装了合适版本的jdk。 jmx监控的步骤: 1. 添加主机监控的时候,要加上JMX ...2. 前端添加item的时候,Type选择JMX agent, key为 jmx[....]样子(jmx怎么获取的就不知道了) 3. 代理或者Server端...
  • zabbix监控jmx

    2020-03-11 16:45:29
    介绍 背景:目前公司用的主要语言就是java,然后在运维过程中会遇到频繁的内存溢出的情况,之前使用过...zabbix可以监控java,并且将内存的使用情况实时的展现出来,这是一个不错的选择。 JMX的全称是Java Managemen...
  • Zabbix进阶-JMX

    2021-03-08 14:34:36
      监控流程:在server端安装zabbix-java-geteway插件来替代zabbix-server,zabbix-java-geteway是用来监控tomcat(开启JMX),JMX将监控信息给到zabbix-java-geteway然后转发给zabbix-server,从而实现对JMX的监控...
  • zabbix 监控jmx

    2017-11-08 21:13:00
    1.zabbix-server 59.110.26.9 2.zabbix-agent 59.110.25.215 原理图: centos7 支持systemctl 补全 yum -y install bash-completion 1.安装zabbix-java-gateway 任意一台机器就行(这里安装在zabbix-agent服务...
  • Zabbix JMX监控

    2019-07-30 10:22:10
    Zabbix JMX server2 安装 zabbix_java_gateway并启动 关闭 zabbix_agent yum install -y zabbix-java-gateway-3.4.6-1.el6.x86_64.rpm /etc/init.d/zabbix-java-gateway start netstat -antlp | grep 10052 ...
  • ZABBIX通过JMX监控tomcat

    2017-11-12 16:46:00
    Zabbix中,JMX监控数据的获取由专门的代理程序来实现,即Zabbix-Java-Gateway来负责数据的采集,Zabbix-Java-Gateway和JMX的Java程序之间通信获取数据 JMXZabbix中的运行流程: 1.Zabbix-Server找Zabbix-Java-...
  • zabbix JMX监控

    2018-12-18 21:35:00
    1、对于简单配置,请将以下选项添加到  CATALINA_OPTS -Dcom.sun.management.jmxremote.authenticate= ...2、添加监控,链接JMX模板 转载于:https://www.cnblogs.com/xue0123/p/10140173.html
  • Zabbix JMX监控之ActiveMQ

    2019-11-06 15:06:59
    https://www.bbsmax.com/A/A7zglxRNJ4/... xbazhen/zabbix-jmx-activemq: a template for zabbix monitor general information of activemq https://github.com/xbazhen/zabbix-jmx-activemq/ armahan/zabbix-...
  • (一)简介1、JMX简介JMX的全称是Java Management Extensions,即Java管理扩展(Java Management Extensions,即Java管理扩展,是一个为应用程序、设备、系统等植入管理功能的框架,JMX可以跨越一系列异构操作系统平台...
  • https://www.zabbix.com/documentation/4.0/zh/manual/config/items/itemtypes/jmx_monitoring1>获取 jdk 和 tomcat [root@server1 ~]# systemctl start zabbix-server [root@server1 ~]# systemctl start ...
  • zabbix JMX 监控tomcat

    2019-05-16 21:58:55
    使用zabbix JMX 监控tomcat [root@server3 ~]# rpm -ivh jdk-8u121-linux-x64.rpm [root@server3 ~]# tar zxf apache-tomcat-8.5.24.tar.gz -C /usr/local/ [root@server3 local]# ln -s apache-tomcat-8.5.24/ ...
  • Zabbix通过JMX监控JVM

    2020-11-11 16:53:55
    Zabbix通过JMX监控JVM 1.概述 本方法在Zabbix3.x,4.x,5.x通用,JMX监控对象包含Windows和Linux中运行的SpringBoot项目。 2.java-gateway定位 java-gateway理论上是类似于zabbix-get的主动监控工具,与zabbix-server...
  • zabbix使用jmx监控tomcat

    2020-01-03 14:31:58
    Zabbix 2.0版本开始,以Zabbix守护进程的形式原生支持监控JMX程序出现了,它被称为Zabbix Java gateway。Zabbix gateway 是用Java语言写成。要查得一台主机特定的JMX计数器值,Zabbix server向Zabbix Java gateway...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 774
精华内容 309
关键字:

jmxzabbix