Skip to main content

`zabbix-java-gateway` on Centos 6.5

Installing zabbix-java-gateway on Centos 6.5

How does zabbix-java-gateway work?

  1. First we configure system which needs to be monitored using the JAVA_OPTS.
  2. Next we add a JMX Interface in Zabbix server UI under hosts.
  3. zabbix-server will communicate with zabbix-java-gateway which intern communicates to the system/server where we need to get all the JMX data.
  4. JMX is set using the JAVA_OPTS.
 [Zabbix-Server] --(port:10053)--> [zabbix-java-gateway] --(port:12345)--> [JMX enabled server, Example:Tomcat/WebServer]

Step 1 : Install zabbix-java-gateway on zabbix-server

 [ahmed@ahmed-server ~]$ sudo yum install zabbix-java-gateway

Step 2 : Configure the host with JMX which needs to be monitored.

Setting Tomcat/JMX Options. Add the below lines to setenv.sh and save it under apache-tomcat-7/bin/
So when the start.sh is started then these JMX options will be added to tomcat server.
NOTE: To make the monitoring secure use ssl and authentication options. You can find more information in the links at the end of this post.
IMPORTANT Lines are below. We will be getting data from port 12345.
  -Dcom.sun.management.jmxremote\
  -Dcom.sun.management.jmxremote.port=12345\
  -Dcom.sun.management.jmxremote.authenticate=false\
  -Dcom.sun.management.jmxremote.ssl=false"
But here are the complete JAVA_OPTS. you can ignore the first few lines which sets the Heap Memory size.
 export JAVA_OPTS="$JAVA_OPTS\
  -server\
  -Xms1024m\
  -Xmx2048m\
  -XX:MaxPermSize=256m\
  -XX:MaxNewSize=256m\
  -XX:NewSize=256m\
  -XX:SurvivorRatio=12\
  -Dcom.sun.management.jmxremote\
  -Dcom.sun.management.jmxremote.port=12345\
  -Dcom.sun.management.jmxremote.authenticate=false\
  -Dcom.sun.management.jmxremote.ssl=false"

Step 3 : Configuring zabbix-server.

  1. Here we configure the zabbix server to let it know where the zabbix-java-gateway is running.
  2. Since we are running the zabbix-java-gateway in the same server as zabbix-server, so we will be using the same ip for both.
  3. Only difference is that zabbix-java-gateway will be running on port 10053
Configuration in zabbix-server.conf. Add the below line. Rather un-comment them and add the IP/ports
 ### Option: JavaGateway
 #       IP address (or hostname) of Zabbix Java gateway.
 #       Only required if Java pollers are started.
 #
 # Mandatory: no
 # Default:
 JavaGateway=10.10.18.27

 ### Option: JavaGatewayPort
 #       Port that Zabbix Java gateway listens on.
 #
 # Mandatory: no
 # Range: 1024-32767
 # Default:
 JavaGatewayPort=10053

 ### Option: StartJavaPollers
 #       Number of pre-forked instances of Java pollers.
 #
 # Mandatory: no
 # Range: 0-1000
 # Default:
 StartJavaPollers=5

Step 4 : Configuring zabbix-java-gateway.

  1. We now set where the zabbix-java-gateway will be running and which port it will be listing on.
  2. Configuration in zabbix-java-gateway, here same ip as the zabbix-server and port 10053.
 ### Option: zabbix.listenIP
 #       IP address to listen on.
 #
 # Mandatory: no
 # Default:
 LISTEN_IP="10.10.18.27"

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

 ### 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="/var/run/zabbix/zabbix_java.pid"

 ### Option: zabbix.startPollers
 #       Number of worker threads to start.
 #
 # Mandatory: no
 # Range: 1-1000
 # Default:
 START_POLLERS=5
 https://www.zabbix.com/documentation/2.4/manual/concepts/java
 https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/jmx_monitoring

Comments

  1. Hello ,

    I am not able to enable the JMX interface, the button is shown RED, tried multiple ports, but the issue continiues.

    ~~~~~~~~~~~~~~~~~~~

    java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The error obtained is of above.

    Any help will be greatly appreciated.

    Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

Zabbix History Table Clean Up

Zabbix history table gets really big, and if you are in a situation where you want to clean it up. Then we can do so, using the below steps. Stop zabbix server. Take table backup - just in case. Create a temporary table. Update the temporary table with data required, upto a specific date using epoch . Move old table to a different table name. Move updated (new temporary) table to original table which needs to be cleaned-up. Drop the old table. (Optional) Restart Zabbix Since this is not offical procedure, but it has worked for me so use it at your own risk. Here is another post which will help is reducing the size of history tables - http://zabbixzone.com/zabbix/history-and-trends/ Zabbix Version : Zabbix v2.4 Make sure MySql 5.1 is set with InnoDB as innodb_file_per_table=ON Step 1 Stop the Zabbix server sudo service zabbix-server stop Script. echo "------------------------------------------" echo " 1. Stopping Zabbix Server ...

Installing Zabbix Version 2.4 Offline (Zabbix Server without Internet).

There might be situations where you have a remote/zabbix server which does not have internet connectivity, due to security or other reasons. So we create a custom repo on the remote/zabbix server so that we can install zabbix using rpms Here is how we are planning to do this. Download all the dependency rpms on a machine which has internet connection, using yum-downloadonly or repotrack . Transfer all the rpms to the remote server. Create a repo on the remote server. Update yum configuration. Install. NOTE: This method can be used to install any application, but here we have used zabbix as we had this requirement for a zabbix server. Download dependent rpms . On a machine which has internet connection install the package below. And download all the rpms . Make sure the system are similar (not required to be identical - At-least the OS should be of same version) mkdir /zabbix_rpms yum install yum-downloadonly Downloading all the rpms to location /zabbix_rpms/ ,...

Access Filter in SSSD `ldap_access_filter` [SSSD Access denied / Permission denied ]

Access Filter Setup with SSSD ldap_access_filter (string) If using access_provider = ldap , this option is mandatory. It specifies an LDAP search filter criteria that must be met for the user to be granted access on this host. If access_provider = ldap and this option is not set, it will result in all users being denied access. Use access_provider = allow to change this default behaviour. Example: access_provider = ldap ldap_access_filter = memberOf=cn=allowed_user_groups,ou=Groups,dc=example,dc=com Prerequisites yum install sssd Single LDAP Group Under domain/default in /etc/sssd/sssd.conf add: access_provider = ldap ldap_access_filter = memberOf=cn=Group Name,ou=Groups,dc=example,dc=com Multiple LDAP Groups Under domain/default in /etc/sssd/sssd.conf add: access_provider = ldap ldap_access_filter = (|(memberOf=cn=System Adminstrators,ou=Groups,dc=example,dc=com)(memberOf=cn=Database Users,ou=Groups,dc=example,dc=com)) ldap_access_filter accepts standa...