码迷,mamicode.com
首页 > Web开发 > 详细

jstat版本不兼容问题

时间:2016-06-12 00:32:21      阅读:571      评论:0      收藏:0      [点我收藏+]

标签:java   jstat   

一 问题描述

 我使用jstat命令来监控Java应用,前端时间调试Logstash的时候,Logstash单独指定JDK1.8,但是服务器上其他Java应用还是使用的JDK1.7,监控脚本jstat_status.py指定的jstat还是1.7版本

 http://john88wang.blog.51cto.com/2165294/1708302



 Logstash的监控信息没有收集到,Zabbix server端有报错信息


 12257:20160611:144426.851 error reason for "xxxxxxxx:java.discovery_status[logstash_shipper,all]" changed: Received value [Warning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.space.0.used substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.minCapacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.maxCapacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.capacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.space.0.used substituted NaNWarning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaNTraceback (most recent call last):  File "/opt/app/zabbix/sbin/jstat_status.py", line 181, in <module>    jproc.compute_jstats()                              File "/opt/app/zabbix/sbin/jstat_status.py", line 115, in compute_jstats    self.zdict[‘Perm_used‘] = format(float(self.pdict[‘PU‘]) * 1024,‘0.2f‘)ValueError: invalid literal for float(): ?] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]



二 问题解决

 单独使用jstat查看

 

$ sudo /opt/app/jdk1.8/bin/jstat  -gcutil 1634 
  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT   
 68.67   0.00  35.78   5.98  92.24  89.23      4    0.584     2    0.188    0.772


]$ sudo jstat -gcutil 1634 
Warning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaN
Warning: Unresolved Symbol: sun.gc.generation.2.space.0.used substituted NaN
Warning: Unresolved Symbol: sun.gc.generation.2.space.0.capacity substituted NaN
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
  0.00  92.09  70.17   4.13            3    0.543     2    0.188    0.730

jstat1.8 jstat1.7的输出不同,jstat 1.7 有 P这个项目表示Permanent space utilization as a percentage of the space‘s current capacity.

jstat1.8 没有P这个项目,而是有个M和CCS两个项目分别表示

Metaspace utilization as a percentage of the space‘s current capacity.  和 

Compressed class space utilization as a percentage.


将logstsh的jdk版本调整到1.7问题得到解决







本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1787948

jstat版本不兼容问题

标签:java   jstat   

原文地址:http://john88wang.blog.51cto.com/2165294/1787948

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!