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
9cb6ee64
authored
Aug 08, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make it work on centos7
parent
51440125
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
agent.py
+8
-4
No files found.
agent.py
View file @
9cb6ee64
...
...
@@ -46,6 +46,7 @@ mount_template_windows = (
system
=
platform
.
system
()
distros
=
{
'Scientific Linux'
:
'rhel'
,
'CentOS'
:
'rhel'
,
'CentOS Linux'
:
'rhel'
,
'Debian'
:
'debian'
,
'Ubuntu'
:
'debian'
}
if
system
==
'Linux'
:
...
...
@@ -243,7 +244,10 @@ class Context(object):
@staticmethod
def
start_access_server
():
if
system
==
'Linux'
:
subprocess
.
call
((
'/sbin/start'
,
'ssh'
))
try
:
subprocess
.
call
((
'/sbin/start'
,
'ssh'
))
except
OSError
:
subprocess
.
call
((
'/bin/systemctl'
,
'start'
,
'sshd.service'
))
elif
system
==
'Windows'
:
# TODO
...
...
@@ -329,9 +333,9 @@ class SerialLineReceiver(SerialLineReceiverBase):
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__
),
args
=
{
"cpu"
:
dict
(
psutil
.
cpu_times
()
.
_
asdict
()
),
"ram"
:
dict
(
psutil
.
virtual_memory
()
.
_
asdict
()
),
"swap"
:
dict
(
psutil
.
swap_memory
()
.
_
asdict
()
),
"uptime"
:
{
"seconds"
:
uptime
.
uptime
()},
"disk"
:
disk_usage
,
"user"
:
{
"count"
:
len
(
psutil
.
get_users
())}}
...
...
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