Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
ops
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangwei
ops
Commits
3c6de519
Commit
3c6de519
authored
Aug 18, 2017
by
zhangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加不支持项的返回值,值为:99
parent
c11d158f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
check_container_info.py
docker/check_container_info.py
+6
-2
No files found.
docker/check_container_info.py
View file @
3c6de519
...
@@ -41,22 +41,26 @@ def check_container_info(container_name, container_item):
...
@@ -41,22 +41,26 @@ def check_container_info(container_name, container_item):
try
:
try
:
result
=
new_result
[
'networks'
][
'eth0'
][
'rx_bytes'
]
-
old_result
[
'networks'
][
'eth0'
][
'rx_bytes'
]
result
=
new_result
[
'networks'
][
'eth0'
][
'rx_bytes'
]
-
old_result
[
'networks'
][
'eth0'
][
'rx_bytes'
]
except
KeyError
:
except
KeyError
:
result
=
0
result
=
99
elif
container_item
==
"eth0_tx_byte"
:
elif
container_item
==
"eth0_tx_byte"
:
try
:
try
:
result
=
new_result
[
'networks'
][
'eth0'
][
'tx_bytes'
]
-
old_result
[
'networks'
][
'eth0'
][
'tx_bytes'
]
result
=
new_result
[
'networks'
][
'eth0'
][
'tx_bytes'
]
-
old_result
[
'networks'
][
'eth0'
][
'tx_bytes'
]
except
KeyError
:
except
KeyError
:
result
=
0
result
=
99
elif
container_item
==
"blk_io_read"
:
elif
container_item
==
"blk_io_read"
:
r_list
=
new_result
[
'blkio_stats'
][
'io_service_bytes_recursive'
]
r_list
=
new_result
[
'blkio_stats'
][
'io_service_bytes_recursive'
]
for
r_dict
in
r_list
:
for
r_dict
in
r_list
:
if
r_dict
[
'major'
]
==
253
and
r_dict
[
'op'
]
==
"Read"
and
r_dict
[
'minor'
]
==
0
:
if
r_dict
[
'major'
]
==
253
and
r_dict
[
'op'
]
==
"Read"
and
r_dict
[
'minor'
]
==
0
:
result
=
r_dict
[
'value'
]
result
=
r_dict
[
'value'
]
else
:
result
=
99
elif
container_item
==
"blk_io_write"
:
elif
container_item
==
"blk_io_write"
:
w_list
=
new_result
[
'blkio_stats'
][
'io_service_bytes_recursive'
]
w_list
=
new_result
[
'blkio_stats'
][
'io_service_bytes_recursive'
]
for
w_dict
in
w_list
:
for
w_dict
in
w_list
:
if
w_dict
[
'major'
]
==
253
and
w_dict
[
'op'
]
==
"Write"
and
w_dict
[
'minor'
]
==
0
:
if
w_dict
[
'major'
]
==
253
and
w_dict
[
'op'
]
==
"Write"
and
w_dict
[
'minor'
]
==
0
:
result
=
w_dict
[
'value'
]
result
=
w_dict
[
'value'
]
else
:
result
=
99
# block io queue ,目前没有使用,因为获取出来的值为空“[]”
# block io queue ,目前没有使用,因为获取出来的值为空“[]”
elif
container_item
==
"blk_io_queue"
:
elif
container_item
==
"blk_io_queue"
:
result
=
new_result
[
'blkio_stats'
][
'io_queue_recursive'
]
result
=
new_result
[
'blkio_stats'
][
'io_queue_recursive'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment