disksup(3erl)
πΎ disksup β the Erlang Module Definition, but make it cute
okay so bestie, you're looking at disksup(3erl), and honestly? she's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
disksup β A Disk Supervisor Process. yes babe she supervises. main character energy fr π
πΈ DESCRIPTION πΈ
So disksup is a process that supervises the available disk space in the system. she's part of the OS_Mon application, see os_mon(7). available for Unix and Windows. slay on both platforms π
She periodically checks the disks. for each disk or partition that uses more than a certain amount of the available space, the alarm {{disk_almost_full, MountedOn}, []} is set. yeah, that's the whole thing. she's watching π
- 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). to set an alarm, alarm_handler:set_alarm(Alarm) is called where Alarm is the alarm specified above. iykyk π
The alarms are cleared automatically when the alarm cause is no longer valid. she cleans up after herself, iconic behavior β¨
π¦ DATA TYPES π¦
time()
supported units, bestie:
integer() >= 1β the time interval in minutes.{TimeUnit, Time}β the time intervalTimein a time unit specified byTimeUnitwhereTimeUnitis of the typeerlang:time_unit()andTimeis a positive integer. the time interval needs to be at least one millisecond long. no skimping on ms, ok? π
π 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 is30minutes. every half hour she's like "hello, checking in π "disk_almost_full_threshold = float()β the threshold, as percentage of total disk space, for how much disk can be utilized before thedisk_almost_fullalarm is set. the default is0.80(80%). so like, at 80% she starts getting stressed for you π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. ngl this one's for the embedded girlies π
heads up! the parameter is ignored on platforms that are known to not be POSIX compatible (Windows and SunOS). she said "not you" π
see config(5) 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. so she's giving you the receipts π§Ύβ¨
The function is asynchronous in the sense that it does not invoke a disk check, but returns the latest available value. she's not re-running anything for you, she's just reading from the group chat history π
Returns [{"none",0,0}] if disksup is not available. rip π
get_check_interval() -> MS
types:
MS = int()
Returns the time interval, in milliseconds, for the periodic disk space check. ms babe. milliseconds. precision. β
set_check_interval(Time) -> ok
types:
Time = time()
Changes the time interval for the periodic disk space check. yes you can change her schedule, she's flexible π¦
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. so like, it's not saved to her notes app, if you catch my drift π
get_almost_full_threshold() -> Percent
types:
Percent = int()
Returns the threshold, in percent, for disk space utilization. giving you the number straight up π
set_almost_full_threshold(Float) -> ok
types:
Float = float(), 0=<Float=<1
Changes the threshold, given as a float, for disk space utilization. 0=<Float=<1 bestie, that's the range, don't come in here with 1.5 π«
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. same deal as before, not saving this one either π
π SEE ALSO π
alarm_handler(3erl), os_mon(3erl) β go read those too, they're literally her friends πΈ
okay that's the whole page, you ate that. and for the credits moment: this iconic little page is from Ericsson AB, os_mon version 2.8.2, and it's the disksup(3erl) page. periodt. ππβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms