CN113568806A - SAS card link state monitoring method, system, device and readable storage medium - Google Patents

SAS card link state monitoring method, system, device and readable storage medium Download PDF

Info

Publication number
CN113568806A
CN113568806A CN202110722511.4A CN202110722511A CN113568806A CN 113568806 A CN113568806 A CN 113568806A CN 202110722511 A CN202110722511 A CN 202110722511A CN 113568806 A CN113568806 A CN 113568806A
Authority
CN
China
Prior art keywords
sas card
hard disk
sas
information
equipment
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.)
Withdrawn
Application number
CN202110722511.4A
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 Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology 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 Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202110722511.4A priority Critical patent/CN113568806A/en
Publication of CN113568806A publication Critical patent/CN113568806A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3041Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a system and a device for monitoring the link state of an SAS card and a readable storage medium, wherein the method comprises the following steps: establishing connection between Expander equipment of a storage server and an SAS card and a hard disk; checking the equipment information of the SAS card or the hard disk through Expander equipment; acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value; monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm; and recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log. The invention can ensure timely processing when the storage server reads and writes data abnormally by monitoring the link state of the SAS card, thereby improving the reliability of the storage server in reading data.

Description

SAS card link state monitoring method, system, device and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method, a system and a device for monitoring the link state of an SAS card and a readable storage medium.
Background
The storage server is applied to various occasions, the storage server has higher and higher requirements on disk I/O, the disk I/O can be ensured to run with high performance, and the SAS card can improve the data transmission efficiency. The SAS card is called a disk array card and is used for RAID. Disk arrays have many advantages: firstly, the storage capacity is improved; secondly, multiple disk drives can work in parallel, improving data transmission rate, providing check sum redundancy and improving data security.
At present, if an SAS card or a hard disk is abnormal in the operation process of a storage server, data reading and writing of the storage server are abnormal, and due to the fact that no warning measure exists, when the data reading of the storage server is abnormal, the storage server cannot be processed in time, so that it is very important to guarantee that an SAS card link works normally, and the state of the SAS card link needs to be detected in real time.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a method, a system, a device, and a readable storage medium for monitoring a link status of an SAS card, which can ensure timely processing when a storage server reads and writes data abnormally, thereby improving reliability of data reading by the storage server.
In order to achieve the purpose, the invention is realized by the following technical scheme: a method for monitoring the state of SAS card links comprises the following steps:
establishing connection between Expander equipment of a storage server and an SAS card and a hard disk;
checking the equipment information of the SAS card or the hard disk through Expander equipment;
acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value;
monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm;
and recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log.
Further, the device information of the SAS card or the hard disk includes: device id, device type, and device address; the state information of the SAS card or the hard disk includes: error code information, change count value (number of connections between hard disk and expander device), and negotiation rate.
Further, the step of checking the device information of the SAS card or the hard disk through the Expander device specifically includes: traversing the expander equipment of the storage server, and acquiring all the expander equipment of the storage server by using a command ls-lh/dev/bsg/expander-;
and inquiring the acquired expander equipment by using the command smp _ discover to obtain the equipment information of the SAS card or the hard disk connected with the expander equipment.
Further, the acquiring, at every preset time, the status information of the SAS card or the hard disk according to the device information, and taking the status information of the SAS card or the hard disk acquired for the first time as an initial value specifically includes:
and inquiring the state information of the SAS card or the hard disk according to the acquired equipment id at intervals of five minutes, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value.
Further, the monitoring the state information of the SAS card or the hard disk according to the preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm specifically includes:
comparing the state information of the SAS card or the hard disk acquired each time;
if the state information of the currently acquired SAS card or hard disk is changed compared with the state information or initial value of the SAS card or hard disk acquired last time, recording the state information of the currently acquired SAS card or hard disk into a log;
if the error code information and the change count value of the SAS card or the hard disk obtained every time are increased for five times compared with the error code information and the change count value of the SAS card or the hard disk obtained last time, determining that the SAS card or the hard disk has a fault, and performing fault alarm;
and if the obtained negotiation rate of the SAS card or the hard disk is less than the negotiation rate threshold value for five times continuously, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
Further, the negotiated rate threshold is 6 Gbps.
Further, the recording of the abnormal state information of the SAS card or the hard disk, which is determined to have the fault, into the log specifically includes:
and acquiring the disk identifier address of the SAS card or the hard disk with the fault according to the command lssci-gt, acquiring the equipment id corresponding to the disk identifier according to the disk identifier address, and recording the equipment information of the SAS card or the hard disk corresponding to the equipment id into a log.
Correspondingly, the invention also discloses a SAS card link state monitoring system, which comprises:
the connection unit is used for establishing the connection between the Expander equipment of the storage server and the SAS card and the hard disk;
the equipment information acquisition unit is used for checking the equipment information of the SAS card or the hard disk through Expander equipment;
the state information acquiring unit is used for acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value;
the fault monitoring unit is used for monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has faults and giving a fault alarm;
and the recording unit is used for recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log.
Further, the state information acquiring unit is specifically configured to:
traversing the expander equipment of the storage server, and acquiring all the expander equipment of the storage server by using a command ls-lh/dev/bsg/expander-;
and inquiring the acquired expander equipment by using the command smp _ discover to obtain the equipment information of the SAS card or the hard disk connected with the expander equipment.
Further, the state information acquiring unit is specifically configured to:
and inquiring the state information of the SAS card or the hard disk according to the acquired equipment id at intervals of five minutes, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value.
Further, the fault monitoring unit is specifically configured to:
comparing the state information of the SAS card or the hard disk acquired each time;
if the state information of the currently acquired SAS card or hard disk is changed compared with the state information or initial value of the SAS card or hard disk acquired last time, recording the state information of the currently acquired SAS card or hard disk into a log;
if the error code information and the change count value of the SAS card or the hard disk obtained every time are increased for five times compared with the error code information and the change count value of the SAS card or the hard disk obtained last time, determining that the SAS card or the hard disk has a fault, and performing fault alarm;
and if the obtained negotiation rate of the SAS card or the hard disk is less than the negotiation rate threshold value for five times continuously, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
Further, the recording unit is specifically configured to:
and acquiring the disk identifier address of the SAS card or the hard disk with the fault according to the command lssci-gt, acquiring the equipment id corresponding to the disk identifier according to the disk identifier address, and recording the equipment information of the SAS card or the hard disk corresponding to the equipment id into a log.
Correspondingly, the invention discloses a SAS card link state monitoring device, which comprises:
the memory is used for storing the SAS card link state monitoring program;
and the processor is used for realizing the steps of the SAS card link state monitoring method according to any one of the above items when the SAS card link state monitoring program is executed.
Correspondingly, the invention discloses a readable storage medium, wherein an SAS card link state monitoring program is stored on the readable storage medium, and when being executed by a processor, the SAS card link state monitoring program realizes the steps of the SAS card link state monitoring method according to any one of the above items.
Compared with the prior art, the invention has the beneficial effects that: the invention provides a method, a system and a device for monitoring the link state of an SAS card and a readable storage medium. Acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value; and monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm. And finally, recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log. The invention can ensure that the data can be processed in time when the storage server reads and writes the data abnormally, thereby improving the reliability of the storage server for reading the data.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of the method of the present invention;
fig. 2 is a system block diagram of the present invention.
In the figure, 1 is a connecting unit; 2, a device information acquisition unit; a state information acquisition unit; 4 is a fault monitoring unit; and 5, a recording unit.
Detailed Description
The core of the invention is to provide a method for monitoring the link state of an SAS card, in the prior art, if the SAS card or a hard disk is abnormal in the operation process of a storage server, the data reading and writing of the storage server are abnormal, and the storage server cannot be processed in time when the data reading of the storage server is abnormal due to no alarm measures.
Firstly, establishing connection between Expander equipment of a storage server and an SAS card and a hard disk, and checking equipment information of the SAS card or the hard disk through the Expander equipment. Acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value; and monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm. And finally, recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log. Therefore, the SAS card link state is monitored, and timely processing can be guaranteed when the storage server reads and writes data abnormally, so that the reliability of the storage server in reading data is improved.
For an accurate understanding of the present application, the terms to which the present invention relates are to be interpreted as follows:
SAS card: SAS cards, also known as disk array cards, are used for RAID (redundant array of inexpensive disks). The disk array is a system which integrates a plurality of hard disk drives according to certain requirements, and the whole disk array is managed by an array controller. Disk arrays have many advantages: firstly, the storage capacity is improved; secondly, multiple disk drives can work in parallel, improving data transmission rate, providing check sum redundancy and improving data security.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the 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.
The first embodiment is as follows:
as shown in fig. 1, the present embodiment provides a method for monitoring a SAS card link status, including the following steps:
s1: and establishing connection between the Expander device of the storage server and the SAS card and the hard disk.
S2: and checking the equipment information of the SAS card or the hard disk through the Expander equipment.
First, traversing the expander device of the storage server, and using a command ls-lh/dev/bsg/expander- "to obtain all the expander devices of the storage server. And then, inquiring the acquired expander device by using the command smp _ discover to obtain the device id, the device type and the device address of the SAS card or the hard disk connected with the expander device.
S3: and acquiring the state information of the SAS card or the hard disk according to the equipment information at preset intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value.
And inquiring the error code information, the change count value and the negotiation rate of the SAS card or the hard disk according to the acquired device id at intervals of five minutes, and taking the error code information, the change count value and the negotiation rate of the SAS card or the hard disk acquired for the first time as initial values.
S4: and monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
The method comprises the following specific steps: and comparing the error code information, the change count value and the negotiation rate of the SAS card or the hard disk acquired each time.
And if the currently acquired error code information, the change count value and the negotiation rate of the SAS card or the hard disk are changed compared with the last time or the initial value, recording the currently acquired error code information, the change count value and the negotiation rate of the SAS card or the hard disk into a log.
And if the error code information and the change count value of the SAS card or the hard disk acquired every time are increased five times continuously compared with the error code information and the change count value of the SAS card or the hard disk acquired last time, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
And if the obtained negotiation rate of the SAS card or the hard disk is less than the negotiation rate threshold value for five times continuously, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
S5: and recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log.
And acquiring the disk identifier address of the SAS card or the hard disk with the fault according to the command lssci-gt, acquiring the equipment id corresponding to the disk identifier according to the disk identifier address, and recording the equipment information of the SAS card or the hard disk corresponding to the equipment id into a log.
The embodiment provides a method for monitoring the link state of an SAS card, wherein an ID, a device type and an address are checked according to an Expander device. And acquiring error code information, Change Count and negotiation rate of the SAS card or the hard disk based on the ID, and acquiring a corresponding drive letter by using an address and lssci protocol. And taking the result obtained by the first query as an initial state according to the ID, recording the SAS card or the drive letter, the ID, the address, the drive type and the state information into a log when the error code or change count of the SAS card is increased compared with the initial state or the last state, detecting once in 5 minutes, and performing fault alarm when the error code or change count is increased for 5 times in continuous detection. When the negotiation rate is less than 6Gbps, recording the SAS card or the disk identifier, the ID, the address, the disk type and the state information into a log, detecting once in 5 minutes, and carrying out fault alarm when the negotiation rate is less than 6G after continuously detecting 5 times.
Example two:
based on the first embodiment, the embodiment discloses a method for monitoring the link status of an SAS card, which includes:
1. and traversing the expander equipment of the storage server, and acquiring the storage server by using ls-lh/dev/bsg/expander- "to obtain several expander equipment of the storage server.
2. And querying the obtained expander device by using the smp _ discover to obtain the id, the device type and the address of the storage device.
3. And inquiring the error code information, change count and negotiation rate of the storage equipment at intervals of five minutes according to the obtained id.
4. And taking the error code information, the Change Count and the negotiation rate obtained for the first time as initial values, and recording related information into a log when the error code information, the Change Count and the negotiation rate are changed compared with the previous time or the initial values.
5. And alarming if the error code information and the Change Count are increased for 5 times continuously than the last time.
6. And if the negotiation rate is less than 6Gbps for 5 times continuously, alarming.
7. And acquiring the drive letter address according to the command lssci-gt, acquiring the id corresponding to the drive letter according to the drive letter address, and recording the information such as the id and the like into a log if the drive letter has a problem.
This embodiment provides a method for monitoring the link status of an SAS card, which uses the connection relationship between an Expander device and an SAS card or a hard disk. The SAS card link is monitored, when the SAS card or the hard disk is abnormal, an alarm can be given in time, and the abnormal state of the SAS card or the hard disk is recorded into a log. The invention can ensure that the data can be processed in time when the storage server reads and writes the data abnormally, thereby improving the reliability of the storage server for reading the data.
Example three:
based on the first embodiment, as shown in fig. 2, the present invention further discloses an SAS card link status monitoring system, which includes: a connection unit 1, an apparatus information acquisition unit 2, a status information acquisition unit 3, a failure monitoring unit 4, and a recording unit 5.
And the connection unit 1 is used for establishing the connection between the Expander equipment of the storage server and the SAS card and the hard disk.
And the equipment information acquisition unit 2 is used for checking the equipment information of the SAS card or the hard disk through the Expander equipment. The method is specifically used for:
and traversing the expander devices of the storage server, and acquiring all the expander devices of the storage server by using a command ls-lh/dev/bsg/expander-). And inquiring the acquired expander equipment by using the command smp _ discover to obtain the equipment information of the SAS card or the hard disk connected with the expander equipment.
And the state information acquiring unit 3 is configured to acquire state information of the SAS card or the hard disk according to the device information at preset time intervals, and use the state information of the SAS card or the hard disk acquired for the first time as an initial value. The state information obtaining unit 3 is specifically configured to: and inquiring the state information of the SAS card or the hard disk according to the acquired equipment id at intervals of five minutes, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value.
And the fault monitoring unit 4 is used for monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has faults and giving a fault alarm. The fault monitoring unit 4 is specifically configured to:
and comparing the state information of the SAS card or the hard disk acquired each time.
And if the currently acquired state information of the SAS card or the hard disk changes compared with the state information or the initial value of the SAS card or the hard disk acquired last time, recording the currently acquired state information of the SAS card or the hard disk into a log.
And if the error code information and the change count value of the SAS card or the hard disk acquired every time are increased five times continuously compared with the error code information and the change count value of the SAS card or the hard disk acquired last time, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
And if the obtained negotiation rate of the SAS card or the hard disk is less than the negotiation rate threshold value for five times continuously, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
And the recording unit 5 is used for recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log. The method is specifically used for:
and acquiring the disk identifier address of the SAS card or the hard disk with the fault according to the command lssci-gt, acquiring the equipment id corresponding to the disk identifier according to the disk identifier address, and recording the equipment information of the SAS card or the hard disk corresponding to the equipment id into a log.
This embodiment provides a SAS card link status monitoring system, which uses the connection relationship between Expander devices and SAS cards and hard disks. The SAS card link is monitored, when the SAS card or the hard disk is abnormal, an alarm can be given in time, and the abnormal state of the SAS card or the hard disk is recorded into a log. The invention can ensure that the data can be processed in time when the storage server reads and writes the data abnormally, thereby improving the reliability of the storage server for reading the data.
Example four:
the embodiment discloses a SAS card link state monitoring device, which comprises a processor and a memory; when the processor executes the SAS card link state monitoring program stored in the memory, the following steps are realized:
1. and traversing the expander equipment of the storage server, and acquiring the storage server by using ls-lh/dev/bsg/expander- "to obtain several expander equipment of the storage server.
2. And querying the obtained expander device by using the smp _ discover to obtain the id, the device type and the address of the storage device.
3. And inquiring the error code information, change count and negotiation rate of the storage equipment at intervals of five minutes according to the obtained id.
4. And taking the error code information, the Change Count and the negotiation rate obtained for the first time as initial values, and recording related information into a log when the error code information, the Change Count and the negotiation rate are changed compared with the previous time or the initial values.
5. And alarming if the error code information and the Change Count are increased for 5 times continuously than the last time.
6. And if the negotiation rate is less than 6Gbps for 5 times continuously, alarming.
7. And acquiring the drive letter address according to the command lssci-gt, acquiring the id corresponding to the drive letter according to the drive letter address, and recording the information such as the id and the like into a log if the drive letter has a problem.
Further, the SAS card link status monitoring apparatus in this embodiment may further include:
and the input interface is used for acquiring an externally introduced SAS card link state monitoring program, storing the acquired SAS card link state monitoring program into the memory, and also used for acquiring various instructions and parameters transmitted by external terminal equipment and transmitting the instructions and parameters into the processor, so that the processor can utilize the instructions and parameters to perform corresponding processing. In this embodiment, the input interface may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, and the like.
And the output interface is used for outputting various data generated by the processor to the terminal equipment connected with the output interface, so that other terminal equipment connected with the output interface can acquire various data generated by the processor. In this embodiment, the output interface may specifically include, but is not limited to, a USB interface, a serial interface, and the like.
And the communication unit is used for establishing remote communication connection between the SAS card link state monitoring device and the external server so that the SAS card link state monitoring device can mount the mirror image file into the external server. In this embodiment, the communication unit may specifically include, but is not limited to, a remote communication unit based on a wireless communication technology or a wired communication technology.
And the keyboard is used for acquiring various parameter data or instructions input by a user through real-time key cap knocking.
And the display is used for displaying relevant information in the short circuit positioning process of the power supply line of the running server in real time.
The mouse can be used for assisting a user in inputting data and simplifying the operation of the user.
The embodiment provides a SAS card link state monitoring device, which implements a method for monitoring the SAS card link state of a storage server, and by monitoring the SAS card link state, it is ensured that processing can be performed in time when the storage server reads and writes data abnormally, thereby improving the reliability of reading data by the storage server.
Example five:
the present embodiments also disclose a readable storage medium, where the readable storage medium includes Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium known in the art. The readable storage medium stores a SAS card link state monitoring program, and when the SAS card link state monitoring program is executed by a processor, the SAS card link state monitoring program realizes the following steps:
1. and traversing the expander equipment of the storage server, and acquiring the storage server by using ls-lh/dev/bsg/expander- "to obtain several expander equipment of the storage server.
2. And querying the obtained expander device by using the smp _ discover to obtain the id, the device type and the address of the storage device.
3. And inquiring the error code information, change count and negotiation rate of the storage equipment at intervals of five minutes according to the obtained id.
4. And taking the error code information, the Change Count and the negotiation rate obtained for the first time as initial values, and recording related information into a log when the error code information, the Change Count and the negotiation rate are changed compared with the previous time or the initial values.
5. And alarming if the error code information and the Change Count are increased for 5 times continuously than the last time.
6. And if the negotiation rate is less than 6Gbps for 5 times continuously, alarming.
7. And acquiring the drive letter address according to the command lssci-gt, acquiring the id corresponding to the drive letter according to the drive letter address, and recording the information such as the id and the like into a log if the drive letter has a problem.
The embodiment provides a readable storage medium, which realizes a method for monitoring the link state of an SAS card of a storage server, and by monitoring the link state of the SAS card, it is ensured that when the storage server reads and writes data abnormally, the data can be processed in time, thereby improving the reliability of the storage server in reading data.
In summary, the SAS card link status is monitored, so that the processing can be performed in time when the storage server reads and writes data abnormally, and the reliability of the storage server reading data is improved.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The method disclosed by the embodiment corresponds to the system disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit.
Similarly, each processing unit in the embodiments of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units are integrated into one functional module.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, system, device and readable storage medium for monitoring the link status of the SAS card provided by the present invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A method for monitoring the state of an SAS card link is characterized by comprising the following steps:
establishing connection between Expander equipment of a storage server and an SAS card and a hard disk;
checking the equipment information of the SAS card or the hard disk through Expander equipment;
acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value;
monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing fault alarm;
and recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log.
2. The SAS card link status monitoring method according to claim 2, wherein the device information of the SAS card or the hard disk includes: device id, device type, and device address;
the state information of the SAS card or the hard disk includes: error code information, change count value, and negotiated rate.
3. The SAS card link status monitoring method according to claim 2, wherein the checking the device information of the SAS card or the hard disk by the Expander device specifically comprises:
traversing the expander equipment of the storage server, and acquiring all the expander equipment of the storage server by using a command ls-lh/dev/bsg/expander-;
and inquiring the acquired expander equipment by using the command smp _ discover to obtain the equipment information of the SAS card or the hard disk connected with the expander equipment.
4. The method for monitoring the status of the SAS card link according to claim 3, wherein the acquiring the status information of the SAS card or the hard disk according to the device information at every preset time, and using the status information of the SAS card or the hard disk acquired for the first time as an initial value specifically comprises:
and inquiring the state information of the SAS card or the hard disk according to the acquired equipment id at intervals of five minutes, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value.
5. The method for monitoring the state of the SAS card link according to claim 4, wherein the monitoring the state information of the SAS card or the hard disk according to the preset monitoring mechanism, determining that the SAS card or the hard disk has a fault, and performing the fault alarm specifically comprises:
comparing the state information of the SAS card or the hard disk acquired each time;
if the state information of the currently acquired SAS card or hard disk is changed compared with the state information or initial value of the SAS card or hard disk acquired last time, recording the state information of the currently acquired SAS card or hard disk into a log; if the error code information and the change count value of the SAS card or the hard disk obtained every time are increased for five times compared with the error code information and the change count value of the SAS card or the hard disk obtained last time, determining that the SAS card or the hard disk has a fault, and performing fault alarm;
and if the obtained negotiation rate of the SAS card or the hard disk is less than the negotiation rate threshold value for five times continuously, determining that the SAS card or the hard disk has a fault, and performing fault alarm.
6. The SAS card link status monitoring method of claim 4, wherein the negotiated rate threshold is 6 Gbps.
7. The SAS card link status monitoring method according to claim 4, wherein the recording of the abnormal status information of the SAS card or the hard disk for which the fault is determined to exist in the log specifically comprises:
and acquiring the disk identifier address of the SAS card or the hard disk with the fault according to the command lssci-gt, acquiring the equipment id corresponding to the disk identifier according to the disk identifier address, and recording the equipment information of the SAS card or the hard disk corresponding to the equipment id into a log.
8. An SAS card link status monitoring system, comprising:
the connection unit is used for establishing the connection between the Expander equipment of the storage server and the SAS card and the hard disk;
the equipment information acquisition unit is used for checking the equipment information of the SAS card or the hard disk through Expander equipment;
the state information acquiring unit is used for acquiring the state information of the SAS card or the hard disk according to the equipment information at preset time intervals, and taking the state information of the SAS card or the hard disk acquired for the first time as an initial value;
the fault monitoring unit is used for monitoring the state information of the SAS card or the hard disk according to a preset monitoring mechanism, determining that the SAS card or the hard disk has faults and giving a fault alarm;
and the recording unit is used for recording the abnormal state information of the SAS card or the hard disk with the determined fault into a log.
9. An SAS card link status monitoring device, comprising:
the memory is used for storing the SAS card link state monitoring program;
a processor, configured to implement the steps of the SAS card link status monitoring method according to any one of claims 1 to 7 when executing the SAS card link status monitoring program.
10. A readable storage medium, characterized by: the readable storage medium has stored thereon a SAS card link status monitoring program, which when executed by a processor implements the steps of the SAS card link status monitoring method according to any one of claims 1 to 7.
CN202110722511.4A 2021-06-28 2021-06-28 SAS card link state monitoring method, system, device and readable storage medium Withdrawn CN113568806A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110722511.4A CN113568806A (en) 2021-06-28 2021-06-28 SAS card link state monitoring method, system, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110722511.4A CN113568806A (en) 2021-06-28 2021-06-28 SAS card link state monitoring method, system, device and readable storage medium

Publications (1)

Publication Number Publication Date
CN113568806A true CN113568806A (en) 2021-10-29

Family

ID=78162877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110722511.4A Withdrawn CN113568806A (en) 2021-06-28 2021-06-28 SAS card link state monitoring method, system, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113568806A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115589342A (en) * 2022-09-23 2023-01-10 无锡众星微***技术有限公司 Power consumption management method of SAS controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115589342A (en) * 2022-09-23 2023-01-10 无锡众星微***技术有限公司 Power consumption management method of SAS controller
CN115589342B (en) * 2022-09-23 2023-07-07 无锡众星微***技术有限公司 Power consumption management method of SAS controller

Similar Documents

Publication Publication Date Title
US20070088816A1 (en) System and method for monitoring the status of a bus in a server environment
CN105975357A (en) Fault location method and system
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN113568806A (en) SAS card link state monitoring method, system, device and readable storage medium
US8280930B1 (en) Obtaining configuration information from host devices which store data into and load data from a data storage array
CN111309553B (en) Method, system, equipment and medium for monitoring storage Jbod
CN112416896A (en) Data abnormity warning method and device, storage medium and electronic device
WO2024124862A1 (en) Server-based memory processing method and apparatus, processor and an electronic device
CN116361111A (en) Data acquisition method and device and electronic equipment
CN116204361A (en) Asset management method, system, device and storage medium
CN115470056A (en) Method, system, device and medium for troubleshooting power-on starting of server hardware
CN115543755A (en) Performance monitoring method, device, system, equipment and medium
CN114936135A (en) Abnormity detection method and device and readable storage medium
CN115658404A (en) Test method and system
CN115098311A (en) Test method, system, device and storage medium based on multipath alias
CN115543665A (en) Memory reliability evaluation method and device and storage medium
CN112084097B (en) Disk alarm method and device
CN110781042B (en) Method, device and medium for detecting UBM (Universal boot Module) backboard based on BMC (baseboard management controller)
CN113900718A (en) Method, system and device for decoupling asset information of BMC (baseboard management controller) and BIOS (basic input/output system)
CN113051135A (en) Application thread pool monitoring method and thread pool monitoring device
CN115129544B (en) Out-of-band one-key acquisition method, system and device for RAID (redundant array of independent disks) logs and storage medium
CN116627730A (en) Smart log acquisition and analysis method, system, device and medium
CN108763027A (en) A kind of hard disk monitoring method, device and server
CN111124804B (en) Test method and device
CN115333970B (en) Device connection stability evaluation method and device, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20211029

WW01 Invention patent application withdrawn after publication