Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enoslib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
SAINGRE Dimitri
enoslib
Commits
91bd5b66
Verified
Commit
91bd5b66
authored
4 years ago
by
SIMONIN Matthieu
Browse files
Options
Downloads
Patches
Plain Diff
Replace dstat by dool fork
Fix #73
parent
ac59222f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+0
-2
0 additions, 2 deletions
.gitlab-ci.yml
docs/apidoc/examples/dstat.py
+3
-3
3 additions, 3 deletions
docs/apidoc/examples/dstat.py
enoslib/service/dstat/dstat.py
+15
-3
15 additions, 3 deletions
enoslib/service/dstat/dstat.py
with
18 additions
and
8 deletions
.gitlab-ci.yml
+
0
−
2
View file @
91bd5b66
...
...
@@ -210,7 +210,6 @@ test_dstat$debian$:
#-----------------------------------------------
test_static_run_command$ubuntu$
:
&ubuntu
<<
:
*debian10
allow_failure
:
true
image
:
ubuntu:latest
test_static_gather_facts$ubuntu$
:
...
...
@@ -236,7 +235,6 @@ test_discover_networks$ubuntu$:
test_dstat$ubuntu$
:
<<
:
*ubuntu
allow_failure
:
true
###############################################################################
#
...
...
This diff is collapsed.
Click to expand it.
docs/apidoc/examples/dstat.py
+
3
−
3
View file @
91bd5b66
...
...
@@ -7,7 +7,7 @@ import logging
import
os
import
time
logging
.
basicConfig
(
level
=
logging
.
INFO
)
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
# path to the inventory
inventory
=
os
.
path
.
join
(
os
.
getcwd
(),
"
hosts
"
)
...
...
@@ -18,10 +18,10 @@ conf = Configuration.from_settings(job_type="allow_classic_ssh",
network
=
NetworkConfiguration
(
id
=
"
n1
"
,
type
=
"
prod
"
,
roles
=
[
"
my_network
"
],
site
=
"
rennes
"
)
site
=
"
nancy
"
)
conf
.
add_network_conf
(
network
)
\
.
add_machine
(
roles
=
[
"
control
"
],
cluster
=
"
paravance
"
,
cluster
=
"
grisou
"
,
nodes
=
2
,
primary_network
=
network
)
\
.
finalize
()
...
...
This diff is collapsed.
Click to expand it.
enoslib/service/dstat/dstat.py
+
15
−
3
View file @
91bd5b66
...
...
@@ -11,6 +11,11 @@ from ..utils import _check_path
OUTPUT_FILE
=
"
dstat.csv
"
TMUX_SESSION
=
"
__enoslib_dstat__
"
DOOL_URL
=
(
"
https://raw.githubusercontent.com/
"
"
scottchiefbaker/dool/6b89f2d0b6e38e1c8d706e88a12e020367f5100d/dool
"
)
DOOL_DIR
=
Path
(
"
/opt/enoslib_dool
"
)
DOOL_PATH
=
DOOL_DIR
/
"
dool
"
class
Dstat
(
Service
):
def
__init__
(
...
...
@@ -63,11 +68,18 @@ class Dstat(Service):
with
play_on
(
roles
=
self
.
_roles
,
priors
=
self
.
priors
,
extra_vars
=
self
.
extra_vars
)
as
p
:
p
.
apt
(
name
=
[
"
dstat
"
,
"
tmux
"
],
state
=
"
present
"
)
p
.
apt
(
name
=
[
"
tmux
"
],
state
=
"
present
"
)
# install dool
p
.
file
(
path
=
str
(
DOOL_DIR
),
state
=
"
directory
"
)
p
.
get_url
(
url
=
DOOL_URL
,
dest
=
str
(
DOOL_PATH
),
mode
=
"
0755
"
)
p
.
file
(
path
=
self
.
remote_working_dir
,
recurse
=
"
yes
"
,
state
=
"
directory
"
)
options
=
f
"
{
self
.
options
}
-o
{
OUTPUT_FILE
}
"
p
.
shell
((
f
"
(tmux ls | grep
{
TMUX_SESSION
}
) ||
"
f
"
tmux new-session -s
{
TMUX_SESSION
}
-d
'
exec dstat
{
options
}
'"
),
p
.
shell
(
(
f
"
(tmux ls | grep
{
TMUX_SESSION
}
) ||
"
f
"
tmux new-session -s
{
TMUX_SESSION
}
"
f
"
-d
'
exec
{
DOOL_PATH
}
{
options
}
'"
),
chdir
=
self
.
remote_working_dir
,
display_name
=
f
"
Running dstat with the options
{
options
}
"
,
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment