Ad Widget

Collapse

Zabbix и Zabbix-java-gateway

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tabav
    Junior Member
    • May 2021
    • 6

    #1

    Zabbix и Zabbix-java-gateway

    Появилась необходимость использование zabbix-java-gateway для мониторинга java приложений.
    Выполнены настройки согласно документации, но ни в логах zabbix (DEBUG=4) ни в zabbix-java-gateway (level="debug") нет упоминания о попытках соединения zabbix - zabbix-java-gateway - jmx

    zabbix_server.conf

    Click image for larger version

Name:	2021-05-13_171916.png
Views:	230
Size:	21.1 KB
ID:	424580

    zabbix_java_gateway.conf

    Click image for larger version

Name:	2021-05-13_172043.png
Views:	152
Size:	62.9 KB
ID:	424581

    после чего перезапущены приложения zabbix-server, zabbix-java-gateway


    при запуске приложения zabbix_java_gateway.log появилась информация об успешном запуске

    Code:
    2021-05-13 09:36:34.564 [main] INFO com.zabbix.gateway.JavaGateway - Zabbix Java Gateway 5.0.11 (revision 15ae5548ce) has started
    2021-05-13 09:36:34.601 [main] DEBUG c.z.gateway.ConfigurationManager - starting to parse configuration parameters
    2021-05-13 09:36:34.603 [main] DEBUG c.z.gateway.ConfigurationManager - found pidFile configuration parameter with value '/var/run/zabbix/zabbix_java_gateway.pid'
    2021-05-13 09:36:34.603 [main] DEBUG c.z.gateway.ConfigurationManager - received pidFile configuration parameter, daemonizing
    2021-05-13 09:36:34.604 [main] DEBUG c.z.gateway.ConfigurationManager - found listenIP configuration parameter with value '192.168.90.26'
    2021-05-13 09:36:34.605 [main] DEBUG c.z.gateway.ConfigurationManager - found startPollers configuration parameter with value '5'
    2021-05-13 09:36:34.605 [main] DEBUG c.z.gateway.ConfigurationManager - found timeout configuration parameter with value '3'
    2021-05-13 09:36:34.608 [main] DEBUG c.z.gateway.ConfigurationManager - finished parsing configuration parameters
    2021-05-13 09:36:34.608 [main] INFO com.zabbix.gateway.JavaGateway - listening on /192.168.90.26:10052
    2021-05-13 09:36:34.627 [main] DEBUG com.zabbix.gateway.JavaGateway - created a thread pool of 5 pollers
    zabbix-java-gateway слушает настроенный порт 10052

    Code:
    netstat -anp | grep 10052
    tcp 0 0 0.0.0.0:10052 0.0.0.0:* LISTEN 29382/java
    Так же для теста запущен локальный jmx для zabbix-java-gateway на порту 9999
    Code:
    netstat -anp | grep 9999
    tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 29382/java
    Подключение по tcp доступно

    Code:
    telnet 127.0.0.1 9999
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
    Escape character is '^]'.
    ^C
    Connection closed by foreign host.
    root@zabbix:/var/log/zabbix# telnet 127.0.0.1 10052
    Trying 127.0.0.1...
    Connected to 127.0.0.1.
    Escape character is '^]'.
    ^CConnection closed by foreign host.

    Для теста настроен элемент данных, но ни ошибок ни данных нет

    Click image for larger version

Name:	2021-05-13_173057.png
Views:	152
Size:	57.8 KB
ID:	424582


    При попытки протестирвоать данный элемент получаю ошибку

    Click image for larger version

Name:	2021-05-13_173247.png
Views:	148
Size:	54.2 KB
ID:	424583

    Установленные пакеты zabbix

    Code:
    # dpkg-query -l | grep zabbix
    ii zabbix-agent 1:5.0.2-1+buster amd64 Zabbix network monitoring solution - agent
    ii zabbix-apache-conf 1:5.0.0-1+buster all Zabbix network monitoring solution - apache configuration for front-end
    ii zabbix-frontend-php 1:5.0.0-1+buster all Zabbix network monitoring solution - PHP front-end
    ii zabbix-java-gateway 1:5.0.11-1+buster all Zabbix network monitoring solution - java-gateway
    ii zabbix-release 1:5.0-1+buster all Zabbix official repository configuration
    ii zabbix-server-mysql 1:5.0.0-1+buster amd64 Zabbix network monitoring solution - server (MySQL)
    Прошу помощи в решении возникшей проблемы.

  • tabav
    Junior Member
    • May 2021
    • 6

    #2
    Originally posted by cyber
    If you put jmx interface address to 192.168.90.26:9999 ?
    Just random option to try..:P
    I changed the ip of the jmx interface, but I have the same error

    Click image for larger version

Name:	2021-05-14_095751.png
Views:	141
Size:	26.6 KB
ID:	424619

    I think this error is reading zabbix server properties, but I don't understand why.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4811

      #3
      If you put jmx interface address to 192.168.90.26:9999 ?
      Just random option to try..:P...

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4811

        #4
        Beats me.. all 3 needed config lines in server/proxy config are present
        JavaGateway=
        JavaGatewayPort=10052
        StartJavaPollers=5
        Unfortunately I have a bit older version here.. no "test" option... SO I cannot play around with it to try to emulate same situation...
        Only difference in java gw config I can find (with my local setup here) is that I have also
        LISTEN_IP="0.0.0.0"
        in javaGW config...

        Comment

        Working...