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
54dadb4e
authored
Feb 04, 2014
by
Gregory Nagy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client vm report path vm. domain added
parent
d4be0ad2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
src/client.py
+15
-14
No files found.
src/client.py
View file @
54dadb4e
...
...
@@ -12,6 +12,7 @@ logging.basicConfig()
class
Client
:
def
__init__
(
self
,
config
):
"""
Constructor of the client class that is responsible for handling the
...
...
@@ -69,7 +70,6 @@ class Client:
self
.
beat
=
1
self
.
valid
=
True
def
__connect
(
self
):
"""
This method creates the connection to the queue of the graphite
...
...
@@ -179,14 +179,14 @@ class Client:
for
vm
in
running_vms
:
vm_proc
=
psutil
.
Process
(
vm
[
1
])
if
((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
self
.
name
+
"."
+
"k
vm."
+
metrics
.
append
((
"
vm."
+
vm
[
0
]
+
"."
+
"memory.usage"
+
"
%
d"
%
(
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
])
+
"
%
d"
%
(
time
.
time
())
))
if
((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
self
.
name
+
"."
+
"k
vm."
+
metrics
.
append
((
"
vm."
+
vm
[
0
]
+
"."
+
"cpu.usage"
+
"
%
d"
%
(
vm_proc
.
get_cpu_times
()
.
system
+
vm_proc
.
get_cpu_times
()
.
user
)
...
...
@@ -199,31 +199,32 @@ class Client:
for
vm
in
running_vms
:
for
iname_index
,
iname
in
interfaces_list_enum
:
if
vm
[
0
]
in
iname
:
metrics
.
append
((
self
.
name
+
"."
+
"k
vm."
+
vm
[
0
]
+
"."
+
"network.packages_sent"
+
metrics
.
append
((
"
vm."
+
vm
[
0
]
+
"."
+
"network.packages_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_sent
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
self
.
name
+
"."
+
"k
vm."
+
vm
[
0
]
+
"."
+
"network.packages_recv"
+
metrics
.
append
((
"
vm."
+
vm
[
0
]
+
"."
+
"network.packages_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_recv
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
self
.
name
+
"."
+
"k
vm."
+
metrics
.
append
((
"
vm."
+
vm
[
0
]
+
"."
+
"network"
".bytes_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_sent
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
self
.
name
+
"."
+
"kvm."
+
vm
[
0
]
+
"."
+
"network.bytes_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_recv
metrics
.
append
((
"vm."
+
vm
[
0
]
+
+
"network.bytes_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_recv
+
"
%
d"
%
(
time
.
time
())
))
return
metrics
...
...
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