ZABBIX 监控 JBOSS 7.1.1
博客专区 > tacg 的博客 > 博客详情
ZABBIX 监控 JBOSS 7.1.1
tacg 发表于1年前
ZABBIX 监控 JBOSS 7.1.1
  • 发表于 1年前
  • 阅读 51
  • 收藏 2
  • 点赞 0
  • 评论 1

【腾讯云】新注册用户域名抢购1元起>>>   

摘要: ZABBIX 监控 JBOSS 7.1.1 主要讲 zabbix javagateway 监控架构、zabbix jvm 配置,自动告警。

一 环境

1.1 操作系统

[root@host-xxxsoft]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.6 (Final)
Release:        6.6
Codename:       Final
[root@host-xxx soft]# 

1.2  JBOSS

jboss7.1.1

安装请参考

https://my.oschina.net/tacg/blog/423835

https://my.oschina.net/tacg/blog/423867

1.3 zabbix

zabbix_server (Zabbix) 3.2.1
Revision 62890 30 September 2016, compilation time: Oct 12 2016 17:36:37

Copyright (C) 2016 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

二  监控架构

2.1 官方解释

参考 https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/jmx_monitoring

JMX monitoring can be used to monitor JMX counters of a Java application.

JMX monitoring has native support in Zabbix in the form of a Zabbix daemon called “Zabbix Java gateway”, introduced since Zabbix 2.0.

To retrieve the value of a particular JMX counter on a host, Zabbix server queries the Zabbix Java gateway, which in turn uses the JMX management API to query the application of interest remotely.

翻译:JMX 监控能用于监控JAVA 程序,自从Zabbix 2.0 版本之后,引进了Zabbix Java gateway 用于支持JMX 监控。

为了获取JMX 的值,Zabbix Server 查询 Zabbix Java gateway, Zabbix Java gateway 查询JMX API 获取值。

2.2 监控图

图中 zabbixserver 与  zabbix java gateway 部署在一台主机上。

 

三 安装及运行

3.1 zabbix server & zabbix java gateway 安装

./configure  --prefix=/usr/local/zabbix --enable-server --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --enable-proxy --enable-java 

make

make install

3.2 zabbix server 针对 java gate way 配置

说明: 

 JavaGateway : zabbix java gate way 主机IP

JavaGatewayPort:  zabbix    java gate way 监听端口

 StartJavaPollers less than or equal to START_POLLERS,

[root@host-10-59-2-163 etc]# grep Java zabbix_server.conf
#       Number of pre-forked instances of pollers for unreachable hosts (including IPMI and Java).
#       At least one poller for unreachable hosts must be running if regular, IPMI or Java pollers
### Option: JavaGateway
#       IP address (or hostname) of Zabbix Java gateway.
#       Only required if Java pollers are started.
# JavaGateway=
 JavaGateway=10.59.2.163
### Option: JavaGatewayPort
#       Port that Zabbix Java gateway listens on.
# JavaGatewayPort=10052
 JavaGatewayPort=10052
### Option: StartJavaPollers
#       Number of pre-forked instances of Java pollers.
# StartJavaPollers=0
 StartJavaPollers=5

 

启动命令

/usr/local/zabbix/sbin/zabbix_server

 

3.3 zabbix java gateway 配置

官方文档:https://www.zabbix.com/documentation/3.2/manual/concepts/java

 

注: StartJavaPollers less than or equal to START_POLLERS

root@host-10-59-2-163 zabbix_java]# less settings.sh 
# This is a configuration file for Zabbix Java Gateway.
# It is sourced by startup.sh and shutdown.sh scripts.

### Option: zabbix.listenIP
#       IP address to listen on.
#
# Mandatory: no
# Default:
# LISTEN_IP="0.0.0.0"

### Option: zabbix.listenPort
#       Port to listen on.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# LISTEN_PORT=10052

### Option: zabbix.pidFile
#       Name of PID file.
#       If omitted, Zabbix Java Gateway is started as a console application.
#
# Mandatory: no
# Default:
# PID_FILE=

PID_FILE="/tmp/zabbix_java.pid"

### Option: zabbix.startPollers
#       Number of worker threads to start.
#
# Mandatory: no
# Range: 1-1000
# Default:
# START_POLLERS=5
 START_POLLERS=10

### Option: zabbix.timeout
#       How long to wait for network operations.
#
# Mandatory: no
# Range: 1-30
# Default:
# TIMEOUT=3

 

启动命令

/usr/local/zabbix/sbin/zabbix_java/startup.sh

3.4 jboss 7.1.1 配置

修改配置 文件jboss-as-7.1.1.Final/bin/standalone.con

 


JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p: ${JB0SS_HOME}/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p: ${JB0SS_HOME}/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p: ${JB0SS_HOME}/modules/org/apache/log4j/main/log4j-1.2.16.jar -Djboss.modules.system.pkgs=org.jboss.logmanager"

说明:

1.${JB0SS_HOME}  这个替换为你安装的JBOSS 目录

2.目前这个配置 ssl 和authenticate 都是false ,网上有部分文章将此处设为true ,此处会增加jre 的配置,我这边暂时忽略。

启动命令

nohup /wls/jbossserver/jboss-as-7.1.1.Final/bin/standalone.sh >/dev/null 2>&1 & \r

四 zabbix web端配置(待续)

标签: zabbix jboss
  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 2
博文 65
码字总数 23097
评论 (1)
tacg
20090302
×
tacg
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: