Disclosure of Invention
Aiming at the defects in the prior art, the embodiment of the invention provides an intranet server monitoring system, method and medium based on a short message cat, which can automatically monitor the operation and maintenance state of an intranet server, and enable operation and maintenance personnel to remotely know the operation state of the server without field operation, thereby saving the labor cost.
In a first aspect, an intranet server monitoring system based on a short message cat provided in an embodiment of the present invention includes: the application server cluster, the short message modem, the short message receiving equipment and the operation and maintenance server cluster, wherein the number of the short message modem and the short message receiving equipment is at least 2,
the application server cluster is used for collecting operation and maintenance monitoring information at regular time and sending the collected operation and maintenance monitoring information to the short message modem;
the short message modem is used for receiving operation and maintenance monitoring information sent by the application server cluster and sending the operation and maintenance monitoring information to the short message receiving equipment in a short message mode;
the short message receiving equipment is used for receiving a short message sent by the short message modem and sending short message text information to the operation and maintenance server;
the operation and maintenance server cluster is used for receiving the short message text information sent by the short message receiving equipment and counting the operation and maintenance state data of the application server according to the short message text information.
In a second aspect, the method for monitoring an intranet server based on a short message cat provided in the embodiment of the present invention is applicable to the system described in the above embodiment, and includes:
the application server cluster collects operation and maintenance monitoring information at regular time and sends the collected operation and maintenance monitoring information to the short message modem;
the method comprises the steps that a short message modem receives operation and maintenance monitoring information sent by an application server cluster, and the operation and maintenance monitoring information is sent to short message receiving equipment in a short message mode;
the short message receiving equipment receives a short message sent by the short message modem and sends short message text information to the operation and maintenance server;
and the operation and maintenance server cluster receives the short message text information sent by the short message receiving equipment and counts the operation and maintenance state data of the application server according to the short message text information.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, the computer program comprising program instructions, which, when executed by a processor, cause the processor to perform the method steps described in the above embodiments.
The invention has the beneficial effects that:
the intranet server monitoring system, the intranet server monitoring method and the intranet server monitoring medium based on the short message cat can automatically monitor the operation and maintenance state of the intranet server, and operation and maintenance personnel can remotely know the operation state of the server without field operation, so that labor cost is saved.
Detailed Description
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, 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.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which the invention pertains.
As shown in fig. 1, a block diagram of a structure of an intranet server monitoring system based on a short message cat according to a first embodiment of the present invention is shown, where the system includes: the application server cluster is used for collecting operation and maintenance monitoring information at regular time and sending the collected operation and maintenance monitoring information to the short message modem; the short message modem is used for receiving operation and maintenance monitoring information sent by the application server cluster and sending the operation and maintenance monitoring information to the short message receiving equipment in a short message mode; the short message receiving equipment is used for receiving a short message sent by the short message modem and sending short message text information to the operation and maintenance server; the operation and maintenance server cluster is used for receiving the short message text information sent by the short message receiving equipment and counting the operation and maintenance state data of the application server according to the short message text information. The application server cluster is composed of a plurality of application servers, and the operation and maintenance server cluster is composed of a plurality of operation and maintenance servers.
The application server cluster is deployed in a local area network environment, operates a corresponding system to provide service for customers, and sends short messages through the short message cat. The short message modem is a device which can send short messages by inserting the SIM card, and is connected to the server through a serial port, and the server can call the short message modem to send short messages by sending AT instructions to the serial port where the short message modem is located. The operation and maintenance information collected by the application server is mainly achieved through a python script, and the operation and maintenance monitoring information collected by the python script comprises the host names of the servers in the cluster, IP, the use condition of a CPU (Central processing Unit), the use condition of a memory, the use condition of each disk, the occupation condition of network bandwidth, the real-time data volume, the health condition of the applications such as php/nginx/mysql and the like. Because the roles of the application servers in the application server cluster are different, the statistical data content of the python script is slightly different, but the python script conforms to the same data format, and the subsequent processing work of the data after the statistics is finished is facilitated. The statistical data of the Python script has a unique identification ID number, the operation and maintenance server can find out which node of which application server cluster the statistical data is sent from according to the ID number, the sending batch of the data can be determined, the statistical data sent by the Python script each time can be locally backed up, the longest allowed retention time of the backup is one year, the shortest is one month, and the configuration can be carried out according to the actual situation. The retention time is set to 3 months in this embodiment. Therefore, when the operation and maintenance personnel track the fault, the corresponding log record can be found on the application server, and the problem is conveniently checked. And after the python script program finishes collecting the basic data, storing the collected data in a redis queue deployed on the current application server machine. The redis database is deployed in a distributed mode, high availability is guaranteed, and service is provided after a part of application servers are down and normally run. On an application server inserted with a SMM device, a python script reads data in a redis database, then the collected information is packaged by using a binary system according to a fixed rule, and finally a binary system code consisting of 01 is output, wherein the content of the SMM does not contain Chinese characters, so that the data length of the SMM sent by the SMM is shortened, and the application cost is saved. Each application server cluster has at least 2 SMATs, the default is a load balancing mode, and when one of the SMATs is down, the other SMATs can still normally provide services to ensure high availability.
The short message receiving equipment is connected to the operation and maintenance server cluster, the short message receiving equipment transmits the short message received from the application server to the operation and maintenance server cluster, the operation and maintenance server decodes the received short message of the binary code according to a specified format, and the decoded data is stored in an operation and maintenance server database. And the operation and maintenance server also sets an alarm threshold value for each application server, compares the decoded data with the alarm threshold value, and if the decoded data exceeds the alarm threshold value or has a large difference with the alarm threshold value, the operation and maintenance server calls the short message cats on the monitoring server cluster to send alarm short messages to remind corresponding operation and maintenance personnel to process in time.
Data on the application server cluster is collected once every hour, and even if the data are not collected, a short message is sent to the operation and maintenance server cluster after the specified time is reached, so that the application server node short message cat is normal. When the operation and maintenance server cluster does not receive the report short message of the application server cluster for 2 hours continuously, the abnormal state of the server is marked, and a short message alarm is immediately sent to corresponding operation and maintenance personnel to remind the personnel to process in time. In order to ensure high availability of the system, a redis database running on an application server is deployed for high availability, and when one application server goes wrong, other application servers automatically elect a main node and then continue to provide services. At least 2 sets of SMM systems are deployed in each application server cluster, one set of SMM corresponds to one collected data processing script, and when one server with the SMM fails, the other server can take all data reporting tasks. And at least 2 short message receiving devices are deployed, when the short message cat sends a short message to one of the short message receiving devices but does not receive the receipt, the short message cat automatically sends the short message to the other short message receiving device, so that the operation and maintenance server cluster can normally receive the reported operation and maintenance information.
The intranet server monitoring system based on the short message cat provided by the embodiment of the invention can automatically monitor the operation and maintenance state of the intranet server, and operation and maintenance personnel can remotely know the operation state of the server without field operation, so that the labor cost is saved. The equipment has redundancy, and high availability of the system is guaranteed. The short message is sent by adopting binary coding, so that the number of bytes occupied by the content of the short message is reduced, and the application cost is saved.
In the first embodiment, the intranet server monitoring system based on the short message cat is provided, and correspondingly, the application also provides an intranet server monitoring method based on the short message cat. Please refer to fig. 2, which is a flowchart illustrating a method for monitoring an intranet server based on a short message cat according to a second embodiment of the present invention. Since the method embodiment is basically similar to the device embodiment, the description is simple, and the relevant points can be referred to the partial description of the device embodiment.
As shown in fig. 2, a flowchart of a method for monitoring an intranet server based on a short message cat according to another embodiment of the present invention is shown, where the monitoring method is applicable to the system for monitoring an intranet server based on a short message cat described in the first embodiment of the present invention, and the method includes:
s1: the application server cluster collects operation and maintenance monitoring information at regular time and sends the collected operation and maintenance monitoring information to the short message modem.
Specifically, the application server cluster is deployed in a local area network environment, operates a corresponding system to provide service for a customer, and sends a short message through the short message cat. The short message modem is a device which can send short messages by inserting the SIM card, and is connected to the server through a serial port, and the server can call the short message modem to send short messages by sending AT instructions to the serial port where the short message modem is located. The operation and maintenance information collected by the application server is mainly achieved through a python script, and the operation and maintenance monitoring information collected by the python script comprises the host names of the servers in the cluster, IP, the use condition of a CPU (Central processing Unit), the use condition of a memory, the use condition of each disk, the occupation condition of network bandwidth, the real-time data volume, the health condition of the applications such as php/nginx/mysql and the like. The statistical data of the Python script has a unique identification ID number, the operation and maintenance server can find out which node of which application server cluster the statistical data is sent from according to the ID number, the sending batch of the data can be determined, the statistical data sent by the Python script each time can be locally backed up, the longest allowed retention time of the backup is one year, the shortest is one month, and the configuration can be carried out according to the actual situation. The retention time is set to 3 months in this embodiment. Therefore, when the operation and maintenance personnel track the fault, the corresponding log record can be found on the application server, and the problem is conveniently checked. And after the python script program finishes collecting the basic data, storing the collected data in a redis queue deployed on the current application server machine. The redis database is deployed in a distributed mode, high availability is guaranteed, and service is provided after a part of application servers are down and normally run. On an application server inserted with a SMM device, a python script reads data in a redis database, then the collected information is packaged by using a binary system according to a fixed rule, and finally a binary system code consisting of 01 is output, wherein the content of the SMM does not contain Chinese characters, so that the data length of the SMM sent by the SMM is shortened, and the application cost is saved. Each application server cluster has at least 2 SMATs, the default is a load balancing mode, and when one of the SMATs is down, the other SMATs can still normally provide services to ensure high availability.
S2: and the SMM cat receives the operation and maintenance monitoring information sent by the application server cluster and sends the operation and maintenance monitoring information to the SMM receiving equipment in a short message mode.
S3: and the short message receiving equipment receives the short message sent by the short message modem and sends the short message text information to the operation and maintenance server.
The short message receiving equipment is connected to the operation and maintenance server cluster, the short message receiving equipment transmits the short message received from the application server to the operation and maintenance server cluster, the operation and maintenance server decodes the received short message of the binary code according to a specified format, and the decoded data is stored in an operation and maintenance server database. And the operation and maintenance server also sets an alarm threshold value for each application server, compares the decoded data with the alarm threshold value, and if the decoded data exceeds the alarm threshold value or has a large difference with the alarm threshold value, the operation and maintenance server calls the short message cats on the monitoring server cluster to send alarm short messages to remind corresponding operation and maintenance personnel to process in time.
S4: and the operation and maintenance server cluster receives the short message text information sent by the short message receiving equipment and counts the operation and maintenance state data of the application server according to the short message text information.
Data on the application server cluster is collected once every hour, and even if the data are not collected, a short message is sent to the operation and maintenance server cluster after the specified time is reached, so that the application server node short message cat is normal. When the operation and maintenance server cluster does not receive the report short message of the application server cluster for 2 hours continuously, the abnormal state of the server is marked, and a short message alarm is immediately sent to corresponding operation and maintenance personnel to remind the personnel to process in time. In order to ensure high availability of the system, a redis database running on an application server is deployed for high availability, and when one application server goes wrong, other application servers automatically elect a main node and then continue to provide services. At least 2 sets of SMM systems are deployed in each application server cluster, one set of SMM corresponds to one collected data processing script, and when one server with the SMM fails, the other server can take all data reporting tasks. And at least 2 short message receiving devices are deployed, when the short message cat sends a short message to one of the short message receiving devices but does not receive the receipt, the short message cat automatically sends the short message to the other short message receiving device, so that the operation and maintenance server cluster can normally receive the reported operation and maintenance information.
The intranet server monitoring method based on the short message cat can automatically monitor the operation and maintenance state of the intranet server, and operation and maintenance personnel can remotely know the operation state of the server without field operation, so that the labor cost is saved. The equipment has redundancy, and high availability of the system is guaranteed. The short message is sent by adopting binary coding, so that the number of bytes occupied by the content of the short message is reduced, and the application cost is saved.
The invention also provides an embodiment of a computer-readable storage medium, in which a computer program is stored, which computer program comprises program instructions that, when executed by a processor, cause the processor to carry out the method described in the above embodiment.
The computer readable storage medium may be an internal storage unit of the terminal described in the foregoing embodiment, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the 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.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the terminal and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical 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, devices or units, and may also be an electric, mechanical or other form of connection.
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; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.