Commit 3c6de519 by zhangwei

增加不支持项的返回值,值为:99

parent c11d158f
......@@ -41,22 +41,26 @@ def check_container_info(container_name, container_item):
try:
result = new_result['networks']['eth0']['rx_bytes'] - old_result['networks']['eth0']['rx_bytes']
except KeyError:
result = 0
result = 99
elif container_item == "eth0_tx_byte":
try:
result = new_result['networks']['eth0']['tx_bytes'] - old_result['networks']['eth0']['tx_bytes']
except KeyError:
result = 0
result = 99
elif container_item == "blk_io_read":
r_list = new_result['blkio_stats']['io_service_bytes_recursive']
for r_dict in r_list:
if r_dict['major'] == 253 and r_dict['op'] == "Read" and r_dict['minor'] == 0:
result = r_dict['value']
else:
result = 99
elif container_item == "blk_io_write":
w_list = new_result['blkio_stats']['io_service_bytes_recursive']
for w_dict in w_list:
if w_dict['major'] == 253 and w_dict['op'] == "Write" and w_dict['minor'] == 0:
result = w_dict['value']
else:
result = 99
# block io queue ,目前没有使用,因为获取出来的值为空“[]”
elif container_item == "blk_io_queue":
result = new_result['blkio_stats']['io_queue_recursive']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment