Hello, I have a nomad cluster on AWS whose job has a CSI volume and I set a CloudWatch alarm to check disk full. In the case of the root device, specifying the resource to /
is enough.[1]
However, in the case of CSI volumes, I do not know even what is the best way to see the used percentage of the volume. df
or nomad volume status -verbose <job_name>
print nothing about that.
Only nomad alloc exec -job <job_name> df
gives the information, but I don’t know how to tell the metric to ClouwWatch agent.
$ nomad alloc exec -job mysql sh -c "df -h"
Filesystem Size Used Avail Use% Mounted on
overlay 16G 9.9G 6.2G 62% /
tmpfs 64M 0 64M 0% /dev
tmpfs 977M 0 977M 0% /sys/fs/cgroup
/dev/nvme0n1p1 16G 9.9G 6.2G 62% /alloc
tmpfs 1.0M 0 1.0M 0% /secrets
/dev/nvme1n1 7.9G 5.3G 2.6G 68% /srv/mysql
shm 64M 0 64M 0% /dev/shm
tmpfs 977M 0 977M 0% /proc/acpi
tmpfs 977M 0 977M 0% /proc/scsi
tmpfs 977M 0 977M 0% /sys/firmware
Thanks.
1: Manually Create or Edit the CloudWatch Agent Configuration File - Amazon CloudWatch