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 rang #5

Open
xul487290 opened this issue Sep 12, 2016 · 2 comments
Open

IndexError: list index out of rang #5

xul487290 opened this issue Sep 12, 2016 · 2 comments

Comments

@xul487290
Copy link

单独运行python redis_cluster.py 没有问题,Python redis_server.py也没有问题,但运行python redis_monitor.py 有如下报错
Traceback (most recent call last):
File "redis_monitor.py", line 122, in
main()
File "redis_monitor.py", line 119, in main
redis_falcon_monitor.send_data()
File "redis_monitor.py", line 88, in send_data
redis_cluser_info_dict = redis_cluster_info.collect_cluster_info()
File "/usr/local/LeMonitor/falcon-agent/plugin/Redis/redismon/bin/redis_cluster.py", line 48, in collect_cluster_info
cluster_info_dict_all[item_list[0]] = item_list[1]
IndexError: list index out of range

@xul487290
Copy link
Author

def collect_cluster_info(self):
    """Collect cluster info metrics.
        "The redis-cli must be in the command PATH!!!"      

    Returns:
        cluster_info_dict: redis cluster metrics dict.
    """ 
    cluster_command = "redis-cli -h " + self.addr + " -p " + str(self.port) + " --password " + self.password  + "cluster info"
    if (self.password == ""):   # If password is empty, replcate the password arg
        cluster_command = cluster_command.replace("--password"," ")
    cluster_info = commands.getoutput(cluster_command)  
    cluster_info_list =  cluster_info.replace("\r\n"," ").replace("\r","").split(" ")

此处cluster_command变量不能得到数据,--password是不是应该是-a

@banlilin
Copy link

这个应该是cluster哪个文件里面的redis-cli命令找不到 写绝对路径吧

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