Summary of the invention
In view of this, the invention provides a kind of active and standby machine management method and server, can the standby host monitoring information be sent to the target receiving equipment by main frame.
For addressing the above problem, the invention provides a kind of active and standby machine management method, may further comprise the steps: main frame obtains the standby host monitoring information; Described standby host monitoring information is standby host alarm data or standby host status data; Described main frame sends to the target receiving equipment with described standby host monitoring information.
Described standby host monitoring information is the standby host alarm data;
Described active and standby machine management method also comprises:
Described main frame obtains the main frame alarm data;
Described main frame sends to described target receiving equipment with described main frame alarm data.
Described main frame obtains the main frame alarm data and is specially:
Described main frame obtains the Host Status data;
Described main frame obtains the first alarm threshold corresponding to described Host Status data;
Described main frame obtains described main frame alarm data according to described Host Status data and described the first alarm threshold.
Described main frame obtains the standby host monitoring information and is specially:
Described main frame receives the standby host alarm data that described standby host sends; Or
Described main frame obtains standby host status data and the second alarm threshold corresponding to described standby host status data, and according to described standby host status data and described the second alarm threshold, obtains described standby host alarm data.
Described standby host monitoring information is the standby host status data;
Described main frame also comprises before obtaining the standby host monitoring information:
Described main frame receives the status data request message that described target receiving equipment sends;
Described main frame is transmitted to described standby host with described status data request message.
Described active and standby machine management method also comprises:
Described main frame obtains the Host Status data;
Described main frame sends to the target receiving equipment with described standby host monitoring information and is specially:
Described main frame sends to described target receiving equipment with described Host Status data and described standby host status data.
Described active and standby machine management method also comprises:
Described main frame judges whether comprise Floating IP address among the machine IP;
Described main frame redefines active and standby machine state when judging described the machine IP and do not comprise described Floating IP address.
The present invention also provides a kind of server, comprising: the first acquisition module is used for obtaining the standby host monitoring information; Described standby host monitoring information is standby host alarm data or standby host status data; Sending module is used for described standby host monitoring information is sent to the target receiving equipment.
The described standby host monitoring information that described the first acquisition module obtains is the standby host alarm data;
Described server also comprises:
The second acquisition module is used for obtaining the main frame alarm data;
Described sending module is further used for described main frame alarm data is sent to described target receiving equipment.
The described standby host monitoring information that described the first acquisition module obtains is the standby host status data;
Described server also comprises:
Receiver module is used for receiving the status data request message that described target receiving equipment sends;
Forwarding module is used for described status data request message is transmitted to described standby host.
Described server also comprises:
The 3rd acquisition module is used for obtaining the Host Status data;
Described sending module is further used for described Host Status data and described standby host status data are sent to described target receiving equipment.
The present invention has following beneficial effect:
Main frame can obtain main frame alarm data and standby host alarm data, and main frame alarm data and standby host alarm data sent to the target receiving equipment, in addition, main frame can also be when receiving the request of standby host status data, the standby host status data is sent to the target receiving equipment, solve the limitation that webmaster machine in the prior art or other external equipments can't manage standby host, realized the unified alarm of active and standby machine, strengthened the stability of active and standby machine and to the monitoring capacity of active and standby machine;
Main frame has powerful messaging protocol adaptation ability, can cooperate with the Message Agent of supporting different agreement, from different external device communications;
Whether change by the Floating IP address of periodically monitoring the machine, judge whether main preparation system active and standby switching occurs, needn't rely on third party software to judge, realize simply having reduced the dependence to active and standby machine itself.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.
The active and standby machine management method of the embodiment of the invention can be applicable in any main preparation system, described main preparation system comprises a main frame and at least one standby host, below all be to comprise that in main preparation system a standby host is example, active and standby machine management method to the embodiment of the invention describes, and namely main preparation system is dual systems.When comprising a plurality of standby host in main preparation system, its implementation is identical with the implementation method of dual systems, will be not described in detail.The active and standby machine management method of the embodiment of the invention may further comprise the steps:
Step 1, main frame are obtained the standby host monitoring information; Described standby host monitoring information can be the various information of standby host, such as standby host alarm data or standby host status data etc.
Step 2, described main frame sends to the target receiving equipment with described standby host monitoring information.Described target receiving equipment can be for: webmaster machine, mailing system or based on SMPP (Short Message Peer to Peer, Short Message Peer to Peer), CMPP (China Mobile Peer to Peer, China Mobile Peer to Peer Protocol) or the equipment such as the sms center of the different agreement such as SGMP (China Telecom's Personal Handyphone System SMGP) or Short Message Service Gateway, thereby the standby host monitoring information can be sent on user's the equipment such as mailbox, mobile phone or Personal Handyphone System, to realize that the user is to the management of standby host.
The below is take described standby host monitoring information as the standby host alarm data as example, and the active and standby machine management method of the embodiment of the invention is described.
Be illustrated in figure 1 as the schematic flow sheet of the active and standby machine management method of the embodiment of the invention, described active and standby machine management method may further comprise the steps:
Step 101, main frame are obtained the main frame alarm data; Described alarm data can be CPU usage alarm data, rotation speed of the fan alarm data, hard-disc storage amount alarm data or system login number alarm data etc.
Step 102, described main frame obtains the standby host alarm data; When comprising a plurality of standby host in main preparation system, described main frame obtains the alarm data of described a plurality of standby hosts.
Step 103, described main frame sends to the target receiving equipment with described main frame alarm data and described standby host alarm data.Can dispose the Message Agent entity (agent) of supporting different agreement on the described main frame, to communicate from different target receiving equipment.
Certainly, only having main frame to produce alarm data, when perhaps only having standby host to produce alarm data, described main frame only needs that main frame alarm data or standby host alarm data are sent to the target receiving equipment and gets final product.
In above-described embodiment, main frame and standby host can obtain respectively the local alarm data, and standby host sends to main frame with the alarm data that gets access to, and main frame sends to the target receiving equipment with main frame alarm data and standby host alarm data.The below is take described target receiving equipment as the webmaster machine as example, and the active and standby machine management method of the embodiment of the invention is described.
Be illustrated in figure 2 as another schematic flow sheet of the active and standby machine management method of the embodiment of the invention, described active and standby machine management method may further comprise the steps:
Step 201, main frame are obtained the Host Status data; Described status data can be the status datas such as CPU usage, rotation speed of the fan, hard-disc storage amount or system login number.
Step 202, described main frame are obtained the first alarm threshold corresponding to described Host Status data;
Step 203, described main frame obtains described main frame alarm data according to described Host Status data and described the first alarm threshold.The CPU usage of supposing to get access to the machine is 95%, and alarm threshold corresponding to described CPU usage is 90%, and at this moment, CPU usage exceeds alarm threshold, then produces the CPU usage alarm data.If getting access to the CPU usage of the machine is 80%, at this moment, CPU usage does not exceed alarm threshold, then need not to produce the CPU usage alarm data.
Step 204, standby host are obtained the standby host status data;
Step 205, described standby host are obtained the second alarm threshold corresponding to described standby host status data;
Step 206, described standby host obtains described standby host alarm data according to described standby host status data and described the second alarm threshold;
Step 207, described standby host sends to described main frame with described standby host alarm data; Communication between main frame and the standby host can be adopted the WINNTTCP agreement of standard, and at this moment, standby host can be adapted to WINNTTCP message with the alarm data that needs send and send to main frame.
Step 208, described main frame receive the standby host alarm data that described standby host sends, and described main frame alarm data and described standby host alarm data are sent to the Message Agent entity; Described Message Agent entity is arranged in main frame, is used for communicating by letter with the webmaster machine.Described main frame is adapted to the internal interface data with described main frame alarm data and described standby host alarm data and sends to described Message Agent entity.
Step 209, described Message Agent entity sends to the webmaster machine with described main frame alarm data and described standby host alarm data.Described Message Agent entity can be adapted to above-mentioned alarm data SNMP (SimpleNetwork Management Protocol, Simple Network Management Protocol) message and send to the webmaster machine.
In addition, described main frame also can periodically go to detect the running status of standby host, send condition monitoring message to standby host, if do not receive the response message that standby host returns, perhaps can't lead to standby host by ping, described main frame then can initiatively produce the standby host alarm data, and sends to the webmaster machine by described Message Agent entity.
To obtain the standby host alarm data by standby host in above-described embodiment, and the standby host alarm data sent to main frame, be transmitted to the webmaster machine by main frame, certainly, also can initiatively remove to obtain the standby host status data by main frame, and second alarm threshold corresponding according to the standby host status data, obtain the standby host alarm data, then the standby host alarm data is sent to the webmaster machine, yet, this kind mode can increase the processing load of main frame, and the disposal ability of main frame is had relatively high expectations.
The active and standby machine management method that provides by above-described embodiment, main frame can obtain main frame alarm data and standby host alarm data, and main frame alarm data and standby host alarm data sent to the target receiving equipment, solved the limitation that webmaster machine in the prior art or other external equipments can't obtain the standby host alarm data, realize the unified alarm of active and standby machine, strengthened the stability of active and standby machine and to the monitoring capacity of active and standby machine.
Above-described embodiment, main frame can send alarm data to the target receiving equipment when the machine or standby host produce alarm data, certainly, also can remove in real time to obtain the status data of main frame and standby host with described target receiving equipment.
The below is take described standby host monitoring information as the standby host status data as example, and the active and standby machine management method of the embodiment of the invention is described.
Be illustrated in figure 3 as the another schematic flow sheet of the active and standby machine management method of the embodiment of the invention, described active and standby machine management method may further comprise the steps:
Step 301, the status data request message that main frame receiving target receiving equipment sends; Described target receiving equipment can be for: webmaster machine, mailing system or based on equipment such as the sms center of the different agreements such as SMPP, CMPP or SGMP or Short Message Service Gateway.
Step 302, described main frame is transmitted to described standby host with described status data request message;
Step 303, described main frame obtains the Host Status data;
Step 304, described main frame obtains the standby host status data; Concrete, standby host according to the request content of described status data request message, obtains the standby host status data, and sends to main frame after receiving described status data request message;
Step 305, described main frame sends to described target receiving equipment with described Host Status data and described standby host status data.
Certainly, described target receiving equipment also can only be asked the standby host status data, and at this moment, main frame then need not to obtain the Host Status data, directly the standby host status data that gets access to is sent to the target receiving equipment and gets final product.
The below is take described target receiving equipment as the webmaster machine as example, and the active and standby machine management method of the embodiment of the invention is described.
Be illustrated in figure 4 as an again structural representation of the active and standby machine management method of the embodiment of the invention, described active and standby machine management method may further comprise the steps:
Step 401, the webmaster machine issues the request message that obtains Host Status data and standby host status data to the Message Agent entity of main preparation system; Be provided with the Floating IP address of described main preparation system in the described Message Agent entity, described webmaster machine is by described Floating IP address and described Message Agent entity communication;
Step 402, described Message Agent entity sends to main frame with the described request message that receives; At this moment, described Message Agent entity can be adapted to described request message the internal interface data and send described main frame;
Step 403, described main frame is transmitted to standby host with described request message; At this moment, described main frame can be adapted to described request message WINNTTCP message and send to described standby host.
Step 404, described host analysis described request message is obtained the Host Status data that the webmaster machine is asked;
Step 405, described standby host is analyzed described request message, obtains the standby host status data that the webmaster machine is asked;
Step 406, described standby host sends to described main frame with described standby host status data;
Step 407, described main frame sends to described Message Agent entity with described Host Status data and standby host status data; At this moment, described main frame can be adapted to the internal interface data with described Host Status data and standby host status data and send to described Message Agent entity.
The described Host Status data that step 408, described Message Agent entity will receive and standby host status data are adapted to snmp message and send to described webmaster machine.
Main frame in the embodiment of the invention has powerful messaging protocol adaptation ability, by with the cooperating of the Message Agent of supporting different agreement, communicate by letter from different target receiving equipments.For example, the target receiving equipment in above-described embodiment be except can also being other equipment for the webmaster machine, and such as mailing system etc., main frame can be communicated by letter with mailing system by the Message Agent of supporting the mailing system agreement.
The active and standby machine management method that provides by above-described embodiment, main frame can be when receiving the monitoring information request, Host Status data and standby host status data are sent to the target receiving equipment of monitoring information, solved the limitation that webmaster machine in the prior art or other external equipments can't obtain the standby host status data, realize the unified management of active and standby machine, strengthened the stability of active and standby machine and to the monitoring capacity of active and standby machine.
In addition, in the above-described embodiments, the server in the main preparation system also needs to determine the active and standby machine state of the machine when starting.In the embodiment of the invention, the server in the main preparation system can by inquiring about mutually the other side's active and standby machine state, be confirmed the active and standby machine state of the machine.
Be illustrated in figure 5 as the schematic flow sheet of definite method of the active and standby machine state of the embodiment of the invention, said method comprising the steps of:
Step 501, first server send the message of the active and standby machine state of inquiry second server to second server;
Step 502, described first server judges whether to receive the response message of described second server, if so, execution in step 503, otherwise, execution in step 504;
Step 503, described first server is according to described response message, judge the active and standby machine state of described second server, in described response message, show when described second server is standby host, execution in step 506 shows when described second server is main frame execution in step 507 in described response message, the active and standby machine state that shows described second server in described response message is not determined execution in step 504;
Step 504, described first server is obtained the machine IP;
Step 505, described first server is judged the Floating IP address that whether comprises dual systems among described the machine IP, if so, execution in step 506, otherwise, return step 501;
It is main frame that step 506, described first server arrange the active and standby machine state of the machine;
It is standby host that step 507, described first server arrange the active and standby machine state of the machine.
Above-mentioned second server need to be inquired about the active and standby machine state of described first server equally, and is similar to the above embodiments, is not described in detail at this.
In addition, after confirming the active and standby machine state of the machine, described first server also needs periodically to inquire about the machine IP, judges whether the Floating IP address of dual systems changes.
When described first server was main frame, said method was further comprising the steps of:
Step 508, first server are obtained the machine IP;
Step 509, described first server is analyzed the Floating IP address that whether comprises dual systems among the machine IP, if so, behind the Preset Time interval, returns step 508, otherwise, return step 501, reaffirm active and standby machine state;
When described first server is standby host, said method comprising the steps of:
Step 510, first server are obtained the machine IP;
Step 511, described first server is analyzed the Floating IP address that whether comprises dual systems among the machine IP, if not, behind the Preset Time interval, returns step 510, otherwise, return step 501, reaffirm active and standby machine state.
In above-described embodiment, whether main frame and standby host can change by the Floating IP address of periodically monitoring the machine, judge whether main preparation system active and standby switching occurs, and needn't rely on third party software to judge, realize simply having reduced the dependence to active and standby machine itself.
Be illustrated in figure 6 as the structural representation of the server of the embodiment of the invention, described server can be applicable in any main preparation system, described main preparation system comprises a main frame and at least one standby host, below all be to comprise that in main preparation system a standby host is example, server to the embodiment of the invention describes, and namely main preparation system is dual systems.When comprising a plurality of standby host in main preparation system, its implementation is identical with the implementation method of dual systems, will be not described in detail.
Described server is used for carrying out the operation that main frame described in the above-mentioned active and standby machine management method embodiment is carried out, and described server comprises:
The first acquisition module 601 is used for obtaining the standby host monitoring information; Described standby host monitoring information can be the various information of standby host, such as standby host alarm data or standby host status data etc.
Sending module 602 is used for described standby host monitoring information is sent to the target receiving equipment.Described target receiving equipment can be for: webmaster machine, mailing system or based on equipment such as the sms center of the different agreements such as SMPP, CMPP or SGMP or Short Message Service Gateway, thereby the standby host monitoring information can be sent on user's the equipment such as mailbox, mobile phone or Personal Handyphone System, to realize that the user is to the management of standby host monitoring information.
The below is take described standby host monitoring information as the standby host alarm data as example, and the server of the embodiment of the invention is described.
Be illustrated in figure 7 as another structural representation of the server of the embodiment of the invention, in the embodiment of the invention, the described standby host monitoring information that described the first acquisition module 601 obtains is the standby host alarm data; On the basis of embodiment shown in Figure 6, described server also comprises:
The second acquisition module 603 is used for obtaining the main frame alarm data; Described alarm data can be CPU usage alarm data, rotation speed of the fan alarm data, hard-disc storage amount alarm data or system login number alarm data etc.
Described sending module 602 is further used for described main frame alarm data is sent to described target receiving equipment.Described sending module 602 can be supported by configuration the Message Agent entity of different agreement, communicates by letter from different target receiving equipments.
In addition, only having main frame to produce alarm data, when perhaps only having standby host to produce alarm data, 602 need of described sending module send to the target receiving equipment with main frame alarm data or standby host alarm data and get final product.
Described the second acquisition module 603 comprises:
The first acquiring unit 6031 is used for obtaining the Host Status data;
Second acquisition unit 6032 is used for obtaining the first alarm threshold corresponding to described Host Status data;
Comparing unit 6033 is used for according to described Host Status data and described the first alarm threshold, obtains described main frame alarm data.
In above-described embodiment, main frame and standby host can obtain respectively the local alarm data, and standby host sends to main frame with the standby host alarm data that gets access to, and main frame sends to the target receiving equipment with main frame alarm data and standby host alarm data.
Described the first acquisition module 601 comprises:
Receiving element 6011 is used for receiving the described standby host alarm data that described standby host sends.
To obtain the standby host alarm data by standby host in above-described embodiment, and the standby host alarm data sent to main frame, be transmitted to the webmaster machine by main frame, certainly, also can initiatively remove to obtain the standby host status data by main frame, and second alarm threshold corresponding according to the standby host status data, obtain the standby host alarm data, then send to the webmaster machine, yet, this kind mode then can increase the processing load of main frame, and the disposal ability of main frame is had relatively high expectations.
As shown in Figure 7, described the first acquisition module 601 can also comprise:
The 3rd acquiring unit 6012 is used for obtaining standby host status data and the second alarm threshold corresponding to described standby host status data, and according to described standby host status data and described the second alarm threshold, obtains described standby host alarm data.
Described the first acquisition module 601 can only comprise any one of receiving element 6011 and the 3rd acquiring unit 6012, perhaps comprises simultaneously receiving element 6011 and the 3rd acquiring unit 6012.
The server that provides by above-described embodiment, can obtain main frame alarm data and standby host alarm data, and described main frame alarm data and described standby host alarm data sent to the target receiving equipment, solved the limitation that webmaster machine in the prior art or other external equipments can't obtain the standby host alarm data, realize the unified alarm of active and standby machine, strengthened the stability of active and standby machine and to the monitoring capacity of active and standby machine.
Above-described embodiment, main frame can send alarm data to the target receiving equipment when main frame or standby host produce alarm data, and certainly, described target receiving equipment also can the Real-time Obtaining main frame and the status data of standby host.
Be illustrated in figure 8 as the another structural representation of the server of the embodiment of the invention, the described standby host monitoring information that described the first acquisition module 601 obtains is the standby host status data; On the basis of embodiment shown in Figure 6, described server also comprises:
Receiver module 604 is used for the status data request message that the receiving target receiving equipment sends;
Forwarding module 605 is used for described status data request message is transmitted to described standby host.
The 3rd acquisition module 606 is used for obtaining the Host Status data;
Described sending module 602 is further used for described Host Status data and described standby host status data are sent to described target receiving equipment.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.