Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
monitor-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6abc6969
authored
Jan 21, 2020
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psutil exception handling in collect_vms
parent
992a796d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/client.py
+4
-4
No files found.
src/client.py
View file @
6abc6969
...
@@ -157,8 +157,8 @@ class Client:
...
@@ -157,8 +157,8 @@ class Client:
now
=
time
.
time
()
now
=
time
.
time
()
running_vms
=
[]
running_vms
=
[]
for
entry
in
psutil
.
get_process_list
()
:
try
:
try
:
for
entry
in
psutil
.
get_process_list
()
:
if
entry
.
name
()
in
(
'kvm'
,
'qemu-system-x86_64'
):
if
entry
.
name
()
in
(
'kvm'
,
'qemu-system-x86_64'
):
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-name'
)
parser
.
add_argument
(
'-name'
)
...
@@ -191,8 +191,8 @@ class Client:
...
@@ -191,8 +191,8 @@ class Client:
else
:
else
:
logger
.
warning
(
'Pid:
%
d args.name is empty?:
%
s
%
s'
,
entry
.
pid
,
entry
.
name
(),
entry
.
cmdline
())
logger
.
warning
(
'Pid:
%
d args.name is empty?:
%
s
%
s'
,
entry
.
pid
,
entry
.
name
(),
entry
.
cmdline
())
except
psutil
.
NoSuchProcess
,
TypeError
:
except
(
psutil
.
NoSuchProcess
,
TypeError
)
:
logger
.
warning
(
'Process
%
d lost. Entry:
%
s'
,
entry
.
pid
,
entry
.
cmdline
()[
1
:])
logger
.
warning
(
'Process
%
d lost. Entry:
%
s'
,
entry
.
pid
,
entry
.
cmdline
()[
0
:])
interfaces
=
psutil
.
network_io_counters
(
pernic
=
True
)
interfaces
=
psutil
.
network_io_counters
(
pernic
=
True
)
for
interface
,
data
in
interfaces
.
iteritems
():
for
interface
,
data
in
interfaces
.
iteritems
():
...
...
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