Merge "Allow to enable atop"
This commit is contained in:
commit
01755f8bdf
@ -387,6 +387,7 @@
|
|||||||
'{{ devstack_conf_dir }}/.localrc.auto': logs
|
'{{ devstack_conf_dir }}/.localrc.auto': logs
|
||||||
'{{ devstack_conf_dir }}/.stackenv': logs
|
'{{ devstack_conf_dir }}/.stackenv': logs
|
||||||
'{{ devstack_log_dir }}/dstat-csv.log': logs
|
'{{ devstack_log_dir }}/dstat-csv.log': logs
|
||||||
|
'{{ devstack_log_dir }}/atop': logs
|
||||||
'{{ devstack_log_dir }}/devstacklog.txt': logs
|
'{{ devstack_log_dir }}/devstacklog.txt': logs
|
||||||
'{{ devstack_log_dir }}/devstacklog.txt.summary': logs
|
'{{ devstack_log_dir }}/devstacklog.txt.summary': logs
|
||||||
'{{ devstack_log_dir }}/tcpdump.pcap': logs
|
'{{ devstack_log_dir }}/tcpdump.pcap': logs
|
||||||
|
48
lib/atop
Normal file
48
lib/atop
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# lib/atop
|
||||||
|
# Functions to start and stop atop
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
|
#
|
||||||
|
# - ``functions`` file
|
||||||
|
|
||||||
|
# ``stack.sh`` calls the entry points in this order:
|
||||||
|
#
|
||||||
|
# - configure_atop
|
||||||
|
# - install_atop
|
||||||
|
# - start_atop
|
||||||
|
# - stop_atop
|
||||||
|
|
||||||
|
# Save trace setting
|
||||||
|
_XTRACE_ATOP=$(set +o | grep xtrace)
|
||||||
|
set +o xtrace
|
||||||
|
|
||||||
|
function configure_atop {
|
||||||
|
cat <<EOF | sudo tee /etc/default/atop >/dev/null
|
||||||
|
# /etc/default/atop
|
||||||
|
# see man atoprc for more possibilities to configure atop execution
|
||||||
|
|
||||||
|
LOGOPTS="-R"
|
||||||
|
LOGINTERVAL=${ATOP_LOGINTERVAL:-"30"}
|
||||||
|
LOGGENERATIONS=${ATOP_LOGGENERATIONS:-"1"}
|
||||||
|
LOGPATH=$LOGDIR/atop
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_atop {
|
||||||
|
install_package atop
|
||||||
|
}
|
||||||
|
|
||||||
|
# start_() - Start running processes
|
||||||
|
function start_atop {
|
||||||
|
start_service atop
|
||||||
|
}
|
||||||
|
|
||||||
|
# stop_atop() stop atop process
|
||||||
|
function stop_atop {
|
||||||
|
stop_service atop
|
||||||
|
}
|
||||||
|
|
||||||
|
# Restore xtrace
|
||||||
|
$_XTRACE_ATOP
|
7
stack.sh
7
stack.sh
@ -641,6 +641,7 @@ source $TOP_DIR/lib/swift
|
|||||||
source $TOP_DIR/lib/neutron
|
source $TOP_DIR/lib/neutron
|
||||||
source $TOP_DIR/lib/ldap
|
source $TOP_DIR/lib/ldap
|
||||||
source $TOP_DIR/lib/dstat
|
source $TOP_DIR/lib/dstat
|
||||||
|
source $TOP_DIR/lib/atop
|
||||||
source $TOP_DIR/lib/tcpdump
|
source $TOP_DIR/lib/tcpdump
|
||||||
source $TOP_DIR/lib/etcd3
|
source $TOP_DIR/lib/etcd3
|
||||||
source $TOP_DIR/lib/os-vif
|
source $TOP_DIR/lib/os-vif
|
||||||
@ -1093,6 +1094,12 @@ save_stackenv $LINENO
|
|||||||
# A better kind of sysstat, with the top process per time slice
|
# A better kind of sysstat, with the top process per time slice
|
||||||
start_dstat
|
start_dstat
|
||||||
|
|
||||||
|
if is_service_enabled atop; then
|
||||||
|
configure_atop
|
||||||
|
install_atop
|
||||||
|
start_atop
|
||||||
|
fi
|
||||||
|
|
||||||
# Run a background tcpdump for debugging
|
# Run a background tcpdump for debugging
|
||||||
# Note: must set TCPDUMP_ARGS with the enabled service
|
# Note: must set TCPDUMP_ARGS with the enabled service
|
||||||
if is_service_enabled tcpdump; then
|
if is_service_enabled tcpdump; then
|
||||||
|
@ -73,6 +73,7 @@ source $TOP_DIR/lib/swift
|
|||||||
source $TOP_DIR/lib/neutron
|
source $TOP_DIR/lib/neutron
|
||||||
source $TOP_DIR/lib/ldap
|
source $TOP_DIR/lib/ldap
|
||||||
source $TOP_DIR/lib/dstat
|
source $TOP_DIR/lib/dstat
|
||||||
|
source $TOP_DIR/lib/atop
|
||||||
source $TOP_DIR/lib/etcd3
|
source $TOP_DIR/lib/etcd3
|
||||||
|
|
||||||
# Extras Source
|
# Extras Source
|
||||||
@ -174,6 +175,10 @@ fi
|
|||||||
|
|
||||||
stop_dstat
|
stop_dstat
|
||||||
|
|
||||||
|
if is_service_enabled atop; then
|
||||||
|
stop_atop
|
||||||
|
fi
|
||||||
|
|
||||||
# NOTE: Cinder automatically installs the lvm2 package, independently of the
|
# NOTE: Cinder automatically installs the lvm2 package, independently of the
|
||||||
# enabled backends. So if Cinder is enabled, and installed successfully we are
|
# enabled backends. So if Cinder is enabled, and installed successfully we are
|
||||||
# sure lvm2 (lvremove, /etc/lvm/lvm.conf, etc.) is here.
|
# sure lvm2 (lvremove, /etc/lvm/lvm.conf, etc.) is here.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user