1disksup(3)                 Erlang Module Definition                 disksup(3)
2
3
4

NAME

6       disksup - A Disk Supervisor Process
7

DESCRIPTION

9       disksup  is  a process which supervises the available disk space in the
10       system. It is part of the OS_Mon application, see os_mon(6).  Available
11       for Unix and Windows.
12
13       Periodically  checks  the  disks. For each disk or partition which uses
14       more than a certain amount of the available space, the alarm {{disk_al‐
15       most_full, MountedOn}, []} is set.
16
17         On Unix:
18           All (locally) mounted disks are checked, including the swap disk if
19           it is present.
20
21         On WIN32:
22           All logical drives of type "FIXED_DISK" are checked.
23
24       Alarms are reported to the SASL alarm handler, see alarm_handler(3). To
25       set  an  alarm, alarm_handler:set_alarm(Alarm) is called where Alarm is
26       the alarm specified above.
27
28       The alarms are cleared automatically when the alarm cause is no  longer
29       valid.
30

DATA TYPES

32       time()
33
34              Supported units:
35
36                integer() >= 1:
37                  The time interval in minutes.
38
39                {TimeUnit, Time}:
40                  The  time interval Time in a time unit specified by TimeUnit
41                  where TimeUnit is of the type erlang:time_unit() and Time is
42                  a  positive  integer. The time interval needs to be at least
43                  one millisecond long.
44

CONFIGURATION

46       The following configuration parameters can be used to  change  the  de‐
47       fault values for time interval and threshold:
48
49         disk_space_check_interval = time():
50           The time interval for the periodic disk space check. The default is
51           30 minutes.
52
53         disk_almost_full_threshold = float():
54           The threshold, as percentage of total disk space, for how much disk
55           can  be  utilized before the disk_almost_full alarm is set. The de‐
56           fault is 0.80 (80%).
57
58         disksup_posix_only = bool():
59           Specifies whether the disksup helper process should only use  POSIX
60           conformant  commands  (true)  or not. The default is false. Setting
61           this parameter to true can be necessary on  embedded  systems  with
62           stripped-down  versions  of  Unix  tools like df. The returned disk
63           data and alarms can be different when using this option.
64
65           The parameter is ignored on platforms that  are  known  to  not  be
66           POSIX compatible (Windows and SunOS).
67
68       See config(4) for information about how to change the value of configu‐
69       ration parameters.
70

EXPORTS

72       get_disk_data() -> [DiskData]
73
74              Types:
75
76                 DiskData = {Id, TotalKiB, Capacity}
77                  Id = string()
78                  TotalKiB = int()
79                  Capacity = int()
80
81              Returns the result of the latest disk check. Id is a string that
82              identifies  the disk or partition. TotalKiB is the total size of
83              the disk or partition in kibibytes. Capacity is  the  percentage
84              of disk space used.
85
86              The  function  is asynchronous in the sense that it does not in‐
87              voke a disk check, but returns the latest available value.
88
89              Returns [{"none",0,0}] if disksup is not available.
90
91       get_disk_info() -> [DiskData]
92
93              Types:
94
95                 DiskData = {Id, TotalKiB, AvailableKiB, Capacity}
96                  Id = string()
97                  TotalKiB = int()
98                  AvailableKiB = int()
99                  Capacity = int()
100
101              Immediately fetches total space, available  space  and  capacity
102              for local disks. Id is a string that identifies the disk or par‐
103              tition. TotalKiB is the total size of the disk or  partition  in
104              kibibytes. AvailableKiB is the disk space used in kibibytes. Ca‐
105              pacity is the percentage of disk space used.
106
107              Returns [{"none",0,0,0}] if disksup is not available.
108
109       get_disk_info(Path) -> DiskData
110
111              Types:
112
113                 DiskData = [{Id, TotalKiB, AvailableKiB, Capacity}]
114                  Id = string()
115                  TotalKiB = int()
116                  AvailableKiB = int()
117                  Capacity = int()
118
119              Immediately fetches total space, available  space  and  capacity
120              for  a  path.  Id is a string that identifies the disk or parti‐
121              tion. TotalKiB is the total size of the  disk  or  partition  in
122              kibibytes. AvailableKiB is the disk space used in kibibytes. Ca‐
123              pacity is the percentage of disk space used.
124
125              Returns [{Path,0,0,0}] if the Path is invalid or space can't  be
126              determined.  Returns  [{"none",0,0,0}]  if disksup is not avail‐
127              able.
128
129       get_check_interval() -> MS
130
131              Types:
132
133                 MS = int()
134
135              Returns the time interval, in  milliseconds,  for  the  periodic
136              disk space check.
137
138       set_check_interval(Time) -> ok
139
140              Types:
141
142                 Time = time()
143
144              Changes the time interval for the periodic disk space check.
145
146              The  change will take effect after the next disk space check and
147              is non-persist. That is, in case  of  a  process  restart,  this
148              value  is forgotten and the default value will be used. See Con‐
149              figuration above.
150
151       get_almost_full_threshold() -> Percent
152
153              Types:
154
155                 Percent = int()
156
157              Returns the threshold, in percent, for disk space utilization.
158
159       set_almost_full_threshold(Float) -> ok
160
161              Types:
162
163                 Float = float(), 0=<Float=<1
164
165              Changes the threshold, given as a float, for disk space utiliza‐
166              tion.
167
168              The change will take effect during the next disk space check and
169              is non-persist. That is, in case  of  a  process  restart,  this
170              value  is forgotten and the default value will be used. See Con‐
171              figuration above.
172

SEE ALSO

174       alarm_handler(3), os_mon(3)
175
176
177
178Ericsson AB                       os_mon 2.9                        disksup(3)
Impressum