CN103984618A - Method for monitoring hard disk activity state of LINUX server - Google Patents
Method for monitoring hard disk activity state of LINUX server Download PDFInfo
- Publication number
- CN103984618A CN103984618A CN201410247427.1A CN201410247427A CN103984618A CN 103984618 A CN103984618 A CN 103984618A CN 201410247427 A CN201410247427 A CN 201410247427A CN 103984618 A CN103984618 A CN 103984618A
- Authority
- CN
- China
- Prior art keywords
- disk
- file
- hard disk
- heartbeat
- linux server
- 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
Links
Abstract
The invention discloses a method for monitoring the hard disk activity state of an LINUX server, and belongs to the technical field of computers. The method includes the following steps that firstly, a Shell script is arranged on the Linux server where hard disk activity needs to be monitored; secondly, parameters are input; thirdly, monitoring is started; fourthly, whether the Heartbeat.log is the newest or not is examined, wherein the current system time is regularly written into a USB flash drive, a heartbeat.log file in the USB flash drive can be stopped being updated if a system collapses, and the specific time period during which faults occur can be judged by examining the last record of the file; fifthly, test characters strings are regularly written into the hard disk in turns, if the situation is normal, the return value is 0 and no attention needs to be paid, and if abnormity occurs, mistake information is automatically collected and stored in an scanlog.txt file in the USB flash drive. The method has the advantages of being easy to operate, convenient to use and the like. No third-party software needs to be installed, and the method is simple and easy to use.
Description
Technical field
The present invention relates to field of computer technology, specifically a kind of method for supervising of LINUX server hard disc active state.
Background technology
Along with the development of server technology, the hard disk quantity that server is supported becomes more and more, and when meeting the growing data space of server, the work that also makes us monitor hard disk movable state becomes more and more loaded down with trivial details.Generally, if server has configured RAID card, while there is hard disk failure, may have chimes of doom, notify in time O&M personnel handling failure.But, if there is the problems such as SCSI hang or response timeout in RAID card itself, to directly affect system operation, and RAID card does not have any chimes of doom, now network also can lead to by ping, on surface, all are normal, only have O&M personnel discovery business to delay after machine and just can notice this problem, are difficult to the time that judgement is broken down.In addition, if server has configured SAS card, when hard disk occurs when read-write is abnormal also not have chimes of doom, so O&M personnel can only make regular check on the active state of each piece hard disk, guarantee that data access is normal.
Shell is a kind of programming language.As command language, its interactive mode is explained and is carried out the order of user's input or automatically explain and carry out pre-set a series of order; As programming language, it has defined various variablees and parameter, and many control structures that just have in higher level lanquage are provided, and comprises circulation and branch.
Summary of the invention
Technical assignment of the present invention is to provide a kind of method for supervising of LINUX server hard disc active state.
Technical assignment of the present invention is realized in the following manner, and method step is as follows:
1) to carrying out the Linux server disposition Shell script of hard disk movable monitoring, comprise altogether two program files of FSmon and Heartbeat;
2) input parameter: give script file and can carry out authority;
3) start monitoring: carry out shell script, monitoring server hard disk movable state;
4) check that whether Heartbeat.log is up-to-date: regularly in flash disk, write the current system time, if system is collapsed, heartbeat.log file in flash disk will stop upgrading, by checking the last item record of this document, and the concrete time period that just energy failure judgement occurs;
5) timing wheel flows on hard disk and writes test character string, if all are normal, rreturn value is 0, need not comprehend; Once occur extremely, automatically collecting error message and being dumped in the scanlog.txt file in flash disk.
Described FSmon is for the file system active state of all hard disks of monitoring server except system disk.
Described FSmon program implement: first check local disk, other dish quantity and identifying informations except system disk, extrapolation flash disk is mounted under system, each disk is carried out to data simultaneously and write test, when having hard disk or raid card abnormal failure, file system is read-only, but flash disk can also normally write, and program will write flash disk writing the information of reporting an error in time, and real time record goes out actual problematic hard disk position, thereby record when, and which piece hard disk failure causes the system failure.
Described Heartbeat is for the existing state of supervisory system dish.
Described Heartbeat program implement: in real time system disk is carried out to readwrite tests, if read-write success, return to right value in plug-in flash disk log recording file, when system disk fault, file cannot be read and write, return to improper value, in the time of in flash disk journal file, interocclusal record stops, thereby can know that system disk stops the time of response.
Compared to the prior art the method for supervising of a kind of LINUX server hard disc active state of the present invention, has the features such as simple to operate, easy to use, and this method, without third party software is installed, is simple and easy to use.Character string maker uses Shell script edit, and highly versatile, can cross-platformly be used.In addition, can custom scan interval, adapt to different monitoring environments.Support background monitoring, without human intervention simultaneously.
Accompanying drawing explanation
Accompanying drawing 1 is a kind of process flow diagram of method for supervising of LINUX server hard disc active state.
Embodiment
Embodiment 1:
Method step is as follows:
1) to carrying out the Linux server disposition Shell script of hard disk movable monitoring, comprise altogether two program files of FSmon and Heartbeat; Described FSmon is for the file system active state of all hard disks of monitoring server except system disk; FSmon program implement: first check local disk, other dish quantity and identifying informations except system disk, extrapolation flash disk is mounted under system, each disk is carried out to data simultaneously and write test, when having hard disk or raid card abnormal failure, file system is read-only, but flash disk can also normally write, and program will write flash disk writing the information of reporting an error in time, and real time record goes out actual problematic hard disk position, thereby record when, and which piece hard disk failure causes the system failure.
Described Heartbeat is for the existing state of supervisory system dish; Heartbeat program implement: in real time system disk is carried out to readwrite tests, if read-write success, return to right value in plug-in flash disk log recording file, when system disk fault, file cannot be read and write, return to improper value, in the time of in flash disk journal file, interocclusal record stops, thereby can know that system disk stops the time of response.
2) input parameter: give script file and can carry out authority;
3) start monitoring: carry out shell script, monitoring server hard disk movable state;
4) check that whether Heartbeat.log is up-to-date: regularly in flash disk, write the current system time, if system is collapsed, heartbeat.log file in flash disk will stop upgrading, by checking the last item record of this document, and the concrete time period that just energy failure judgement occurs;
5) timing wheel flows on hard disk and writes test character string, if all are normal, rreturn value is 0, need not comprehend; Once occur extremely, automatically collecting error message and being dumped in the scanlog.txt file in flash disk.
FSmon program is as follows:
#!?/bin/bash
sleep?1
LDnum=`fdisk?-l?|?grep?-i?"disk?/dev"?|?wc?|?awk?'{print?$1}'`
echo?"$LDnum?logical?disks?found?on?your?server!"
sleep?1
echo?"Please?specify?the?mounting?point?of?all?disks?below!(except?sda)"
fdisk?-l?|?grep?-i?"disk?/dev"?|?grep?-v?sda?|?awk?'{print?$2}'?|?cut?-b?6-8?>?LDinfo
cat?LDinfo
sleep?1
for?i?in?`cat?LDinfo`
do
echo?"Mounting?point?of?$i?:"?&&?read?MOUNT_$i
done
sleep?1
echo?"Please?specify?mount?point?of?USB?removable?disk."?&&?read?MOUNT_USB
sleep?2
echo?"Scanning?service?has?started?successfully!"
while?[?true?]
do
for?i?in?`cat?LDinfo`
do
eval?dd_PATH="$"MOUNT_$i
dd?if=/dev/zero?of=$dd_PATH/test?bs=1M?count=1000?1>?/dev/null?2>?$MOUNT_USB/scanlog.txt
done
done
Heartbeat program is as follows:
#!?/bin/bash
echo?"Please?specify?mounting?point?of?your?USB?removable?disk."?&&?read?USB
echo?"Heartbeating?service?has?started?successfully!"
while?[?true?]
do
sleep?2
date?>?date.txt
echo?"OS?is?live."?>?state.txt
paste?date.txt?state.txt?>>?$USB/heartbeat.log
done。
Claims (5)
1. a method for supervising for LINUX server hard disc active state, is characterized in that, method step is as follows:
1) to carrying out the Linux server disposition Shell script of hard disk movable monitoring, comprise altogether two program files of FSmon and Heartbeat;
2) input parameter: give script file and can carry out authority;
3) start monitoring: carry out shell script, monitoring server hard disk movable state;
4) check that whether Heartbeat.log is up-to-date: regularly in flash disk, write the current system time, if system is collapsed, heartbeat.log file in flash disk will stop upgrading, by checking the last item record of this document, and the concrete time period that just energy failure judgement occurs;
5) timing wheel flows on hard disk and writes test character string, if all are normal, rreturn value is 0, need not comprehend; Once occur extremely, automatically collecting error message and being dumped in the scanlog.txt file in flash disk.
2. the method for supervising of a kind of LINUX server hard disc active state according to claim 1, is characterized in that, described FSmon is for the file system active state of all hard disks of monitoring server except system disk.
3. the method for supervising of a kind of LINUX server hard disc active state of stating according to claim 2, it is characterized in that, described FSmon program implement: first check local disk, other dish quantity and identifying informations except system disk, extrapolation flash disk is mounted under system, each disk is carried out to data simultaneously and write test, when having hard disk or raid card abnormal failure, file system is read-only, but flash disk can also normally write, program will write flash disk writing the information of reporting an error in time, and real time record goes out actual problematic hard disk position, thereby record when, which piece hard disk failure causes the system failure.
4. the method for supervising of a kind of LINUX server hard disc active state according to claim 1, is characterized in that, described Heartbeat is for the existing state of supervisory system dish.
5. the method for supervising of a kind of LINUX server hard disc active state of stating according to claim 4, it is characterized in that, described Heartbeat program implement: in real time system disk is carried out to readwrite tests, if read-write success, returns to right value in plug-in flash disk log recording file, when system disk fault, file cannot be read and write, return to improper value, in the time of in flash disk journal file, interocclusal record stops, thereby can know that system disk stops the time of response.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410247427.1A CN103984618A (en) | 2014-06-05 | 2014-06-05 | Method for monitoring hard disk activity state of LINUX server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410247427.1A CN103984618A (en) | 2014-06-05 | 2014-06-05 | Method for monitoring hard disk activity state of LINUX server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103984618A true CN103984618A (en) | 2014-08-13 |
Family
ID=51276608
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410247427.1A Pending CN103984618A (en) | 2014-06-05 | 2014-06-05 | Method for monitoring hard disk activity state of LINUX server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103984618A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104536865A (en) * | 2015-01-15 | 2015-04-22 | 浪潮电子信息产业股份有限公司 | Method for testing read-write performance of PMC Raid card |
CN104794041A (en) * | 2015-05-08 | 2015-07-22 | 浪潮电子信息产业股份有限公司 | Method for monitoring active state of array card for Linux server and device of method |
CN105223889A (en) * | 2015-10-13 | 2016-01-06 | 浪潮电子信息产业股份有限公司 | A kind of method being applicable to the automatic monitoring PMC RAID card daily record of producing line |
CN105490870A (en) * | 2015-11-20 | 2016-04-13 | 浪潮电子信息产业股份有限公司 | Method for monitoring operation state of Linux server in batch |
CN106991031A (en) * | 2017-03-07 | 2017-07-28 | 记忆科技(深圳)有限公司 | A kind of implementation method of SMART information monitorings |
CN108205497A (en) * | 2018-01-02 | 2018-06-26 | 郑州云海信息技术有限公司 | A kind of shell reads the method and system of input |
CN111767061A (en) * | 2020-06-24 | 2020-10-13 | 合肥工大高科信息科技股份有限公司 | Method and system for improving running stability of embedded Linux operating system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6763458B1 (en) * | 1999-09-27 | 2004-07-13 | Captaris, Inc. | System and method for installing and servicing an operating system in a computer or information appliance |
CN102591591A (en) * | 2011-12-19 | 2012-07-18 | 杭州瑞网广通信息技术有限公司 | Disk detection system, disk detection method and network storage system |
CN103064860A (en) * | 2011-10-21 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Database high availability implementation method and device |
CN103246585A (en) * | 2013-05-06 | 2013-08-14 | 浙江宇视科技有限公司 | Storage controller fault detecting method |
CN103473158A (en) * | 2013-09-18 | 2013-12-25 | 浪潮电子信息产业股份有限公司 | Disk pressure testing method for Linux server |
-
2014
- 2014-06-05 CN CN201410247427.1A patent/CN103984618A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6763458B1 (en) * | 1999-09-27 | 2004-07-13 | Captaris, Inc. | System and method for installing and servicing an operating system in a computer or information appliance |
CN103064860A (en) * | 2011-10-21 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Database high availability implementation method and device |
CN102591591A (en) * | 2011-12-19 | 2012-07-18 | 杭州瑞网广通信息技术有限公司 | Disk detection system, disk detection method and network storage system |
CN103246585A (en) * | 2013-05-06 | 2013-08-14 | 浙江宇视科技有限公司 | Storage controller fault detecting method |
CN103473158A (en) * | 2013-09-18 | 2013-12-25 | 浪潮电子信息产业股份有限公司 | Disk pressure testing method for Linux server |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104536865A (en) * | 2015-01-15 | 2015-04-22 | 浪潮电子信息产业股份有限公司 | Method for testing read-write performance of PMC Raid card |
CN104794041A (en) * | 2015-05-08 | 2015-07-22 | 浪潮电子信息产业股份有限公司 | Method for monitoring active state of array card for Linux server and device of method |
CN105223889A (en) * | 2015-10-13 | 2016-01-06 | 浪潮电子信息产业股份有限公司 | A kind of method being applicable to the automatic monitoring PMC RAID card daily record of producing line |
CN105490870A (en) * | 2015-11-20 | 2016-04-13 | 浪潮电子信息产业股份有限公司 | Method for monitoring operation state of Linux server in batch |
CN106991031A (en) * | 2017-03-07 | 2017-07-28 | 记忆科技(深圳)有限公司 | A kind of implementation method of SMART information monitorings |
CN106991031B (en) * | 2017-03-07 | 2020-10-20 | 记忆科技(深圳)有限公司 | Implementation method for SMART information monitoring |
CN108205497A (en) * | 2018-01-02 | 2018-06-26 | 郑州云海信息技术有限公司 | A kind of shell reads the method and system of input |
CN111767061A (en) * | 2020-06-24 | 2020-10-13 | 合肥工大高科信息科技股份有限公司 | Method and system for improving running stability of embedded Linux operating system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103984618A (en) | Method for monitoring hard disk activity state of LINUX server | |
US7558988B2 (en) | Storage system and control method thereof | |
US8676568B2 (en) | Information processing apparatus and message extraction method | |
TWI438689B (en) | Method and computer program product for creating host-level application-consistent backups of virtual machines | |
US8595456B1 (en) | Techniques for integrating backup modules with virtualized storage | |
US20120144110A1 (en) | Methods and structure for storage migration using storage array managed server agents | |
US9766965B2 (en) | System and method for monitoring and detecting faulty storage devices | |
TW201717001A (en) | Unified firmware managment system, non-transitory computer-readable storage medium and method for unified firmware managment | |
US20100268689A1 (en) | Providing information relating to usage of a simulated snapshot | |
CN107076797B (en) | Testing semiconductor memory power consumption based on executed access commands | |
EP2600249A2 (en) | Storage device, controller, and program | |
US11137918B1 (en) | Administration of control information in a storage system | |
JP2005108098A (en) | Data i/o device and control method of data i/o device | |
CN106598637B (en) | Method for selective loading of components within a node | |
US10606490B2 (en) | Storage control device and storage control method for detecting storage device in potential fault state | |
US8843781B1 (en) | Managing drive error information in data storage systems | |
JP2006313410A (en) | Management information management method for storage network, storage management system and storage management software | |
JPWO2014006701A1 (en) | Information processing apparatus, access control program, and access control method | |
CN111656446A (en) | Hard disk drive life prediction | |
US9250942B2 (en) | Hardware emulation using on-the-fly virtualization | |
CN113590405A (en) | Hard disk error detection method and device, storage medium and electronic device | |
WO2020263335A1 (en) | Use of error correction-based metric for identifying poorly performing data storage devices | |
US20220137837A1 (en) | Storage system and file relocation method for storage system | |
KR101072056B1 (en) | Service workload identification in a data storage system | |
US20160062687A1 (en) | Storage control apparatus, storage control system, and control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140813 |
|
WD01 | Invention patent application deemed withdrawn after publication |