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

IndexError: list index out of range #16

Closed
duanqichao opened this issue Aug 28, 2017 · 4 comments
Closed

IndexError: list index out of range #16

duanqichao opened this issue Aug 28, 2017 · 4 comments

Comments

@duanqichao
Copy link

为什么会有这个报错
Traceback (most recent call last):
File "/usr/local/zabbix/scripts/mysql_all.py", line 191, in main
value = mysql.get_item_tval(key)
File "/usr/local/zabbix/scripts/mysql_all.py", line 114, in get_item_tval
val = self.get_value(key)
File "/usr/local/zabbix/scripts/mysql_all.py", line 97, in get_value
(value, code) = self._file_cache.get_val_from_json(key)
File "/usr/local/zabbix/scripts/qiueer/python/filecache.py", line 38, in get_val_from_json
resobj = str(alllines[1]).strip()
IndexError: list index out of range

@qiueer
Copy link
Owner

qiueer commented Aug 28, 2017

可能是文件权限的问题,你手动执行,命令行中加多-d选项看下具体报错。
调试完成后,需重新处理下文件权限。

@duanqichao
Copy link
Author

duanqichao commented Sep 4, 2017

mongodb 报错 cannot convert value to numeric type

弄了一晚也没弄好

Value "Usage: mdb_sstat.py [options] Fetch mongodb status mdb_sstat.py: error: no such option: -i" of type "string" is not suitable for value type "Numeric (unsigned)

@qiueer
Copy link
Owner

qiueer commented Sep 13, 2017

用法错了,没有-i这个选项,你改个mongodb.conf配置文件的内容了吧。正确的是如下:

UserParameter=mongodb.discovery,python $SCRIPPATH/mdb_sstat.py --list
UserParameter=mongodb.status[*],python $SCRIPPATH/mdb_sstat.py -p $1 -k "$2"

@duanqichao
Copy link
Author

谢谢

@qiueer qiueer closed this as completed Dec 26, 2017
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