Method for automatically repairing jboss abnormity and collecting information

Through the open source monitoring platform, the jboss exception alarm information is analyzed and automatically repaired, which solves the problem of jboss abnormal information collection and notification, realizes the automatic repair and information collection of jboss, reduces the burden of operation and maintenance, and improves work efficiency and system stability.

CN119179596APending Publication Date: 2024-12-24SHANGHAI HANYIN DIGITAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411073232.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

It is difficult for the existing technology to automatically collect and promptly notify jboss abnormal information, resulting in an increase in the workload of operation and maintenance personnel and affect the work efficiency of development and operation and maintenance personnel.

Method used

Obtain exception alarm information of the jboss server through an open source monitoring platform, analyze the alarm type, perform automatic repair and information collection, use WeChat and email to notify developers, and automatically repair war package problems through vulnerability publishing platform.

Benefits of technology

Automatic repair and information collection of jboss exceptions is realized, which reduces the workload of operation and maintenance personnel, improves work efficiency, promptly notify developers, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179596A_ABST
    Figure CN119179596A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically repairing jboss abnormity and collecting information, and belongs to the technical field of jboss abnormity repairing. Comprising the following steps: S1, acquiring abnormal alarm information of a jboss server, and writing the abnormal alarm information into a monitoring data storage file; s2, monitoring the monitoring data storage file, and analyzing the abnormal alarm information to obtain analyzed alarm information; s3, judging according to the analyzed alarm information to obtain an alarm type; s4, the abnormity verification module carries out verification according to the alarm type, obtains a verification result, and sends the verification result to the central processing module; and S5, the central processing module collects abnormal information according to the verification result and the alarm type, and automatic repair is carried out. The technical scheme has the beneficial effects that the jboss can automatically collect the abnormal information and notify developers in time, so that the jboss can be automatically repaired, the workload of operation and maintenance personnel is reduced, and the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of jboss exception repair, and in particular to a jboss exception automatic repair and information collection method. Background Art

[0002] In their daily work, operation and maintenance personnel spend part of their time on daily maintenance and troubleshooting of jboss (J2EE's open source application server). Jboss exceptions include: jboss process loss and jboss memory overflow. Both will cause jboss to be unable to provide services. For the problem of jboss process loss, for example, if the environment where jboss is located is suddenly restarted, jboss cannot start by itself after the environment is started, resulting in the loss of the jboss process, and then unable to provide services to the outside world. Manual processing cannot be timely and effective. For the memory overflow problem, in general, the jboss old (the area for storing old versions of applications) area is full, that is, memory overflow. The temporary solution is to restart jboss, but this method can only temporarily solve the problem and cannot eliminate it. Therefore, the operation and maintenance personnel need to use jmap (a command tool for outputting memory objects) in the jboss environment to manually collect jboss memory exception information, and use jstack (a command tool for generating thread dump information) to obtain jboss stack information. After collecting these problems, they are manually sent to developers, allowing them to find out which war (java web project packaging) deployed in the jboss container has a problem, and then modify the logic of that war package to fix the bug (vulnerability).

[0003] In the prior art, when jboss has an exception, such as jboss memory overflow, it is difficult to automatically collect exception information and notify in time, which increases the workload of operation and maintenance personnel. When memory overflows or the jboss process is lost, it cannot be automatically repaired and restarted, thereby affecting the work efficiency of developers and operation and maintenance personnel. Summary of the invention

[0004] The purpose of the present invention is to provide a method for automatically repairing jboss exceptions and collecting information to solve the above technical problems;

[0005] A method for automatically repairing jboss exceptions and collecting information, comprising:

[0006] Step S1, obtaining abnormal alarm information of the jboss server through the open source monitoring platform, and writing the abnormal alarm information into the monitoring data storage file;

[0007] Step S2, monitoring the monitoring data storage file, parsing the abnormal alarm information, and obtaining parsed alarm information;

[0008] Step S3, determining the alarm type according to the parsed alarm information, wherein the alarm type includes a jboss memory overflow alarm and a jboss process loss alarm;

[0009] Step S4, the abnormality verification module performs verification according to the alarm type, obtains the verification result, and sends it to the central processing module;

[0010] Step S5, the central processing module collects abnormal information according to the verification result and the alarm type, and performs automatic repair.

[0011] Preferably, step S1 comprises,

[0012] Step S11, configuring a WeChat notification unit;

[0013] Step S12, after the open source monitoring platform obtains the abnormal alarm information, the abnormal alarm information is sent to the WeChat notification unit;

[0014] Step S13, calling the WeChat notification unit to write the host environment information, abnormal content information and status information in the abnormal alarm information into the monitoring data storage file.

[0015] Preferably, step S2 comprises,

[0016] Step S21, monitoring the monitoring data storage file through a monitoring script file, and determining whether the monitoring data storage file has been written, if yes, executing step S22, if no, continuing to monitor the monitoring data storage file;

[0017] Step S22, converting the content of the monitoring data storage file into a Python object through a format conversion file, performing field screening, and obtaining the parsed alarm information;

[0018] Step S23, modifying the field status in the monitoring data storage file.

[0019] Preferably, the parsed alarm information in step S2 includes a host name and alarm content;

[0020] The host name is an Internet Protocol address resolved through the domain name system.

[0021] Preferably, step S3 comprises,

[0022] The alarm type is determined according to the keywords in the parsed alarm information. If the old keyword exists, it is the jboss memory overflow alarm. If the errpid keyword exists, it is the jboss process loss alarm.

[0023] Preferably, step S4 comprises,

[0024] Initiate a get request to the client module of the host in the parsed alarm information according to the alarm type; when the alarm type is the jboss memory overflow alarm, if the return value received by the abnormality check module is 100, return false to the central processing module; if the return value received by the abnormality check module is less than 100, return true to the central processing module;

[0025] When the alarm type is the jboss process loss alarm, if the return value received by the exception check module is 0, false is returned to the central processing module; if the return value received by the exception check module is 200, true is returned to the central processing module.

[0026] Preferably, step S5 comprises,

[0027] Step S51, performing abnormal repair according to the alarm type and the verification result, if the verification determines that it is the jboss memory overflow alarm, executing step A; if the verification determines that it is the jboss process loss alarm, executing step B;

[0028] Step A, after collecting the exception information, sends the exception information to a designated developer through an exception notification module for automatic repair processing, including:

[0029] Step A1, collect the developer's name and corresponding email information from the war package maintenance platform by calling the abnormal information collection module, assemble to obtain assembly information, and notify the developer through the email notification unit for investigation;

[0030] Step A2, checking whether the restarted jboss server is normal, if yes, writing the repair success result into the monitoring data storage file, and sending the repair success result to the operation and maintenance personnel through the WeChat notification unit of the abnormal notification module; if no, writing the repair failure result into the monitoring data storage file, and sending the repair failure result to the operation and maintenance personnel through the WeChat notification unit;

[0031] Step A3, calling the interface of the vulnerability publishing platform, the vulnerability publishing platform publishes a troubleshooting task, and all the developers check whether the war package they are responsible for has a problem. If so, the remaining developers are notified by email to stop the troubleshooting, and the problem war package is obtained. After the repair operation is formulated for the problem war package, the vulnerability publishing platform assigns a repair work order. After the developer repairs the repair work order, the development work order is closed;

[0032] Step B, checking the status of the jboss server after restart, publishing the repair work order through the vulnerability publishing platform for automatic repair processing, including:

[0033] Step B1, check whether the jboss server is normal, if yes, write the successful repair result into the monitoring data storage file, and send the successful repair result to the operation and maintenance personnel through the WeChat notification unit, if no, write the failed repair result into the monitoring data storage file, and send the failed repair result to the operation and maintenance personnel through the WeChat notification unit;

[0034] Step B2, after formulating a repair operation for the problematic war package, calling the vulnerability publishing platform to assign the repair work order, after the developer repairs the repair work order, the development work order is closed.

[0035] Preferably, the abnormal notification module in step A includes:

[0036] The WeChat notification unit sends information via WeChat;

[0037] The email notification unit sends information in the form of email.

[0038] Preferably, the assembly information in step A1 includes the abnormal information of the jboss server, the alarm host address, the war package name, the department information corresponding to the war package, the name and email address of the developer.

[0039] Preferably, the input information of each war package of the war package maintenance platform in step A1 includes the war package name, the department information corresponding to the war package, and the name and email address of the developer.

[0040] The beneficial effect of the present invention is that: due to the adoption of the above technical solution, jboss can automatically collect abnormal information and promptly notify developers, thereby realizing automatic repair of jboss, reducing the workload of operation and maintenance personnel and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1It is a step diagram of the method for automatic repairing and information collection of jboss anomalies of the present invention;

[0042] Figure 2 is a schematic diagram of step S1 of the present invention;

[0043] Figure 3 is a schematic diagram of step S2 of the present invention;

[0044] Figure 4 is a schematic diagram of step S5 of the present invention;

[0045] Figure 5 is a schematic diagram of step A of the present invention;

[0046] Figure 6 is a schematic diagram of step B of the present invention;

[0047] Figure 7 It is a jboss abnormal automatic repair and information collection flow chart of the present invention;

[0048] Figure 8 It is a flow chart of information entry of war maintenance platform of the present invention;

[0049] Fig. 9 It is a flow chart of the client module of the present invention accessing the war maintenance platform / getinfo interface;

[0050] Fig.10 It is a flow chart of the client module of the present invention accessing the war maintenance platform / collect interface;

[0051] Fig.11 It is a flow chart of the abnormal notification module of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0054] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.

[0055] A method for automatically repairing jboss exceptions and collecting information, such as Figure 1 As shown, including,

[0056] Step S1, obtaining abnormal alarm information of the jboss server through the open source monitoring platform, and writing the abnormal alarm information into the monitoring data storage file;

[0057] Step S2, monitoring the data storage file, parsing the abnormal alarm information, and obtaining the parsed alarm information;

[0058] Step S3, determining the alarm type according to the parsed alarm information, the alarm types include jboss memory overflow alarm and jboss process loss alarm;

[0059] Step S4, the abnormality verification module performs verification according to the alarm type, obtains the verification result, and sends it to the central processing module;

[0060] Step S5: The central processing module collects abnormal information according to the verification result and the alarm type and performs automatic repair.

[0061] Specifically, the present invention provides a method for automatic repair and information collection of jboss exceptions, which is mainly used for jboss exception repair. For jboss memory overflow alarm, it can automatically collect exception information and promptly notify developers. For jboss process loss alarm, it can automatically restart to achieve automatic repair of jboss, reduce the workload of operation and maintenance personnel, and improve work efficiency.

[0062] In a preferred embodiment, Figure 2 As shown, step S1 includes,

[0063] Step S11, configuring a WeChat notification unit;

[0064] Step S12, after the open source monitoring platform obtains the abnormal alarm information, the abnormal alarm information is sent to the WeChat notification unit;

[0065] Step S13, calling the WeChat notification unit to write the host environment information, abnormal content information and status information in the abnormal alarm information into the monitoring data storage file.

[0066] Specifically, the abnormal alarm information is obtained in real time through the WeChat notification unit, which improves the efficiency and timeliness of abnormal handling, facilitates subsequent analysis and troubleshooting of abnormal problems, and improves the stability and reliability of the system.

[0067] In a preferred embodiment, Figure 3 As shown, step S2 includes,

[0068] Step S21, monitoring the monitoring data storage file through a monitoring script file, and determining whether the monitoring data storage file has been written, if yes, executing step S22, if no, continuing to monitor the monitoring data storage file;

[0069] Step S22, converting the contents of the monitoring data storage file into a Python object through a format conversion file, performing field screening, and obtaining parsed alarm information;

[0070] Step S23, modifying the field status in the monitoring data storage file.

[0071] Specifically, abnormal conditions or errors in the system can be discovered in time, and corresponding processing and repair can be carried out to improve the stability and reliability of the system. At the same time, by modifying the field status in the monitoring data storage file, the processed data can be marked to avoid repeated processing and improve processing efficiency.

[0072] In a preferred embodiment, the parsed alarm information in step S2 includes the host name and the alarm content;

[0073] A host name is an Internet Protocol address resolved through the Domain Name System.

[0074] Specifically, the host name (hostname), the hostname used in the present invention is configured in the internal DNS (Domain Name System) server. When the hostname is used to find the corresponding environment later, the hostname will be resolved into the corresponding IP (Internet Protocol address) through the internal DNS server to find the corresponding alarm environment. The simple hostname does not have the ability to find the environment.

[0075] In a preferred embodiment, step S3 includes:

[0076] Determine the alarm type based on the keywords in the parsed alarm information. If the keyword "old" exists, it is a jboss memory overflow alarm. If the keyword "errpid" exists, it is a jboss process loss alarm.

[0077] Specifically, by determining the alarm type through keywords, the problem can be quickly located, avoiding the need to search and analyze a large amount of logs or alarm information one by one, thus saving time and energy.

[0078] In a preferred embodiment, step S4 includes:

[0079] According to the alarm type, a get request is initiated to the client module of the host in the parsed alarm information. When the alarm type is a jboss memory overflow alarm, if the return value received by the exception check module is 100, false is returned to the central processing module. If the return value received by the exception check module is less than 100, true is returned to the central processing module.

[0080] When the alarm type is a jboss process loss alarm, if the return value received by the exception check module is 0, false is returned to the central processing module; if the return value received by the exception check module is 200, true is returned to the central processing module.

[0081] Specifically, the code automatically initiates a request to the client module, and makes judgments and processes based on the return value, reducing the need for manual intervention and improving processing efficiency. By performing exception checks based on the return value, it can be determined whether the host has problems such as memory overflow or process loss, and abnormal situations can be discovered and handled in a timely manner, thereby improving the stability and reliability of the system.

[0082] In a preferred embodiment, Figure 4-6 As shown, step S5 includes,

[0083] Step S51, perform abnormal repair according to the alarm type and the verification result. If the verification determines that it is a jboss memory overflow alarm, execute step A; if the verification determines that it is a jboss process loss alarm, execute step B;

[0084] Step A, after collecting the exception information, sends the exception information to the designated developer through the exception notification module for automatic repair processing, including:

[0085] Step A1, collect the developer's name and corresponding email information from the war package maintenance platform by calling the abnormal information collection module, assemble to obtain assembly information, and notify the developer through the email notification unit for troubleshooting;

[0086] Step A2, check whether the restarted jboss server is normal. If yes, write the repair success result into the monitoring data storage file, and send the repair success result to the operation and maintenance personnel through the WeChat notification unit of the abnormal notification module. If no, write the repair failure result into the monitoring data storage file, and send the repair failure result to the operation and maintenance personnel through the WeChat notification unit.

[0087] Step A3: Call the interface of the vulnerability publishing platform. The vulnerability publishing platform publishes the troubleshooting task. All developers check whether the war package they are responsible for has a problem. If so, email the remaining developers to stop the troubleshooting. After obtaining the problem war package and formulating a repair operation for the problem war package, the vulnerability publishing platform assigns a repair work order. After the developer repairs the repair work order, the development work order is closed.

[0088] Step B, check the status of the restarted jboss server, and publish a repair work order through the vulnerability release platform for automatic repair processing, including:

[0089] Step B1, check whether the jboss server is normal. If yes, write the repair success result into the monitoring data storage file, and send the repair success result to the operation and maintenance personnel through the WeChat notification unit. If no, write the repair failure result into the monitoring data storage file, and send the repair failure result to the operation and maintenance personnel through the WeChat notification unit.

[0090] Step B2: After formulating a repair operation for the problematic war package, call the vulnerability release platform to assign a repair work order. After the developer repairs the repair work order, the development work order is closed.

[0091] Specifically, from the developer's perspective, developers can receive information about war package anomalies in the jboss environment in a timely manner and invest in the development of repair code, reducing communication with operation and maintenance personnel. The efficiency of developing and repairing vulnerabilities is greatly improved through jboss exception collection and automatic repair.

[0092] To be more specific, from the perspective of operation and maintenance personnel, the workload is reduced and alarm problems can be known in a timely manner, which helps operation and maintenance personnel spend their time on more valuable things for the company.

[0093] In a preferred embodiment, the abnormal notification module in step A includes:

[0094] WeChat notification unit, which sends information via WeChat;

[0095] Email notification unit, sending information via email.

[0096] Specifically, by sending abnormal information in the form of WeChat and email, relevant personnel can be notified in a timely manner, enabling them to quickly respond to and handle abnormal situations, facilitate subsequent review and analysis of abnormal situations, and help trace and solve problems.

[0097] More specifically, sending exception notifications in an automated manner can save time and effort for manual notifications and improve the efficiency of handling exceptions.

[0098] In a preferred embodiment, the assembly information in step A1 includes the abnormal information of the jboss server, the alarm host address, the war package name, the department information corresponding to the war package, the developer's name and email address.

[0099] Specifically, by including the exception information of the jboss server, server exceptions can be located and resolved more quickly, improving the efficiency of troubleshooting; it is convenient to track and manage applications developed by different departments, improving the efficiency of project management; it is convenient for other team members or administrators to communicate and collaborate with developers, speeding up problem solving.

[0100] Specifically, integrating this information can help different team members collaborate better, reduce communication costs, and improve work efficiency.

[0101] In a preferred embodiment, the input information of each war package of the war package maintenance platform in step A1 includes the war package name, the department information corresponding to the war package, the developer's name and email address.

[0102] Specifically, by recording the department information corresponding to the war package, collaboration and knowledge sharing between different departments can be promoted. When other departments need to use a war package, they can find the corresponding department through the platform and communicate and coordinate with it to avoid duplicate development and waste of resources.

[0103] Reference Figure 7 When jboss loses a process or overflows memory, it means that the service is no longer available. Zabbix (open source monitoring platform) detects the anomaly and sends an alarm notification. The Zabbix platform calls the script file pre-configured on the web (global wide area network) page, namely the WeChat notification unit (weixin.py). Zabbix sends the captured content to weinxin.py. After receiving the passed content, the WeChat notification unit writes the host environment hostname (host name), content information and status information into the monitor.json file (monitoring data storage file) so that the central processing module can perform subsequent repair actions for the abnormal information and send messages to the operation and maintenance personnel through the WeChat interface.

[0104] The while-center-ops.py (monitoring script file) in the central processing module is always in the monitoring state, monitoring the writing of the monitor.json file by weixin.py from the exception information module. Once it finds that there is content written in monitor.json, it will parse the json content through json.loads (format conversion file), filter the state field as init, obtain the host name and alarm content, and modify the state field in the json (lightweight data exchange format) file to running, and then enter the stage of processing the request by the central processing module.

[0105] The central processing module processes requests mainly in two ways: processing jboss memory overflow alarms and processing jboss process loss alarms.

[0106] In response to the jboss memory overflow alarm, the central processing module uses the hostname and command parameters to initiate a request to the exception verification module. The exception verification module receives the message to verify the authenticity of the alarm. After the verification module determines that jboss is indeed abnormal through the transmitted command, it will return false to the central processing module.

[0107] If the return value received by the central processing module from the exception check module is false, it confirms the exception and determines the alarm content. If the alarm content contains the keyword old, it proves that it is a memory overflow alarm. If it is a memory overflow alarm, the central processing module will call the exception information collection module to collect jboss's memory information, stack information, department personnel, and email information.

[0108] After receiving the information collected by the exception information collection module, the type mail and content content are passed as parameters to the exception notification module. The exception notification module integrates and checks the passed content in a standardized format. If the type is mail, mail.py (mail notification unit) is called to obtain the recipient information from content, and the collected information is sent to the specified recipient in the form of an email. The email content, for example, the recipient's email address, the email subject is 192.168.11.12-Automatic Repair-JBoss Memory Overflow Alarm-Exception Information Collection, and the main content includes the alarm environment 192.168.11.2, the alarm content is jboss jvm memory overflow, the old area is full, the war packages deployed in the environment are aaa.war, bbb.war, ccc.war, the department belongs to the product development department, the developer is Zhang San, as well as the content collected by jmap information and jatack information. The information collected by JBoss exceptions is sent to the corresponding developers in one email at the same time. The purpose is to let the developers of each department check whether there is a problem with the war package of their department. After finding out that there is a problem with the war package of their department, they reply to the email to inform the personnel of other departments not to check it again, thereby improving work efficiency. After sending, the return value of true is returned to the central processing module.

[0109] Pass the hostname parameter to the automatic repair module app-restart-server.py, call the app-restart-server.py automatic repair module, and the automatic repair module directly initiates a request to the / restart interface of the client module while-app-client.py after receiving the request. After the client / restart interface receives the message, when the restart is completed, check that jboss has no problems and return the result true to the central processing module. After the central processing module receives the true from the automatic repair module, it determines that the restart is successful, changes the state status to completed, changes the chekres status to ok, and rewrites monit or.json file, and call the weixin.py module in the exception notification module to send the successful repair message to the operation and maintenance personnel through WeChat. After the operation and maintenance personnel confirm that there is no error, the automatic repair process ends; if the restart is unsuccessful, the state status is changed to failed, and the chekres status is changed to problem status, and re-written into the monitor.json file. The return value of the while-app-client.py module of the client client is false. After receiving the false return value, the automatic repair module feeds back to the central processing module. The central processing module receives the message of restart failure and calls the WeChat notification unit of the exception notification module. WeChat notifies the operation and maintenance personnel, allowing them to manually check.

[0110] After the email is successfully sent, it returns true to the central processing module and calls the API of the bug publishing platform. After receiving the information, the bug publishing platform creates a new bug and adds a task to the three developers, and saves the task content in MySQL (relational database management system). After receiving the email from the exception notification module, the relevant developers of each department check whether there is a problem with the war package of their department. After finding out that there is a problem with the war of their department, they reply to the email as soon as possible to notify the personnel of other departments not to check again. After replying to the email, they start to study the war package of the jboss memory overflow alarm. After the research has a specific plan, log in to the bug publishing platform, fill in the war name, the problems found, and the solutions to the automatic repair system by calling the interface of the bug repair platform. Automatically assign it to the development task ticket, click OK to complete the task supplement, this task is started, the developer modifies the code according to the problem and repackages the modified code, successfully puts the repaired war online, and after the tester verifies that there is no problem, the bug is repaired and the bug task can be closed, completing the entire jboss abnormal bug repair process, forming a good closed loop.

[0111] When the central processing module issues an alarm for the loss of the jboss process, it directly passes the hostname parameter to the automatic repair module, calls the app-restart-server.py automatic repair module, and then calls the / restart interface of the client module while-app-client.py through the automatic repair module to restart the jboss application. When the restart is completed, after checking that there is no problem with jboss, the state status is changed to completed, and the chekres status is changed to ok. The weixin.py module in the exception notification module is called to send a successful repair message to the operation and maintenance personnel through WeChat. After the operation and maintenance personnel confirm that there is no problem, the automatic repair process ends. If there is a problem in the inspection, the processing steps are the same as the above jboss old problem, and the automatic repair process ends.

[0112] After the developer replied to the email, he studied the war package of the jboss memory overflow alarm problem. After he had a specific plan, he logged into the bug publishing platform and filled in the war name, the problem found, and the solution into the automatic repair system. By calling the interface of the bug repair platform, it was automatically assigned to the development task ticket. After clicking OK, the task was completed. After this task was started, the developer modified the code according to the problem and repackaged the modified code. After successfully putting the repaired war online, the tester verified that there was no problem. The bug was fixed and the bug task was closed, completing the entire jboss abnormal bug repair process, forming a good closed loop.

[0113] The abnormality check module (check_err.py) receives the parameters hostname and alarm_keyword: old, and is called by the central processing module. After receiving the request from the central processing module, the abnormality check module confirms the hostname according to the hostname (DNS resolves this hostname into an IP address). The alarm_keyword (keyword) passed in has two situations:

[0114] If alarm_keyword is old, it is judged as a memory overflow alarm. A get request is initiated to / checkold of the client module while-app-client.py of the host with this hostname. If the received return value is 100, it proves that jboss has overflowed the memory. The abnormality check module returns false as the return value to the central processing module. If the return value is less than 100, it is normal. The abnormality check module returns true as the return value to the central processing module.

[0115] If alarm_keyword is errpid, it is determined that the jboss pid process is lost. A get request is initiated to / checkpid of the client module while-app-client.py of the host with this hostname. If the received return value is 0, it proves that the jboss pid process is lost and the service can no longer be provided normally. The exception check module returns false as the return value to the central processing module. If the return value is 200, it is normal. The exception check module returns true as the return value to the central processing module.

[0116] The exception information collection module collect-server.py is called by the central processing module, which is responsible for collecting jboss memory and stack exception information. It accepts the parameter hostname host name. The central processing module will initiate a get request to the / collect interface of the while-app-client.py module. The interface returns jmap jboss exception memory information and jstack jboss stack information. It initiates a get request to the / getinfo interface of the while-app-client.py module. The interface returns all war information, department and developer names and email information in the jboss problem environment. The central processing module receives the information returned by the two interfaces, assembles the information, and sends the assembled information to the relevant developers by email by calling the mail submodule in the exception notification module.

[0117] The exception notification module (notifiy.py) is called by the central processing module, which includes two units, weixin.py and mail.py. It is responsible for content integration and logical processing, and calls weixin.py or mail.py to send messages.

[0118] Receiving parameters: Parameter 1 is type (the type of information sent). If the type is mail, the mail.py module is called to send the message via email. If the type is weixin, the weixin.py module is called; Parameter 2 is content (the content of the received message).

[0119] The receiving parameter content of weixin.py is called by the exception notification module, and it also receives messages from zabbix, reassembles the content and sends it to the on-duty personnel through the WeChat interface, and writes the jboss exception information into the monitor.json file; the receiving parameters of mail.py, parameter 1 is the mailgroup recipient, parameter 2 is the context content, are called by the exception notification module, and send emails to the specified recipients.

[0120] Reference Fig.11 , the exception notification module receives the message. If jboss is in a normal state, the restart success information and normal notification information are connected to the third-party WeChat interface to notify the operation and maintenance personnel; if it is an abnormal state, on the one hand, it receives the weixin parameter and content content, and connects the abnormal alarm information and restart failure information to the third-party WeChat interface to notify the operation and maintenance personnel. On the other hand, it receives the mail parameter and content content, and sends the content collected by the exception information collection module to the personal mailbox. After receiving the email, the developer will troubleshoot the problem. The collected content includes the developer's name, war package name, department information, abnormal memory information, and abnormal stack information.

[0121] The platform interface developed by the company itself is used to obtain department information and developer mailboxes. The following is an introduction to the platform developed by the company itself.

[0122] Reference Figure 8 The war package maintenance platform is also the war package management platform. Every time before a new war package goes online, someone will manually log in to the database of this platform and enter the information of this war package. The entered information includes the name of the war package, the corresponding department, the developer of this war package, and the developer's email address.

[0123] The platform provides external query interfaces, as follows:

[0124] The interface name is / getinfo

[0125] The receiving parameter is the war name

[0126] The returned result is the department name and the name and email address of the war package developer.

[0127] The specific logic is that after the platform interface receives the request, it will first obtain a list of all war packages passed from the outside, traverse the list of war packages, open the warinfo table in the MySQL database, and use the statement select * from warinfo where warname = 'war package name' to filter out qualified fields and return them to the platform. After logical processing, the platform returns the department name, developer's name and email address to the requester.

[0128] The bug publishing platform is a platform for developers to publish bugs. It provides an API interface for the automatic repair system to call. Developers only need to log in to complete the tasks assigned by the automatic repair system and complete the repair of the bug. Only after the bug is successfully repaired can the work order be closed.

[0129] The parameters received by the bug release platform are as follows:

[0130] The interface for creating / updating tasks is / job

[0131] type:create: create a task update: update a task

[0132] content: Alarm content

[0133] hostname: alarm host

[0134] mail: Developer's email address.

[0135] After the automatic repair module app-restart-server.py is called by the central processing module, it directly initiates a request to the / restart interface of the client module while-app-client.py. After the client / restart interface receives the message, it restarts jboss. If jboss restarts successfully or fails, it returns true or false to the automatic repair module. After receiving the message, the automatic repair module returns true or false to the central processing module. After receiving the message, if the restart is successful, the central processing module changes the state status to completed, and changes the chekres status to ok, and rewrites the modified information into monit In or.json, the whole process ends when the automatic repair process ends. If the restart fails, the return value of the client is false. After receiving the return value of false, the automatic repair module feeds back to the central processing module. The central processing module calls the exception notification module and sends parameters including parameter 1, which is type: weixin, and parameter 2, which is content: jboss. The restart failed and is sent to the exception notification module. The exception notification module judges the type received and judges that type is weixin. Then it calls the WeChat submodule and sends the content of parameter 2 to the WeChat submodule. The WeChat submodule calls the interface of the third-party WeChat to send the message to the operation and maintenance personnel, so that the operation and maintenance personnel can investigate the restart failure.

[0136] The while-app-client.py client module is deployed in the client's jboss environment. It receives requests from the exception check module, the automatic repair module, and the exception information collection module. After processing the request, it returns the information result to the corresponding module. The details of the called interface are as follows:

[0137] 1. / restart interface, the request method is GET, no receiving parameters, it is the automatic repair module service, responsible for restarting the jboss instance;

[0138] 2. / getinfo interface, the request method is GET, no receiving parameters, serves the abnormal information collection module, is responsible for collecting war information, department and personnel and mailbox information, and feeds it back to the abnormal information collection module;

[0139] 3. / collect interface, the request method is GET, no receiving parameters, serves the exception information collection module, and is responsible for collecting jboss exception logs;

[0140] 4. / checkold interface, the request method is GET, no receiving parameters, it is the abnormality check module service, responsible for detecting the jboss memory overflow status, the return value is 100, it proves that the jboss memory overflows, the return value is less than 100, it proves that the jboss memory is normal;

[0141] 5. / checkpid interface, the request method is GET, no receiving parameters, it is the exception check module service, responsible for detecting the process status of jboss, the access status return value 200, proves that jboss provides services normally, the return value 0, jboss provides services abnormally.

[0142] The client module receives requests from various modules. The specific steps are as follows:

[0143] 1. When the client receives the request from the automatic repair module for the interface / restart interface, it will restart jboss. The specific command for restarting jboss is / etc / init.d / jboss-server restart;

[0144] 2. When the client receives the request for the / getinfo interface from the exception information collection module, the specific method of collecting jboss information is as follows: Get all war packages in the jboss container through the following command: / opt / jboss / bin / twiddle.sh -s localhost:1099 query jboss.web.deployment:* | grep -Ev "ROOT | web-console | jbossws | admin-console | jmx-console | invoker" | sed

[0145] 's / jboss.web.deployment:war=\ / / / g' command to obtain all war packages deployed under jboss;

[0146] Reference Fig. 9, obtain department information and developer email addresses, assemble the obtained war packages into a list through the append method in the Python list, and use the war list as a parameter to initiate a get request to the war package maintenance platform / getinfo interface. After receiving the war list, the war package maintenance platform traverses to obtain each war package, and uses the war package name as a condition to query the database to obtain the department corresponding to each war package, the developer's email address, and the developer's name corresponding to the department. After obtaining this information, assemble the email information;

[0147] 3. Reference Fig.10 When the client receives a request from the exception information collection module to the / collect interface, the specific steps for collecting jboss information are as follows:

[0148] Get the process ID of jboss: pid through the ps-ef|grep / opt / jboss|grep-v / bin / sh|awk-F"'{print$2}' command;

[0149] Get jboss memory information: jmap-histo plus jboss process number to get jboss abnormal memory information;

[0150] Get jboss stack information: jstack-F plus jboss process number to get jboss exception stack information;

[0151] 4. When the client receives a request from the exception check module to the / checkold interface, the specific steps to collect jboss information are as follows:

[0152] Get the process ID of jboss: pid through the ps-ef|grep / opt / jboss|grep-v / bin / sh|awk-F"'{print$2}' command;

[0153] Get the old value of jboss through jstat-gcutil jboss process number|awk-F"'{print$4}'|sed-n'2,2p' and return it to the exception check module. A return value of 100 indicates an exception, and a return value of less than 100 indicates a normal state.

[0154] 5. When the client receives a request from the exception check module to the / checkpid interface, the specific steps to collect jboss information are as follows:

[0155] Use ps-ef|grep / opt / jboss' to check whether there is a jboss process. If the process exists, use curlhttp: / / 127.0.0.1:8080 port to check whether the return value status is 200. 200 is normal, and 200 is returned as the return value to the exception check module. If it is not 200 or the process does not exist, jboss is abnormal, and 0 is returned as the return value to the exception check module.

[0156] The entire process of collecting information by the abnormal information collection module includes: the hostname of the JBoss environment of the alarm is a12c.zr.example, and the corresponding host address is resolved by resolving the a12c.zr.example domain name through the DNS server: 192.168.11.2.

[0157] In this environment, in the jboss:192.168.11.2 environment, the four war packages aaa.warbbb.war, ccc.war, ddd.war, and eee.war are obtained through the exception information collection module.

[0158] You need to obtain department information and developer email addresses, use the war list as a parameter to initiate a request to the war package maintenance platform / getinfo interface, obtain the departments, developer email addresses, and developer names corresponding to all war packages, and assemble the email information after obtaining this information.

[0159] The obtained content is as follows:

[0160] The three war packages aaa.war, bbb.war, and ccc.war belong to the product development department. The corresponding contact email address is zhangsan@126.com, and the developer is Zhang San.

[0161] ddd.war belongs to the core system department, the corresponding contact email is lisi@126.com, the developer is Li Si;

[0162] eee.war belongs to the financial division, the corresponding contact email is: wangwu@126.com, the developer is Wang Wu;

[0163] The assembly includes the alarm host address, department information, relevant developers and email addresses, war package name, and exception information.

[0164] After the information collection module receives the information summary from the client, the information collection module returns the collected jboss memory information, stack information, department personnel and mailbox information to the central processing module. After receiving the information collected by the information collection module, the central processing module passes the type mail and content content as parameters to the exception notification module notify.py. The exception notification module integrates the passed content in a standardized format, and if the type is mail, it calls the mail.py module to obtain the recipient information from the content and send the collected summary information to the specified recipient in the form of an email.

[0165] The text content written to monitor.json when the memory overflows is as follows:

[0166] When the jboss memory overflow old area is full, weixin.py writes the content of monitor.json.

[0167] {"33135680":{"content":"a121c.zr.hpay app01_old area full","updatetime":"2023-09-06 14:20:30","state":"init","hostname":"a121c.zr.hpay","checkres":"warning"}};

[0168] When the central processing module and the exception check module intervene, the content of monitor.json is written.

[0169] {"33135680":{"content":"a121c.zr.hpay app01_old area full","updatetime":"2023-09-06 14:22:30","state":"running","hostname":"a121c.zr.hpay","checkres":"problem"}};

[0170] The content of monitor.json when the automatic repair is completed,

[0171] {"33135680":{"content":"a121c.zr.hpay app01_old area is full","updatetime":"2023-09-06 14:25:30","state":"completed","hostname":"a121c.zr.hpay","checkres":"ok"}};

[0172] The text content written to monitor.json when the jboss process is lost is as follows:

[0173] When the jboss process loses the web unresponsive alarm, weixin.py writes the content of monitor.json,

[0174] {"32221859":{"content":"a96c.zr.hpay app01_web is not responding","updatetime":"2023-07-17 17:50:11","state":"init","hostname":"a96c.zr.hpay","checkres":"warning"}};

[0175] When the central processing module and the exception check module intervene, the content of monitor.json is written.

[0176] {"32221859":{"content":"a96c.zr.hpay app01_web is not responding","updatetime":"2023-07-17 17:52:11","state":"running","hostname":"a96c.zr.hpay","checkres":"problem"}};

[0177] The content of monitor.json when the automatic repair is completed,

[0178] {"32221859":{"content":"a96c.zr.hpay app01_web is not responding","updatetime":"2023-07-17 17:57:11","state":"completed","hostname":"a96c.zr.hpay","checkres":"ok"}}.

[0179] In summary, this application provides a method for automatic repair and information collection of jboss exceptions, which is mainly used for process automation, and can automatically restart the process if it is lost, without human intervention. For memory overflow, the jboss memory overflow exception information is automatically collected and sent to the designated developer, which improves the stability of the system, reduces the communication between operation and maintenance and development, and improves work efficiency. It is based on actual scenarios and usage experience and meets actual needs.

[0180] The above description is only a preferred embodiment of the present invention, and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically repairing jboss anomalies and collecting information, characterized in that: include, Step S1, obtaining abnormal alarm information of the jboss server through the open source monitoring platform, and writing the abnormal alarm information into the monitoring data storage file; Step S2, monitoring the monitoring data storage file, parsing the abnormal alarm information, and obtaining parsed alarm information; Step S3, determining the alarm type according to the parsed alarm information, wherein the alarm type includes a jboss memory overflow alarm and a jboss process loss alarm; Step S4, the abnormality verification module performs verification according to the alarm type, obtains the verification result, and sends it to the central processing module; Step S5, the central processing module collects abnormal information according to the verification result and the alarm type, and performs automatic repair.

2. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: Step S1 comprises, Step S11, configuring a WeChat notification unit; Step S12, after the open source monitoring platform obtains the abnormal alarm information, the abnormal alarm information is sent to the WeChat notification unit; Step S13, calling the WeChat notification unit to write the host environment information, abnormal content information and status information in the abnormal alarm information into the monitoring data storage file.

3. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: Step S2 comprises, Step S21, monitoring the monitoring data storage file through a monitoring script file, and determining whether the monitoring data storage file has been written, if yes, executing step S22, if no, continuing to monitor the monitoring data storage file; Step S22, converting the content of the monitoring data storage file into a Python object through a format conversion file, performing field screening, and obtaining the parsed alarm information; Step S23, modifying the field status in the monitoring data storage file.

4. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: The parsed alarm information in step S2 includes the host name and the alarm content; The host name is an Internet Protocol address resolved through the domain name system.

5. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: Step S3 comprises, The alarm type is determined according to the keywords in the parsed alarm information. If the old keyword exists, it is the jboss memory overflow alarm. If the errpid keyword exists, it is the jboss process loss alarm.

6. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: Step S4 comprises, Initiate a get request to the client module of the host in the parsed alarm information according to the alarm type; when the alarm type is the jboss memory overflow alarm, if the return value received by the abnormality check module is 100, return false to the central processing module; if the return value received by the abnormality check module is less than 100, return true to the central processing module; When the alarm type is the jboss process loss alarm, if the return value received by the exception check module is 0, false is returned to the central processing module; if the return value received by the exception check module is 200, true is returned to the central processing module.

7. The method for automatically repairing and collecting information of jboss anomalies according to claim 1, characterized in that: Step S5 comprises, Step S51, performing abnormal repair according to the alarm type and the verification result, if the verification determines that it is the jboss memory overflow alarm, executing step A; If the verification determines that the jboss process is lost, execute step B; Step A, after collecting the exception information, sends the exception information to a designated developer through an exception notification module for automatic repair processing, including: Step A1, collect the developer's name and corresponding email information from the war package maintenance platform by calling the abnormal information collection module, assemble to obtain assembly information, and notify the developer through the email notification unit for investigation; Step A2, checking whether the restarted jboss server is normal, if yes, writing the repair success result into the monitoring data storage file, and sending the repair success result to the operation and maintenance personnel through the WeChat notification unit of the abnormal notification module; if no, writing the repair failure result into the monitoring data storage file, and sending the repair failure result to the operation and maintenance personnel through the WeChat notification unit; Step A3, calling the interface of the vulnerability publishing platform, the vulnerability publishing platform publishes a troubleshooting task, and all the developers check whether the war package they are responsible for has a problem. If so, the remaining developers are notified by email to stop the troubleshooting, and the problem war package is obtained. After the repair operation is formulated for the problem war package, the vulnerability publishing platform assigns a repair work order. After the developer repairs the repair work order, the development work order is closed; Step B, checking the status of the jboss server after restart, publishing the repair work order through the vulnerability publishing platform for automatic repair processing, including: Step B1, check whether the jboss server is normal, if yes, write the successful repair result into the monitoring data storage file, and send the successful repair result to the operation and maintenance personnel through the WeChat notification unit, if no, write the failed repair result into the monitoring data storage file, and send the failed repair result to the operation and maintenance personnel through the WeChat notification unit; Step B2, after formulating a repair operation for the problematic war package, calling the vulnerability publishing platform to assign the repair work order, after the developer repairs the repair work order, the development work order is closed.

8. The method for automatically repairing and collecting information of jboss anomalies according to claim 7, characterized in that: The abnormal notification module in step A includes: The WeChat notification unit sends information via WeChat; The email notification unit sends information in the form of email.

9. The method for automatically repairing and collecting information of jboss anomalies according to claim 7, characterized in that: The assembly information in step A1 includes the abnormal information of the jboss server, the alarm host address, the war package name, the department information corresponding to the war package, the name and email address of the developer.

10. The method for automatically repairing jboss anomalies and collecting information according to claim 7, characterized in that: The input information of each war package of the war package maintenance platform in step A1 includes the war package name, the department information corresponding to the war package, and the name and email address of the developer.

Citation Information

Cited By

  • Unified management method, system and equipment for multiple JBOSS instances

    CN121349663A