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

Support of string value of custom JMX mbeans

    Details

    • Team:
      Team C
    • Sprint:
      Sprint 38
    • Story Points:
      0.2

      Description

      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();
      		}
      

        Attachments

          Activity

            People

            • Assignee:
              mindbound Arets Paeglis (Inactive)
              Reporter:
              kompa3 Tommi Palomäki
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: