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

手动取值没问题,网页前端显示Timeout while executing a shell script #44

Open
zhu-lingjie opened this issue Oct 17, 2018 · 3 comments

Comments

@zhu-lingjie
Copy link

大神好!

已经尝试将zabbix-server timeout 改为30。

手动取值没问题:
[2018-10-17 18:47:47] INFO
beanstr: Catalina:type=Server
lst_beanstr: Catalina:type=Server
key: serverInfo
cmdstr: /usr/bin/java -jar /etc/zabbix/zabbix_agent_extend/scripts/cmdline-jmxclient-0.10.3.jar - localhost:10001 'Catalina:type=Server' 'serverInfo'
stdo:
stde: 10/17/2018 18:47:47 +0800 org.archive.jmx.Client serverInfo: Apache Tomcat/8.5.16
retcode: 0

@zhu-lingjie
Copy link
Author

zhu-lingjie commented Oct 18, 2018

zabbix parsing 好像有问题, 不知道怎么解决。
以下是tomcat.conf:
UserParameter=jmx.tomcat.discovery,python /etc/zabbix/zabbix_agent_extend/scripts/tomcat.py --list 2>/dev/null
UserParameter=jmx.tomcat.item[*],python /etc/zabbix/zabbix_agent_extend/scripts/tomcat.py -d -b "$1" -k "$2" -p $3

手动取的时候没有问题,用zabbix-agent就有。
root@zabbix-client scripts]# sudo -u zabbix python tomcat.py -d -p 10001 -b "Catalina:type=GlobalRequestProcessor,name=http-nio-8080" -k requestCount
[2018-10-18 17:37:20] INFO
beanstr: Catalina:type=GlobalRequestProcessor,name=http-nio-8080
lst_beanstr: Catalina:type=GlobalRequestProcessor,name="http-nio-8080"
key: requestCount
cmdstr: /bin/java -jar /etc/zabbix/zabbix_agent_extend/scripts/cmdline-jmxclient-0.10.3.jar - localhost:10001 'Catalina:type=GlobalRequestProcessor,name="http-nio-8080"' 'requestCount'
stdo:
stde: 10/18/2018 17:37:19 +0800 org.archive.jmx.Client requestCount: 46
retcode: 0

46

[root@zabbix-server classes]# zabbix_get -s 10.0.7.168 -k jmx.tomcat.item["Catalina:type=ThreadPool,name=http-nio-8080","currentThreadCount",10001]
Usage: tomcat.py [options]
Get Tomcat Stat

tomcat.py: error: option -p: invalid integer value: 'currentThreadCount'

@qiueer
Copy link
Owner

qiueer commented Nov 14, 2018

tomat监控,手动执行脚本会有点问题,最好是通过zabbix自动执行,然后看日志确定问题

@zhu-lingjie
Copy link
Author

谢谢回复,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

2 participants