salt.states.disk

Disk monitoring state

Monitor the state of disk resources.

The disk.status function can be used to report that the used space of a filesystem is within the specified limits.

used_space:
  disk.status:
    - name: /dev/xda1
    - maximum: 79%
    - minumum: 11%

It can be used with an onfail requisite, for example, to take additional action in response to or in preparation for other states.

storage_threshold:
  disk.status:
    - name: /dev/xda1
    - maximum: 97%

clear_cache:
  cmd.run:
    - name: rm -r /var/cache/app
    - onfail:
      - disk: storage_threshold
salt.states.disk.status(name, maximum=None, minimum=None)

Return the current disk usage stats for the named mount point

name
Filesystem with which to check used space
minimum
The required minimum amount of used space in percent
maximum
The required maximum amount of used space in percent