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
34d2ee59
authored
Nov 25, 2013
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed collectables error: list hash and scheduler
parent
34f94315
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
config/client.conf
+8
-8
src/client.py
+3
-3
src/cnfparse.py
+1
-1
src/collectables.py
+7
-7
No files found.
config/client.conf
View file @
34d2ee59
[
Client
]
Debug
=
Tru
e
Debug
=
Fals
e
[
Metrics
]
cpuUsage
=
True
memoryUsage
=
True
userCount
=
True
swapUsage
=
True
systemBootTime
=
True
packageTraffic
=
True
dataTraffic
=
True
cpuUsage
=
5
memoryUsage
=
5
userCount
=
60
swapUsage
=
30
systemBootTime
=
120
packageTraffic
=
10
dataTraffic
=
10
src/client.py
View file @
34d2ee59
...
...
@@ -60,7 +60,7 @@ class Client:
"""
Send the message given in the parameters.
"""
self
.
channel
.
basic_publish
(
exchange
=
self
.
amqp_queue
,
self
.
channel
.
basic_publish
(
exchange
=
self
.
amqp_queue
,
routing_key
=
''
,
body
=
"
\n
"
.
join
(
message
))
def
__collectFromNode
(
self
,
metricCollectors
):
...
...
@@ -96,9 +96,9 @@ class Client:
%
(
self
.
server_address
+
":"
+
str
(
self
.
server_port
)))
else
:
print
(
"Connection established to
%
s on port
%
s.
\
Report frequency is
%
d sec.
Clientname:
%
s"
Clientname:
%
s"
%
(
self
.
server_address
,
self
.
server_port
,
self
.
delay
,
self
.
name
))
self
.
name
))
try
:
maxFrequency
=
self
.
getMaxFrequency
(
metricCollectors
)
while
True
:
...
...
src/cnfparse.py
View file @
34d2ee59
...
...
@@ -21,7 +21,7 @@ def importConf(path_to_file):
except
configparser
.
ParsingError
:
print
(
"Config file contains error! Reason: Cannot parse."
)
raise
except
configparser
.
MissingSectionHeader
:
except
configparser
.
MissingSectionHeader
Error
:
print
(
"Config file contains error! Reason: Missing section-header."
)
raise
...
...
src/collectables.py
View file @
34d2ee59
...
...
@@ -32,15 +32,15 @@ class collectables:
@staticmethod
def
provide
(
requests
=
[]):
#valid_keys = collectables.listKeys()
reqs
=
[
request
for
request
,
value
in
requests
.
items
()
if
value
>
0
]
reqs
=
[]
for
requests
,
value
in
requests
.
items
():
if
value
>
0
:
reqs
.
append
([
requests
,
value
])
collectors
=
[]
for
request
in
reqs
:
for
item
in
collectables
.
__collectables
[
request
]:
collectors
.
append
([
item
.
harvest
,
value
])
seen
=
set
()
seen_add
=
seen
.
add
return
[
x
for
x
in
collectors
if
x
not
in
seen
and
not
seen_add
(
x
)]
for
item
in
collectables
.
__collectables
[
request
[
0
]]:
collectors
.
append
([
item
.
harvest
,
request
[
1
]])
return
collectors
@staticmethod
def
provideAll
():
...
...
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