Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVM的自动发现规则报错。 #33

Open
hanlln1 opened this issue Jan 11, 2018 · 13 comments
Open

JVM的自动发现规则报错。 #33

hanlln1 opened this issue Jan 11, 2018 · 13 comments

Comments

@hanlln1
Copy link

hanlln1 commented Jan 11, 2018

qq 20180111225314

@qiueer
Copy link
Owner

qiueer commented Jan 15, 2018

按照以下步骤排查下~
1)tomcat是否已正确配置;
2)手动执行,加-d选项看下,看下是否java命令没找着;
3)检查下/tmp/zabbix_*相关日志文件的输出,看是否有报错;

@hanlln1
Copy link
Author

hanlln1 commented Jan 16, 2018

default

@hanlln1
Copy link
Author

hanlln1 commented Jan 16, 2018

请问这个问题怎么解决,加你qq没反应

@hanlln1
Copy link
Author

hanlln1 commented Jan 16, 2018

tim 20180116185023

@hanlln1
Copy link
Author

hanlln1 commented Jan 16, 2018

qq 20180116185543

@hanlln1
Copy link
Author

hanlln1 commented Jan 16, 2018

这些异常的都是取到的数据都是空的,有大批的这种异常

@qiueer
Copy link
Owner

qiueer commented Jan 16, 2018

1)python版本问题,为2.6.6版本,有些过时的输出,影响到json解析,将错误输出重定向到/dev/null,即在配置文件中,增加 2>/dev/null,例如:
UserParameter=jmx.jvm.discovery[*], python $SCRIPPATH/jvm.py --list -g "$1"  2>/dev/null
UserParameter=jmx.jvm.item[*],python $SCRIPPATH/jvm.py -b "$1" -k "$2" -p $3  2>/dev/null
2)环境变量问题,将java命令做个软连接到/usr/sbin/、/usr/bin/、/usr/local/bin目录下

@huangxin121
Copy link

huangxin121 commented Jan 24, 2018

专门注册了GitHub来回复。
先感谢下作者,功能强大,解释详细
你遇到的第二个不支持问题是这样的
tomcat版本问题,tomcat8貌似是不支持这些报错的参数的,比方说
image
image

另外,有一些支持的参数还是报空值,是因为“”传参的问题,修改zabbix_agentd.conf

JVM

UserParameter=jmx.jvm.discovery, /usr/bin/python /usr/local/zabbix/lib/jvm/jvm.py --list
UserParameter=jmx.jvm.item[*],python /usr/local/zabbix/lib/jvm/jvm.py -b "$1" -k "$2" -p "$3"

Tomcat

UserParameter=jmx.tomcat.discovery, /usr/bin/python /usr/local/zabbix/lib/jvm/tomcat.py --list
UserParameter=jmx.tomcat.item[*],python /usr/local/zabbix/lib/jvm/tomcat.py -b "$1" -k "$2" -p "$3"
PS:注意传参变量我加入了双引号
image
第一次那不到值,第二次拿到了
image

最后:再次感谢作者大人!!!

@qiueer
Copy link
Owner

qiueer commented Jan 26, 2018 via email

@igbugs
Copy link

igbugs commented Mar 8, 2018

我也出现这个问题,找了半天没有发现 自动发现的脚步的输出json 有问题,之前是怎么解决的啊?
image

@qiueer
Copy link
Owner

qiueer commented Mar 9, 2018 via email

@qiueer
Copy link
Owner

qiueer commented Mar 9, 2018 via email

@igbugs
Copy link

igbugs commented Mar 12, 2018

谢谢!非常感谢,确实是由于之前由root 手动执行,写的日志,使用zabbix 执行写不进去导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants