Merge "Use dstat to record performance of system-config-run hosts"
This commit is contained in:
commit
4d85fc521a
6
playbooks/roles/dstat-logger/README.rst
Normal file
6
playbooks/roles/dstat-logger/README.rst
Normal file
@ -0,0 +1,6 @@
|
||||
Install, configure, and run a dstat logger
|
||||
|
||||
This is primarily useful for testing where we don't have instances hooked
|
||||
up to cacti. You can use this to get a csv log file at
|
||||
/var/log/dstat-csv.log in test jobs that records similar system performance
|
||||
information.
|
28
playbooks/roles/dstat-logger/tasks/main.yaml
Normal file
28
playbooks/roles/dstat-logger/tasks/main.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
- name: Install dstat
|
||||
become: yes
|
||||
package:
|
||||
name: dstat
|
||||
state: present
|
||||
- name: Install dstat unit
|
||||
become: yes
|
||||
copy:
|
||||
dest: /etc/systemd/system/dstatlogger.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Dstat logging service
|
||||
[Service]
|
||||
User=root
|
||||
ExecStart=/usr/bin/dstat -tcmndrylpg --tcp --swap --output /var/log/dstat-csv.log
|
||||
KillMode=process
|
||||
TimeoutStopSec=300
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: Reload systemd
|
||||
become: yes
|
||||
command: systemctl daemon-reload
|
||||
- name: Start dstat unit
|
||||
become: yes
|
||||
command: systemctl start dstatlogger
|
3
playbooks/service-dstatlogger.yaml
Normal file
3
playbooks/service-dstatlogger.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- hosts: "*:!disabled"
|
||||
roles:
|
||||
- dstat-logger
|
@ -90,6 +90,8 @@
|
||||
command: ansible-playbook -f 50 -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/base.yaml
|
||||
- name: Run bridge service playbook
|
||||
command: ansible-playbook -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/service-bridge.yaml
|
||||
- name: Run dstat logger playbook
|
||||
command: ansible-playbook -v /home/zuul/src/opendev.org/opendev/system-config/playbooks/service-dstatlogger.yaml
|
||||
- name: Run playbook
|
||||
when: run_playbooks is defined
|
||||
loop: "{{ run_playbooks }}"
|
||||
|
@ -17,6 +17,7 @@
|
||||
'/var/log/messages': logs_txt
|
||||
'/var/log/docker': logs
|
||||
'/var/log/containers': logs
|
||||
'/var/log/dstat-csv.log': logs
|
||||
'/etc/iptables/rules.v4': logs_txt
|
||||
'/etc/iptables/rules.v6': logs_txt
|
||||
host-vars:
|
||||
|
Loading…
x
Reference in New Issue
Block a user