CN105260140A - Disk size monitoring method and apparatus - Google Patents

Disk size monitoring method and apparatus Download PDF

Info

Publication number
CN105260140A
CN105260140A CN201510689602.7A CN201510689602A CN105260140A CN 105260140 A CN105260140 A CN 105260140A CN 201510689602 A CN201510689602 A CN 201510689602A CN 105260140 A CN105260140 A CN 105260140A
Authority
CN
China
Prior art keywords
capacity
disk
occupancy rate
occupied
warning information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510689602.7A
Other languages
Chinese (zh)
Inventor
宗栋瑞
郭美思
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510689602.7A priority Critical patent/CN105260140A/en
Publication of CN105260140A publication Critical patent/CN105260140A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a disk size monitoring method and an apparatus. The method comprises acquiring current first occupancy rate of a first disk. The first occupancy rate comprises a specific value between first occupation capacity and first original capacity; the first occupation capacity consists of capacity occupying storage space of the first disk; and the first original capacity comprises maximum storage space capacity of the first disk. When a user stores an application program to the disk, current occupancy capacity of the disk can be acquired, so a problem that the application program cannot be written to the disk due to inadequate storage space; and disk utilization rate can be improved.

Description

Disk capacity monitoring method and device
Technical Field
The invention relates to the field of computers, in particular to a method and a device for monitoring disk capacity.
Background
With the development of science and technology, computers have become an indispensable part of people's daily life and work.
In general, an application program is stored in a magnetic disk so that a computer automatically processes mass data at high speed according to the program stored in the magnetic disk. If the disk capacity is insufficient or the application program itself has a problem, the application program cannot be written into the disk, and thus the important application program cannot run normally.
However, in the process of implementing the foregoing prior art, a person skilled in the art finds that, in a Linux operating system, in any case where an application cannot be written into a disk, only information that the application cannot be stored in the disk is prompted to a user, so that the user cannot determine a reason why the application cannot be written into the disk, and thus the usage efficiency of the disk is low.
Disclosure of Invention
The invention provides a method and a device for monitoring the capacity of a disk, which are used for solving the problem that an application program is stored in the disk.
A first aspect of the present invention is to provide a disk capacity monitoring method,
acquiring a current first occupancy rate of a first disk, wherein the first occupancy rate comprises a ratio of a first occupied capacity to a first original capacity, the first occupied capacity comprises a capacity of a storage space of the first disk, and the first original capacity comprises a capacity of a maximum storage space of the first disk;
and determining whether to send early warning information to a user or not according to the first occupancy rate, wherein the early warning information is used for prompting the user of the occupied capacity of the disk.
Further, the acquiring the current first occupancy rate of the first disk includes:
acquiring use data of at least one disk, wherein the use data at least comprises the original capacity, occupied capacity and residual capacity of each disk;
determining first usage data of the first disk according to the usage data, wherein the first usage data at least comprises at least one of the first original capacity and the first occupied capacity or a combination thereof;
and comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk.
Further, the determining whether to send the warning information to the user according to the first occupancy rate includes:
if the first occupancy rate is larger than a preset value, the early warning information is sent to a user;
and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
Further, the method also comprises the following steps: setting preset information, wherein the preset information comprises a destination address for sending the early warning information;
the sending the early warning information to the user includes:
and sending the early warning information to a destination address indicated by the preset information according to the preset information.
A second aspect of the present invention provides a disk capacity monitoring apparatus, including:
an obtaining module, configured to obtain a current first occupancy rate of a first disk, where the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk;
and the sending module is used for determining whether to send early warning information to a user or not according to the first occupancy rate, wherein the early warning information is used for prompting the user of the occupied capacity of the disk.
Further, the obtaining module is specifically configured to obtain usage data of at least one disk, where the usage data at least includes an original capacity, an occupied capacity, and a remaining capacity of each disk; determining first usage data of the first disk according to the usage data, wherein the first usage data at least comprises at least one of the first original capacity and the first occupied capacity or a combination thereof; and comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk.
Further, the sending module is specifically configured to send the warning information to a user if the first occupancy rate is greater than a preset value; and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
Further, the method also comprises the following steps: setting a module;
the setting module is used for setting preset information, and the preset information comprises a destination address for sending the early warning information;
the sending module is further configured to send the early warning information to a destination address indicated by preset information according to the preset information.
In this embodiment, by obtaining a current first occupancy rate of a first disk, the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, where the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk. The current occupied capacity of the disk can be obtained when the user stores the application program to the disk or in the process of storing the application program to the disk by the user, so that the problem that the application program cannot be written into the disk due to insufficient storage space is avoided, and the use efficiency of the disk is improved.
Drawings
FIG. 1 is a flow chart illustrating a method for monitoring disk capacity according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a disk capacity monitoring apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a disk capacity monitoring apparatus according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a disk capacity monitoring method according to an embodiment of the present invention, and as shown in fig. 1, the disk capacity monitoring method includes:
step 101, acquiring a current first occupancy rate of a first disk.
In this embodiment, the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk.
For example, according to a preset period, the current first occupancy rate of the first disk is obtained.
The method for acquiring the current first occupancy rate of the first disk at least comprises the following implementation modes:
in a first implementation manner, the current first occupancy rate of the first disk is directly obtained.
Firstly, obtaining the use data of at least one disk, wherein the use data at least comprises the original capacity, the occupied capacity and the residual capacity of each disk, and then, determining first use data of the first disk according to the use data, wherein the first use data at least comprises at least one or the combination of the first original capacity and the first occupied capacity; then, comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk. For example, in a Linux operating system, a terminal device, such as a server or a computer, may be connected to a plurality of disks, first check the usage of the disks through a df command, then filter out first usage data of a first disk, and then obtain data fields in the usage of the first disk through an awk command, thereby obtaining a first occupancy rate.
And step 102, determining whether to send early warning information to a user or not according to the first occupancy rate.
In this embodiment, the warning information is used to prompt a user of the occupied capacity of the disk.
In this embodiment, by obtaining a current first occupancy rate of a first disk, the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, where the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk. The current occupied capacity of the disk can be obtained when the user stores the application program to the disk or in the process of storing the application program to the disk by the user, so that the problem that the application program cannot be written into the disk due to insufficient storage space is avoided, and the use efficiency of the disk is improved.
On the basis of the above embodiment, the determining whether to send warning information to the user according to the first occupancy includes:
if the first occupancy rate is larger than a preset value, the early warning information is sent to a user;
and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
Further, on the basis of the above embodiment, the method may further include: setting preset information, wherein the preset information comprises a destination address for sending the early warning information;
the sending the early warning information to the user includes:
and sending the early warning information to a destination address indicated by the preset information according to the preset information.
For example, a threshold of 95% disk occupancy is set, and if the threshold is exceeded, an alert is notified to the user. In the notification early warning script, a notification user mail address and warning disk use information are set so as to facilitate the user to take corresponding measures according to the disk condition.
Fig. 2 is a schematic structural diagram of a disk capacity monitoring apparatus according to an embodiment of the present invention, and as shown in fig. 2, the disk capacity monitoring apparatus includes: an acquisition module 21 and a sending module 22. Wherein,
an obtaining module 21, configured to obtain a current first occupancy rate of a first disk, where the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk;
a sending module 22, configured to determine whether to send warning information to a user according to the first occupancy rate, where the warning information is used to prompt the user of the occupied capacity of the disk.
In this embodiment, by obtaining a current first occupancy rate of a first disk, the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, where the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk. The current occupied capacity of the disk can be obtained when the user stores the application program to the disk or in the process of storing the application program to the disk by the user, so that the problem that the application program cannot be written into the disk due to insufficient storage space is avoided, and the use efficiency of the disk is improved.
On the basis of the foregoing embodiment, the obtaining module 21 is specifically configured to obtain usage data of at least one disk, where the usage data at least includes an original capacity, an occupied capacity, and a remaining capacity of each disk; determining first usage data of the first disk according to the usage data, wherein the first usage data at least comprises at least one of the first original capacity and the first occupied capacity or a combination thereof; and comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk.
Further, on the basis of the above embodiment, the sending module 22 is specifically configured to send the warning information to the user if the first occupancy rate is greater than a preset value; and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
Fig. 3 is a schematic structural diagram of a second embodiment of a disk capacity monitoring apparatus according to the present invention, as shown in fig. 3, the disk capacity monitoring apparatus may further include: a setting module 23;
the setting module 23 is configured to set preset information, where the preset information includes a destination address to which the early warning information is sent;
the sending module 22 is further configured to send the early warning information to a destination address indicated by preset information according to the preset information.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for monitoring disk capacity, comprising:
acquiring a current first occupancy rate of a first disk, wherein the first occupancy rate comprises a ratio of a first occupied capacity to a first original capacity, the first occupied capacity comprises a capacity of a storage space of the first disk, and the first original capacity comprises a capacity of a maximum storage space of the first disk;
and determining whether to send early warning information to a user or not according to the first occupancy rate, wherein the early warning information is used for prompting the user of the occupied capacity of the disk.
2. The method of claim 1, wherein the obtaining the current first occupancy of the first disk comprises:
acquiring use data of at least one disk, wherein the use data at least comprises the original capacity, occupied capacity and residual capacity of each disk;
determining first usage data of the first disk according to the usage data, wherein the first usage data at least comprises at least one of the first original capacity and the first occupied capacity or a combination thereof;
and comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk.
3. The method of claim 1 or 2, wherein the determining whether to send warning information to the user according to the first occupancy comprises:
if the first occupancy rate is larger than a preset value, the early warning information is sent to a user;
and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
4. The method of claim 3, further comprising: setting preset information, wherein the preset information comprises a destination address for sending the early warning information;
the sending the early warning information to the user includes:
and sending the early warning information to a destination address indicated by the preset information according to the preset information.
5. A disk capacity monitoring apparatus, comprising:
an obtaining module, configured to obtain a current first occupancy rate of a first disk, where the first occupancy rate includes a ratio of a first occupied capacity to a first original capacity, the first occupied capacity includes a capacity of a storage space of the first disk that has been occupied, and the first original capacity includes a capacity of a maximum storage space of the first disk;
and the sending module is used for determining whether to send early warning information to a user or not according to the first occupancy rate, wherein the early warning information is used for prompting the user of the occupied capacity of the disk.
6. The apparatus according to claim 5, wherein the obtaining module is specifically configured to obtain usage data of at least one disk, where the usage data includes at least an original capacity, an occupied capacity, and a remaining capacity of each disk; determining first usage data of the first disk according to the usage data, wherein the first usage data at least comprises at least one of the first original capacity and the first occupied capacity or a combination thereof; and comparing the first original capacity with the first occupied capacity to obtain the current first occupancy rate of the first disk.
7. The apparatus according to claim 5 or 6, wherein the sending module is specifically configured to send the warning information to a user if the first occupancy rate is greater than a preset value; and if the first occupancy rate is less than or equal to the preset value, not sending the early warning information to the user.
8. The apparatus of claim 7, further comprising: setting a module;
the setting module is used for setting preset information, and the preset information comprises a destination address for sending the early warning information;
the sending module is further configured to send the early warning information to a destination address indicated by preset information according to the preset information.
CN201510689602.7A 2015-10-21 2015-10-21 Disk size monitoring method and apparatus Pending CN105260140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510689602.7A CN105260140A (en) 2015-10-21 2015-10-21 Disk size monitoring method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510689602.7A CN105260140A (en) 2015-10-21 2015-10-21 Disk size monitoring method and apparatus

Publications (1)

Publication Number Publication Date
CN105260140A true CN105260140A (en) 2016-01-20

Family

ID=55099847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510689602.7A Pending CN105260140A (en) 2015-10-21 2015-10-21 Disk size monitoring method and apparatus

Country Status (1)

Country Link
CN (1) CN105260140A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657380A (en) * 2016-03-22 2016-06-08 国网山东省电力公司章丘市供电公司 Substation image monitoring system
CN106250056A (en) * 2016-07-19 2016-12-21 宇龙计算机通信科技(深圳)有限公司 Date storage method and device
CN108959017A (en) * 2017-05-23 2018-12-07 北京视联动力国际信息技术有限公司 A kind of super expected occupancy method for early warning of disk and device
CN109271381A (en) * 2018-08-21 2019-01-25 中国平安人寿保险股份有限公司 Processing method, device, computer equipment and the storage medium of test data table

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005094245A (en) * 2003-09-16 2005-04-07 Victor Co Of Japan Ltd Motion detector
CN101291250A (en) * 2008-04-25 2008-10-22 北京泰得思达科技发展有限公司 Alarming method of memory space inadequate in network storage system
CN102981939A (en) * 2012-11-07 2013-03-20 曙光信息产业股份有限公司 Disc monitoring method
CN103399941A (en) * 2013-08-13 2013-11-20 广州中国科学院软件应用技术研究所 Distributed file processing method, device and system
CN103488575A (en) * 2013-08-12 2014-01-01 记忆科技(深圳)有限公司 Method for dynamically adjusting reserved space of solid-state hard disk and solid-state hard disk
CN103927230A (en) * 2014-03-25 2014-07-16 优视科技有限公司 Memory usage feedback method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005094245A (en) * 2003-09-16 2005-04-07 Victor Co Of Japan Ltd Motion detector
CN101291250A (en) * 2008-04-25 2008-10-22 北京泰得思达科技发展有限公司 Alarming method of memory space inadequate in network storage system
CN102981939A (en) * 2012-11-07 2013-03-20 曙光信息产业股份有限公司 Disc monitoring method
CN103488575A (en) * 2013-08-12 2014-01-01 记忆科技(深圳)有限公司 Method for dynamically adjusting reserved space of solid-state hard disk and solid-state hard disk
CN103399941A (en) * 2013-08-13 2013-11-20 广州中国科学院软件应用技术研究所 Distributed file processing method, device and system
CN103927230A (en) * 2014-03-25 2014-07-16 优视科技有限公司 Memory usage feedback method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657380A (en) * 2016-03-22 2016-06-08 国网山东省电力公司章丘市供电公司 Substation image monitoring system
CN106250056A (en) * 2016-07-19 2016-12-21 宇龙计算机通信科技(深圳)有限公司 Date storage method and device
WO2018014423A1 (en) * 2016-07-19 2018-01-25 宇龙计算机通信科技(深圳)有限公司 Data storage method and apparatus
CN108959017A (en) * 2017-05-23 2018-12-07 北京视联动力国际信息技术有限公司 A kind of super expected occupancy method for early warning of disk and device
CN109271381A (en) * 2018-08-21 2019-01-25 中国平安人寿保险股份有限公司 Processing method, device, computer equipment and the storage medium of test data table

Similar Documents

Publication Publication Date Title
CN108345524B (en) Application program monitoring method and application program monitoring device
CN103646208B (en) Monitoring method and device of eMMC
CN105260140A (en) Disk size monitoring method and apparatus
CN108737132B (en) Alarm information processing method and device
CN109639597B (en) Data transmission method in vehicle communication interface device and vehicle communication interface device
CN108872762B (en) Electronic equipment leakage detection method and device, electronic equipment and storage medium
US20160246512A1 (en) Data Compression Method and Storage System
CN110704283A (en) Method, device and medium for uniformly generating alarm information
WO2018121210A1 (en) Elastic scaling method and device for containerized application on paas platform
WO2016183918A1 (en) Method and device for processing storage space
CN112367384B (en) Kafka cluster-based dynamic speed limiting method and device and computer equipment
CN111130867B (en) Intelligent household equipment alarm method and device based on Internet of things
US9791911B2 (en) Determining whether a change in power usage is abnormal when power usage exceeds a threshold based on additional metrics of components in an electronic device
CN106446158B (en) Application data sharing method, sharing device and terminal
CN108073705B (en) Distributed mass data aggregation acquisition method
CN103164492A (en) File copying method between electronic devices and electronic devices
US20210208945A1 (en) Information processing apparatus, information processing method, and computer readable medium
US20150195174A1 (en) Traffic data collection apparatus, traffic data collection method and program
CN115118782B (en) Data control method, device, electronic equipment and computer readable storage medium
CN105868057A (en) Data processing method and device as well as mobile terminal
CN115442262B (en) Resource evaluation method and device, electronic equipment and storage medium
CN116204311A (en) Pod cluster capacity expansion and contraction method and device, computer equipment and storage medium
CN107704201B (en) Data storage processing method and device
CN107025148B (en) Mass data processing method and device
CN106855824B (en) Task stopping method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160120