seuf / zabbix_java

Zabbix Java Gateway sources updated to allow jmx.discovery, jboss and t3 monitoring
5 stars 5 forks source link

Some questions about zabbix_java #1

Open mawenjie85 opened 7 years ago

mawenjie85 commented 7 years ago

Hi,seuf.First of all, thank you very much for giving!

My zabbix version is 3.2.1, and I used your zabbix_java Code,but I can not receive the value. Open the debug mode,I can only see the send message like below:

2016-12-16 16:54:51.648 [pool-1-thread-3] INFO  com.zabbix.gateway.JMXItemChecker - Using url 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime' with user 'weblogic'
2016-12-16 16:54:51.649 [pool-1-thread-3] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime'
2016-12-16 16:54:51.664 [pool-1-thread-3] DEBUG com.zabbix.gateway.SocketProcessor - dispatched request to class com.zabbix.gateway.JMXItemChecker
2016-12-16 16:54:51.664 [pool-1-thread-3] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime'
2016-12-16 16:54:51.675 [pool-1-thread-3] DEBUG com.zabbix.gateway.ItemChecker - getting value for item 'jmx.discovery["com.bea:DomainConfiguration=*,Name=*",Servers]'
2016-12-16 16:54:51.678 [pool-1-thread-3] DEBUG com.zabbix.gateway.ItemChecker - received value '{
  "data": []
}' for item 'jmx.discovery["com.bea:DomainConfiguration=*,Name=*",Servers]'
2016-12-16 16:54:51.679 [pool-1-thread-3] DEBUG c.z.gateway.BinaryProtocolSpeaker - sending the following data in response: {"response":"success","data":[{"value":"{\n  \"data\": []\n}"}]}
2016-12-16 16:54:51.680 [pool-1-thread-3] DEBUG com.zabbix.gateway.SocketProcessor - finished processing incoming connection
2016-12-16 16:55:21.659 [pool-1-thread-2] DEBUG com.zabbix.gateway.SocketProcessor - starting to process incoming connection
2016-12-16 16:55:21.659 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading Zabbix protocol header
2016-12-16 16:55:21.660 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 8 bytes of data length
2016-12-16 16:55:21.660 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 190 bytes of request data
2016-12-16 16:55:21.660 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - received the following data in request: {"request":"java gateway jmx","conn":"10.200.160.53","port":17101,"username":"weblogic:t3","password":"Weblogic01","keys":["jmx.discovery[\"com.bea:DomainConfiguration=*,Name=*\",Servers]"]}
2016-12-16 16:55:21.660 [pool-1-thread-2] INFO  com.zabbix.gateway.JMXItemChecker - Using url 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime' with user 'weblogic'
2016-12-16 16:55:21.660 [pool-1-thread-2] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime'
2016-12-16 16:55:21.675 [pool-1-thread-2] DEBUG com.zabbix.gateway.SocketProcessor - dispatched request to class com.zabbix.gateway.JMXItemChecker
2016-12-16 16:55:21.675 [pool-1-thread-2] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:t3://10.200.160.53:17101/jndi/weblogic.management.mbeanservers.runtime'
2016-12-16 16:55:21.686 [pool-1-thread-2] DEBUG com.zabbix.gateway.ItemChecker - getting value for item 'jmx.discovery["com.bea:DomainConfiguration=*,Name=*",Servers]'
2016-12-16 16:55:21.689 [pool-1-thread-2] DEBUG com.zabbix.gateway.ItemChecker - received value '{
  "data": []
}' for item 'jmx.discovery["com.bea:DomainConfiguration=*,Name=*",Servers]'
2016-12-16 16:55:21.690 [pool-1-thread-2] DEBUG c.z.gateway.BinaryProtocolSpeaker - sending the following data in response: {"response":"success","data":[{"value":"{\n  \"data\": []\n}"}]}
2016-12-16 16:55:21.690 [pool-1-thread-2] DEBUG com.zabbix.gateway.SocketProcessor - finished processing incoming connection

And, I find some templates of JMX 5days ago,is that can match this zabbix_java? If not,can you show me how to write the key of zabbix frontend. Thank you very much! Look forward to your reply!

seuf commented 7 years ago

Hi, you can use templates from this repo : https://github.com/seuf/zabbix_templates The Weblogic Admin template is not working currently, because the weblogic t3 url is different for admin MBeans. weblogic.management.mbeanservers.runtime should be weblogic.management.mbeanservers.domainruntime for Weblogic Admin instances.

mawenjie85 commented 7 years ago

Hi,3Q for your reply! But I have another qustion:Some Mbeans I can not get the value directly because I have to calling the method to get it. For example,the HealthStat of ServerRuntime,I have to get the value by calling "Attribute.HealthState.Method.getState" using IBM Agent Builder. So Status of WTCRuntime is. So, do you know how to do in zabbix? Thank you very much! Look forward to your reply!