disksup(3erl)

πŸ“¦
version 25.3.2.8 Β· 4 versions
, in ubuntu noble

πŸ’Ύ 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 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. 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 is 30 minutes. 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 the disk_almost_full alarm is set. the default is 0.80 (80%). so like, at 80% she starts getting stressed for you 😭
  • 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. 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