---
name: "disksup"
section: "3erl"
platform: "linux"
package: "erlang-manpages"
version: "1:25.2.3+dfsg-1+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/disksup"
---

# disksup(3erl)

A Disk Supervisor Process

## NAME

disksup - A Disk Supervisor Process

## DESCRIPTION

*disksup* is a process which supervises the available disk space in the system. It is part of the OS\_Mon application, see [os\_mon(7)](/os_mon/7.md). Available for Unix and Windows.

Periodically checks the disks. For each disk or partition which uses more than a certain amount of the available space, the alarm *{{disk\_almost\_full, MountedOn}, \[\]}* is set.

- **On Unix:**

  All (locally) mounted disks are checked, including the swap disk if it is present.

- **On WIN32:**

  All logical drives of type "FIXED\_DISK" are checked.

Alarms are reported to the SASL alarm handler, see [alarm\_handler(3erl)](/alarm_handler/3erl.md). To set an alarm, *alarm\_handler:set\_alarm(Alarm)* is called where *Alarm* is the alarm specified above.

The alarms are cleared automatically when the alarm cause is no longer valid.

## DATA TYPES

```
time()
```

Supported units:

- ***integer() \>= 1*:**

  The time interval in minutes.

- ***{TimeUnit, Time}*:**

  The time interval *Time* in a time unit specified by *TimeUnit* where *TimeUnit* is of the type *erlang:time\_unit()* and *Time* is a positive integer. The time interval needs to be at least one millisecond long.

## CONFIGURATION

The following configuration parameters can be used to change the default values for time interval and threshold:

- ***disk\_space\_check\_interval = time()*:**

  The time interval for the periodic disk space check. The default is 30 minutes.

- ***disk\_almost\_full\_threshold = float()*:**

  The threshold, as percentage of total disk space, for how much disk can be utilized before the *disk\_almost\_full* alarm is set. The default is 0.80 (80%).

- ***disksup\_posix\_only = bool()*:**

  Specifies whether the *disksup* helper process should only use POSIX conformant commands (*true*) or not. The default is *false*. Setting this parameter to *true* can be necessary on embedded systems with stripped-down versions of Unix tools like *df*. The returned disk data and alarms can be different when using this option.

  The parameter is ignored on platforms that are known to not be POSIX compatible (Windows and SunOS).

See [config(5)](/config/5.md) for information about how to change the value of configuration parameters.

## EXPORTS

**get\_disk\_data() -\> \[DiskData\]**\

Types:

DiskData = {Id, KByte, Capacity}\
\
  Id = string()\
\
  KByte = int()\
\
  Capacity = int()\

Returns the result of the latest disk check. *Id* is a string that identifies the disk or partition. *KByte* is the total size of the disk or partition in kbytes. *Capacity* is the percentage of disk space used.

The function is asynchronous in the sense that it does not invoke a disk check, but returns the latest available value.

Returns *\[{"none",0,0}\]* if *disksup* is not available.

**get\_check\_interval() -\> MS**\

Types:

MS = int()\

Returns the time interval, in milliseconds, for the periodic disk space check.

**set\_check\_interval(Time) -\> ok**\

Types:

Time = time()\

Changes the time interval for the periodic disk space check.

The change will take effect after the next disk space check and is non-persist. That is, in case of a process restart, this value is forgotten and the default value will be used. See Configuration above.

**get\_almost\_full\_threshold() -\> Percent**\

Types:

Percent = int()\

Returns the threshold, in percent, for disk space utilization.

**set\_almost\_full\_threshold(Float) -\> ok**\

Types:

Float = float(), 0=\<Float=\<1\

Changes the threshold, given as a float, for disk space utilization.

The change will take effect during the next disk space check and is non-persist. That is, in case of a process restart, this value is forgotten and the default value will be used. See Configuration above.

## SEE ALSO

[alarm\_handler(3erl)](/alarm_handler/3erl.md), [os\_mon(3erl)](/os_mon/3erl.md)
