3 从 Debian/Ubuntu 包安装

概述

如果是通过 Debian/Ubuntu 的包进行的安装,那么以下的内容将会帮助您设置 Zabbix Java gateway

If installed from Debian/Ubuntu packages, the following information will help you in setting up Zabbix Java gateway.

配置并运行 Java gateway

Zabbix Java gateway 的配置参数可以通过如下文件进行调整:

Java gateway configuration may be tuned in the file:

  1. /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:

  1. # service zabbix-java-gateway restart

通过以下命令来配置 Zabbix Java gateway 的开机自启动:

To automatically start Zabbix Java gateway on boot:

  1. # systemctl enable zabbix-java-gateway

配置 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.

  1. JavaGateway=192.168.3.14
  2. 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.

  1. 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:

  1. /var/log/zabbix/zabbix_java_gateway.log

如果要增加日志记录,编辑以下文件:

If you like to increase the logging, edit the file:

  1. /etc/zabbix/zabbix_java_gateway_logback.xml

并将 level=“info” 更改为 “debug” 或 “trace” (为了深度排错):

and change level="info" to “debug” or even “trace” (for deep troubleshooting):

  1. <configuration scan="true" scanPeriod="15 seconds">
  2. [...]
  3. <root level="info">
  4. <appender-ref ref="FILE" />
  5. </root>
  6. </configuration>

JMX 监控

详见 JMX 监控 页面以获取更多的信息。

See JMX monitoring page for more details.