2 从 RHEL/CentOS 包安装
概述
如果是通过 RHEL/CentOS 的包进行的安装,那么以下的内容将会帮助您设置 Zabbix Java gateway。
If installed from RHEL/CentOS packages, the following information will help you in setting up Zabbix Java gateway.
配置并运行 Java gateway
Zabbix Java gateway 的配置参数可以通过如下文件进行调整:
Configuration parameters of Zabbix Java gateway may be tuned in the file:
/etc/zabbix/zabbix_java_gateway.conf
关于更多信息,详见 Zabbix Java geteway 配置参数。
For more details, see Zabbix Java gateway configuration parameters.
通过以下命令来启动 Zabbix Java gateway:
To start Zabbix Java gateway:
# service zabbix-java-gateway restart
通过以下命令来配置 Zabbix Java gateway 的开机自启动:
To automatically start Zabbix Java gateway on boot:
RHEL 7 和 RHEL 7 之后的系统:
RHEL 7 and later:
# systemctl enable zabbix-java-gateway
RHEL 7 之前的系统:
RHEL prior to 7:
# chkconfig --level 12345 zabbix-java-gateway on
配置 Server 以同 Java gateway 使用
当 Java gateway 启动和运行后,您必须告诉 Zabbix server 如何找到 Java gateway。这是通过在 Server 配置文件 中指定 JavaGateway 和 JavaGatewayPort 参数来完成的。如果 Zabbix proxy 运行 JMX 的应用或主机,则需要在 Proxy 配置文件 中指定连接参数。
With Java gateway up and running, you have to tell Zabbix server where to find Zabbix Java gateway. This is done by specifying JavaGateway and JavaGatewayPort parameters in the server configuration file. If the host on which JMX application is running is monitored by Zabbix proxy, then you specify the connection parameters in the proxy configuration file instead.
JavaGateway=192.168.3.14
JavaGatewayPort=10052
默认情况下,Server 不会启动与 JMX 监控相关的任何进程。但是,如果您要使用它,那么就必须要指定 Java pollers 的数量。此操作与指定常规 pollers 和 trappers 相同。
By default, server does not start any processes related to JMX monitoring. If you wish to use it, however, you have to specify the number of pre-forked instances of Java pollers. You do this in the same way you specify regular pollers and trappers.
StartJavaPollers=5
在完成配置后,一定不要忘记重启 Server 或 Poryx。
Do not forget to restart server or proxy, once you are done with configuring them.
调试 Java gateway
Zabbix Java gateway 的日志文件为:
Zabbix Java gateway log file is:
/var/log/zabbix/zabbix_java_gateway.log
如果要增加日志记录,编辑以下文件:
If you like to increase the logging, edit the file:
/etc/zabbix/zabbix_java_gateway_logback.xml
并将 level="info"
更改为 “debug” 或 “trace” (为了深度排错):
and change level="info"
to “debug” or even “trace” (for deep troubleshooting):
<configuration scan="true" scanPeriod="15 seconds">
[...]
<root level="info">
<appender-ref ref="FILE" />
</root>
</configuration>
JMX 监控
详见 JMX 监控 页面以获取更多信息。
See JMX monitoring page for more details.