.TH disksup 3erl "os_mon 2.8" "Ericsson AB" "Erlang Module Definition" .SH NAME disksup \- A Disk Supervisor Process .SH DESCRIPTION .LP \fIdisksup\fR\& is a process which supervises the available disk space in the system\&. It is part of the OS_Mon application, see os_mon(7)\&. Available for Unix and Windows\&. .LP Periodically checks the disks\&. For each disk or partition which uses more than a certain amount of the available space, the alarm \fI{{disk_almost_full, MountedOn}, []}\fR\& is set\&. .RS 2 .TP 2 .B On Unix: All (locally) mounted disks are checked, including the swap disk if it is present\&. .TP 2 .B On WIN32: All logical drives of type "FIXED_DISK" are checked\&. .RE .LP Alarms are reported to the SASL alarm handler, see alarm_handler(3erl)\&. To set an alarm, \fIalarm_handler:set_alarm(Alarm)\fR\& is called where \fIAlarm\fR\& is the alarm specified above\&. .LP The alarms are cleared automatically when the alarm cause is no longer valid\&. .SH DATA TYPES .nf .B time() .br .fi .RS .LP Supported units: .RS 2 .TP 2 .B \fIinteger() >= 1\fR\&: The time interval in minutes\&. .TP 2 .B \fI{TimeUnit, Time}\fR\&: The time interval \fITime\fR\& in a time unit specified by \fITimeUnit\fR\& where \fITimeUnit\fR\& is of the type \fIerlang:time_unit()\fR\& and \fITime\fR\& is a positive integer\&. The time interval needs to be at least one millisecond long\&. .RE .RE .SH "CONFIGURATION" .LP The following configuration parameters can be used to change the default values for time interval and threshold: .RS 2 .TP 2 .B \fIdisk_space_check_interval = \fR\&\fItime()\fR\&: The time interval for the periodic disk space check\&. The default is 30 minutes\&. .TP 2 .B \fIdisk_almost_full_threshold = float()\fR\&: The threshold, as percentage of total disk space, for how much disk can be utilized before the \fIdisk_almost_full\fR\& alarm is set\&. The default is 0\&.80 (80%)\&. .TP 2 .B \fIdisksup_posix_only = bool()\fR\&: Specifies whether the \fIdisksup\fR\& helper process should only use POSIX conformant commands (\fItrue\fR\&) or not\&. The default is \fIfalse\fR\&\&. Setting this parameter to \fItrue\fR\& can be necessary on embedded systems with stripped-down versions of Unix tools like \fIdf\fR\&\&. The returned disk data and alarms can be different when using this option\&. .RS 2 .LP The parameter is ignored on platforms that are known to not be POSIX compatible (Windows and SunOS)\&. .RE .RE .LP See config(5) for information about how to change the value of configuration parameters\&. .SH EXPORTS .LP .B get_disk_data() -> [DiskData] .br .RS .LP Types: .RS 3 DiskData = {Id, KByte, Capacity} .br Id = string() .br KByte = int() .br Capacity = int() .br .RE .RE .RS .LP Returns the result of the latest disk check\&. \fIId\fR\& is a string that identifies the disk or partition\&. \fIKByte\fR\& is the total size of the disk or partition in kbytes\&. \fICapacity\fR\& is the percentage of disk space used\&. .LP The function is asynchronous in the sense that it does not invoke a disk check, but returns the latest available value\&. .LP Returns \fI[{"none",0,0}]\fR\& if \fIdisksup\fR\& is not available\&. .RE .LP .B get_check_interval() -> MS .br .RS .LP Types: .RS 3 MS = int() .br .RE .RE .RS .LP Returns the time interval, in milliseconds, for the periodic disk space check\&. .RE .LP .B set_check_interval(Time) -> ok .br .RS .LP Types: .RS 3 Time = time() .br .RE .RE .RS .LP Changes the time interval for the periodic disk space check\&. .LP 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\&. .RE .LP .B get_almost_full_threshold() -> Percent .br .RS .LP Types: .RS 3 Percent = int() .br .RE .RE .RS .LP Returns the threshold, in percent, for disk space utilization\&. .RE .LP .B set_almost_full_threshold(Float) -> ok .br .RS .LP Types: .RS 3 Float = float(), 0=