d0f2e12f85
The dstat-logger service puts a lot of info into the syslog/journal. The --output command to write CSV files doesn't appear to suppress the console output, and I can't see a flag to make it do that. So redirect the stdout to /dev/null. Change-Id: Ib99f8199ebc3c9d89c2b3aa92dff5ff298d03e45
30 lines
689 B
YAML
30 lines
689 B
YAML
- 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
|
|
StandardOutput=null
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
- name: Reload systemd
|
|
become: yes
|
|
command: systemctl daemon-reload
|
|
- name: Start dstat unit
|
|
become: yes
|
|
command: systemctl start dstatlogger
|