Erlang -- disksup

Reference Manual
Release Notes
PDF
Top

OS_Mon
Reference Manual
Version 2.4.1

Expand All
Contract All

Table of Contents

- os_mon (App)
- cpu_sup
  - Top of manual page
  - avg1/0
  - avg15/0
  - avg5/0
  - nprocs/0
  - util/0
  - util/1
- disksup
  - Top of manual page
  - get_almost_full_threshold/0
  - get_check_interval/0
  - get_disk_data/0
  - set_almost_full_threshold/1
  - set_check_interval/1
- memsup
  - Top of manual page
  - get_check_interval/0
  - get_helper_timeout/0
  - get_memory_data/0
  - get_os_wordsize/0
  - get_procmem_high_watermark/0
  - get_sysmem_high_watermark/0
  - get_system_memory_data/0
  - set_check_interval/1
  - set_helper_timeout/1
  - set_procmem_high_watermark/1
  - set_sysmem_high_watermark/1
- os_mon_mib
  - Top of manual page
  - load/1
  - unload/1
- os_sup
  - Top of manual page
  - disable/0
  - disable/2
  - enable/0
  - enable/2
- nteventlog
  - Top of manual page
  - start/2
  - start_link/2
  - stop/0

# disksup

### MODULE

disksup

### MODULE SUMMARY

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(6). 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(3). 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.

### Configuration

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

disk_space_check_interval = int()>0

  The time interval, in minutes, 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(4) 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(Minutes) -> ok

Types:

Minutes = int()>=1

Changes the time interval, given in minutes, 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(3), os_mon(3)