disksup(3)
πΎ disksup β bestie's guide to the disk space supervisor π
okay so this is disksup, and it lives in the os_mon application (go read os_mon(6) if you haven't, iykyk). she's the one who watches your disks. on Unix AND on Windows. equal opportunity disk-watcher. π
β¨ NAME β¨
disksup β A Disk Supervisor Process π
πΈ DESCRIPTION πΈ
disksup is literally a process that supervises the available disk space in your system. she's part of the OS_Mon application β see os_mon(6). available for Unix and Windows. no cap.
she checks the disks periodically, on a lil schedule. and for each disk or partition that's using more than a certain amount of the available space, the alarm
{{disk_almost_full, MountedOn}, []}
gets set. like, she's not gonna let your disk fill up in silence, she's gonna tell somebody. π£
π₯οΈ On Unix
All (locally) mounted disks get checked, and yes bestie, that includes the swap disk if it's present.
πͺ On WIN32
All logical drives of type "FIXED_DISK" get checked. that's the vibe check she runs.
Alarms get reported to the SASL alarm handler β see alarm_handler. to set an alarm, alarm_handler:set_alarm(Alarm) is called, where Alarm is the alarm specified up above. π
and the alarms get cleared automatically when the alarm cause is no longer valid. she's not dramatic, she moves on. π§
βοΈ Configuration
these configuration parameters can be used to change the default values for the time interval and the threshold:
disk_space_check_interval = time/0β the time interval for the periodic disk space check. the default is 30 minutes β°disk_almost_full_threshold = float()β the threshold, as a percentage of total disk space, for how much disk can be utilized before thedisk_almost_fullalarm gets set. the default is 0.80 (80%) πdisksup_posix_only = bool()β specifies whether thedisksuphelper process should only use POSIX conformant commands (true) or not. the default isfalse. setting this parameter totruecan be necessary on embedded systems with stripped-down versions of Unix tools likedf. 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 for the info on how to change the value of configuration parameters. π
π See Also
alarm_handler, os_mon
π¦ DATA TYPES π¦
time()
pos_integer() |
{TimeUnit :: erlang:time_unit(), Time :: pos_integer()}.
time unit used for disklog APIs.
supported units are:
integer() >= 1β the time interval in minutes.{TimeUnit, Time}β the time intervalTimein a time unit specified byTimeUnit, whereTimeUnitis of the typeerlang:time_unit/0andTimeis a positive integer. the time interval needs to be at least one millisecond long. β±οΈ
π₯ FUNCTIONS π₯
get_almost_full_threshold() -> Percent :: integer().
returns the threshold, in percent, for disk space utilization. that's it, that's the whole function. π
get_check_interval() -> Milliseconds :: timer:time().
returns the time interval, in milliseconds, for the periodic disk space check.
get_disk_data() -> [DiskData]
when
DiskData :: {Id, TotalKiB, Capacity},
Id :: string(),
TotalKiB :: integer(),
Capacity :: integer().
returns the result of the latest disk check. πΎ
Id is a string that identifies the disk or partition. TotalKiB is the total size of the disk or partition in kibibytes. Capacity is the percentage of disk space used.
this function is asynchronous in the sense that it does not invoke a disk check β it just returns the latest available value she's got on hand. she's not gonna go run and check for you, bestie, she'll hand you what she already knows. π«Ά
returns [{"none",0,0}] if disksup is not available. π
get_disk_info() -> [DiskData]
when
DiskData ::
{Id, TotalKiB, AvailableKiB, Capacity},
Id :: string(),
TotalKiB :: integer(),
AvailableKiB :: integer(),
Capacity :: integer().
immediately fetches total space, available space and capacity for local disks. like right now, no waiting. π₯
Id is a string that identifies the disk or partition. TotalKiB is the total size of the disk or partition in kibibytes. AvailableKiB is the disk space used in kibibytes. Capacity is the percentage of disk space used.
returns [{"none",0,0,0}] if disksup is not available.
get_disk_info(Path :: string()) -> [DiskData]
when
DiskData ::
{Id, TotalKiB, AvailableKiB, Capacity},
Id :: string(),
TotalKiB :: integer(),
AvailableKiB :: integer(),
Capacity :: integer().
immediately fetches total space, available space and capacity for a path. π
Id is a string that identifies the disk or partition. TotalKiB is the total size of the disk or partition in kibibytes. AvailableKiB is the disk space used in kibibytes. Capacity is the percentage of disk space used.
returns [{Path,0,0,0}] if the Path is invalid or space can't be determined. returns [{"none",0,0,0}] if disksup is not available. π
set_almost_full_threshold(Float :: float()) -> ok.
changes the threshold, given as a float (0.0 =< Float =< 1.0), 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. π
set_check_interval(time()) -> ok.
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. π
and that's the whole page, bestie!! π this one's brought to you by Ericsson AB, os_mon version 2.12, dated disksup(3). go forth and never let a disk fill up on your watch. periodt. πβ¨π¦
π¦ where this page comes from
- nixos 26.05: erlang 29.1.2
- nixpkgs unstable: erlang 29.1.2
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms