Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-4558

Support of string value of custom JMX mbeans

XMLWordPrintable

    • Sprint 38
    • 0.2

      Background

      Zabbix v3.4 allows the usage of custom JMX endpoints and you can monitor eg. WebLogic by adding wlfullclient.jar to Java Gateway's classpath (see ZBXNEXT-1935). Currently however, custom WebLogic mbean classes are not supported and you cannot monitor such JMX values with Zabbix.

      For example, item jmx["com.bea:ServerRuntime=nnn,Name=nnn,Location=nnn,Type=ApplicationRuntime",HealthState] produces the following error:

      data object type is not primitive: class weblogic.health.HealthState
      

      Most JMX consoles support arbitrary mbean classes by calling their toString() method, even though the mbean object is not defined in JMX standard (ie. it's not a primitive object type, TabularData or CompositeData).

      Feature request

      I suggest that Zabbix Java Gateway supports any mbean classes by calling their toString() method - if there is no field name defined in item definition.

      Consequently, the string representation can be parsed in Zabbix server using preprocessing such as regular expression.

      Code changes

      In JMXItemChecker.java, function getPrimitiveAttributeValue().

      Current code:

      if (fieldNames.equals(""))
      		{
      			if (isPrimitiveAttributeType(dataObject.getClass()))
      				return dataObject.toString();
      			else
      				throw new ZabbixException("data object type is not primitive: %s" + dataObject.getClass());
      		}
      

      Suggested change:

      if (fieldNames.equals(""))
      		{
      			return dataObject.toString();
      		}
      

            mindbound Arets Paeglis (Inactive)
            kompa3 Tommi Palomäki
            Team C
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: