Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e10b401d
authored
Mar 08, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add disk usage reporting
parent
e704eb93
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
agent.py
+4
-0
No files found.
agent.py
View file @
e10b401d
...
...
@@ -133,10 +133,14 @@ class SerialLineReceiver(SerialLineReceiverBase):
self
.
lc
.
start
(
5
,
now
=
False
)
def
send_status
(
self
):
disk_usage
=
{(
disk
.
device
.
replace
(
'/'
,
'_'
)):
psutil
.
disk_usage
(
disk
.
mountpoint
)
.
percent
for
disk
in
psutil
.
disk_partitions
()}
args
=
{
"cpu"
:
dict
(
psutil
.
cpu_times
()
.
__dict__
),
"ram"
:
dict
(
psutil
.
virtual_memory
()
.
__dict__
),
"swap"
:
dict
(
psutil
.
swap_memory
()
.
__dict__
),
"uptime"
:
{
"seconds"
:
uptime
.
uptime
()},
"disk"
:
disk_usage
,
"user"
:
{
"count"
:
len
(
psutil
.
get_users
())}}
self
.
send_response
(
response
=
'status'
,
args
=
args
)
...
...
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