WO2011160497A1 - Method and system for upgrading management information base on simple network management protocol (snmp) agent - Google Patents
Method and system for upgrading management information base on simple network management protocol (snmp) agent Download PDFInfo
- Publication number
- WO2011160497A1 WO2011160497A1 PCT/CN2011/073668 CN2011073668W WO2011160497A1 WO 2011160497 A1 WO2011160497 A1 WO 2011160497A1 CN 2011073668 W CN2011073668 W CN 2011073668W WO 2011160497 A1 WO2011160497 A1 WO 2011160497A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- patch
- mib
- node
- agent
- manager
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
Definitions
- the present invention relates to the field of remote network management of devices based on the Simple Network Management Protocol (SNMP), and specifically relates to a method and system for upgrading a Management Information Base (MIB) on an SNMP agent.
- MIB Management Information Base
- the SNMP protocol is a set of network management protocols defined by the Internet Engineering Task Force. use
- SNMP a manager can remotely manage all network devices that support this protocol.
- the SNMP management model has three basic components: Manager, Agent, and Management Information Base (MIB), where:
- the Manager resides in the management device.
- the management device is usually a stand-alone device or a member of a shared network.
- the Manager is the interface between the network administrator and the network management system, and converts the commands of the network administrator from the SNMP protocol to the SNMP protocol.
- the message is delivered to the Agent residing on the managed device, and the parameters of the managed device are read or set by the MIB of the Agent.
- Agents reside in managed devices and are special software or hardware used to track the status of managed devices. Each agent has its own local MIB.
- the Agent translates the protocol message request from the Manager, verifies the enforceability of the operation, searches the MIB, finds the corresponding device parameters, performs the request operation, and returns the response information to the Manager.
- the MIB contains all of the operational objects on the managed device that can be queried and modified, as well as the operational functions that are allowed to be performed on those operational objects. From the organizational structure, all the operation objects are organized into an object tree, usually called MIB tree. As shown in Figure 1, the operation objects on the tree are called nodes, and each node is associated with several operation functions (such as Get, Set). , Get Next, etc., these operating functions are currently not unified Chinese terms), called the operation of the node.
- the node information to be accessed by the Manager is sent to the Agent through the SNMP message, and the node information received by the agent finds the node in the local MIB tree, and according to the packet.
- the operation specified in calls a different operation function to achieve access to a parameter on the device.
- the Manager must have the same structure as the MIB on the Agent, so that access to all MIB data on the Agent can be achieved.
- the MIB needs to be upgraded due to changes in requirements, etc., as shown in Figure 2.
- the Manager is a PC and the physical location is centralized. Therefore, the MIB on the Manager can be easily upgraded.
- the Agent is an embedded system, the software system running on it is a whole. If the MIB needs to be upgraded, the entire software system needs to be upgraded.
- the MIB nodes that can be upgraded are limited by the number of preset MIB sets or the number of preset MIB fragments.
- the flexibility of the MIB extension is poor, and the preset MIB information necessarily brings about data redundancy on the Agent.
- the technical problem to be solved by the present invention is to provide an upgrade method and system for managing an information base on an SNMP agent, which can implement remote online upgrade of the MIB on the agent.
- the present invention provides a Simple Network Management Protocol (SNMP) proxy management information base (MIB) upgrade method, including:
- the administrator traverses all the nodes of the manager local MIB, sends a request to the agent, and the agent determines the MIB on the manager and the proxy local MIB according to the received request. If there is a difference, the difference is sent to the manager, the manager determines the node that needs to be synchronized according to the difference reported, constructs a corresponding patch, and delivers the patch to the agent, and the agent is configured according to The received patch synchronizes the proxy local MIB.
- the manager's MIB and the agent's MIB each include a node as a patch control node, and the object identifiers (OIDs) of the two nodes are the same;
- the method further includes: presetting the operation corresponding to the patch control node to indicate an action performed by the agent, and the one preset operation corresponds to one or more of the following actions: determining the MIB on the manager and the proxy local MIB The difference, get the patch, parse the patch, and synchronize the proxy local MIB based on the received patch.
- the manager traverses all nodes of the local MIB, and sends a request to the proxy: the manager sends one or more SNMP message requests to the proxy to associate the OID of each node in the manager local MIB with A corresponding operation type identifier is sent to the agent.
- the step of the agent determining, according to the received request, that the MIB on the manager is different from the proxy local MIB includes:
- the proxy After receiving the SNMP message request, the proxy reads the OID and the operation type identifier carried in the message request, and the operation identified by the operation type identifier triggers the proxy to be a node, and determines and records the management. The difference between the MIB on the agent and the MIB on the agent.
- the administrator determines the nodes that need to be synchronized according to the difference reported, and the steps of constructing the corresponding patches include:
- the patch constructed by the administrator includes a registry and an operation code target file associated with the registry, and the registration
- the table includes the OIDs of the nodes to be synchronized and the addresses of the corresponding n operations, n > 0 and n is an integer.
- the administrator determines, according to the difference reported, that the node that needs to be synchronized includes only the newly added node, and the patch constructed by the administrator includes a registry and an operation code target text associated with the registry.
- the registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding m operations, m > 0 and m is an integer, and the address of the operation points to an area in the operation code object file. Where the content of the updated operation is saved; or
- the administrator determines that the node to be synchronized includes only the deleted node according to the difference of the report, the patch constructed by the administrator includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address Is empty.
- the administrator instructs the agent to acquire a patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node.
- the step of the administrator instructing the agent to acquire a patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node includes:
- the administrator sends one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation, and the agent receives the SNMP protocol message. Then, performing the corresponding action according to the operation type identifier carried therein, completing the process of obtaining the patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
- the step of the operation corresponding to the preset patch control node for indicating the action performed by the agent includes: presetting that the first operation corresponding to the patch control node is used to instruct the agent to obtain the patch, and the second operation is used to instruct the agent to parse the patch.
- the third operation is used to indicate that the agent synchronizes the local MIB according to the patch; the step of the administrator instructing the agent to acquire the patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node includes:
- the manager When the manager instructs the agent to obtain a patch, the manager sends the agent to the agent
- the SNMP message request includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content; when the manager instructs the agent to parse the patch, the SNMP message request sent by the manager to the proxy Included in the OID of the patch control node and an operation type identifier of the second operation; when the manager instructs the agent to synchronize the proxy local MIB according to the received patch, the manager sends the identifier to the proxy
- the SNMP message request includes an OID of the patch control node and an operation type identifier of the third operation; the proxy performs a corresponding action according to the content carried by the received SNMP message request; or
- the SNMP message request sent by the manager to the agent includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content;
- the administrator instructs the agent to parse the patch and synchronize the proxy local MIB according to the received patch the SNMP message request sent by the administrator to the proxy includes the OID of the patch control node and the operation type identifier of the second operation.
- the agent performs a corresponding action according to the content carried by the received SNMP message request.
- the present invention also provides an Simple Management Protocol (SNMP) agent management information base (MIB) upgrade system, including administrators and agents, wherein:
- SNMP Simple Management Protocol
- MIB agent management information base
- the administrator is configured to: after starting the upgrade, traverse all nodes of the manager local MIB, send a request to the proxy; and determine a node that needs to be synchronized according to the difference of the proxy, construct a corresponding patch and Delivering the patch to the agent;
- the proxy is configured to: determine, according to the received request, that the MIB on the manager is different from the proxy local MIB, report the difference to the administrator; and synchronize the received patch according to the received Proxy local MIB.
- the administrator includes: a first MIB unit, a sending unit, and a patch construction unit, where the first MIB unit is configured to: select any node in the manager MIB as a patch control node, where the patch control node corresponds to multiple operations, the predetermined operations for performing one or more actions indicative of agent: a difference between the agent on the local MIB MIB manager determines other acquisition patch 1, patch parsing, and synchronization based on the received patch
- the proxy local MIB is configured to: traverse all nodes of the manager MIB after the upgrade is started, send a request to the proxy; and issue the patch based on the trigger of the patch construction unit To the agent;
- the patch construction unit is configured to: after receiving the MIB difference reported by the proxy, determine a node that needs to be synchronized according to the difference, construct a corresponding patch, and trigger the sending unit;
- the proxy includes a second MIB unit, a difference judging unit, an upper unit, and a synchronization unit, where the second MIB unit is configured to: select any node in the proxy MIB as a patch control node, where the proxy MIB is The object identifier (OID) of the patch control node is the same as the OID of the patch control node in the manager MIB, and the node corresponds to a plurality of operations, and the operation is preset to perform one or more of the following actions: The difference between the MIB of the manager and the proxy local MIB, obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch;
- OID object identifier
- the difference judging unit is configured to: after receiving the request sent by the sending unit of the manager, determining, according to the request, that the MIB on the manager is different from the proxy local MIB, collecting the difference and triggering the upper unit ;
- the reporting unit is configured to: report the difference to the manager based on a trigger of the difference determining unit;
- the synchronization unit is configured to: after receiving the patch sent by the sending unit of the manager, synchronize the proxy local MIB according to the patch.
- the sending unit is configured to send a request to the proxy in the following manner: Send one or more SNMP message requests to the proxy to send the OID of each node in the administrator local MIB and its corresponding operation type identifier to the Agent
- the difference judging unit is configured to: trigger the operation corresponding to the operation type identifier carried in the message request, and determine and record the difference between the manager MIB and the proxy MIB in units of nodes.
- the patch construction unit is configured to construct a corresponding patch in the following manner:
- constructing a patch including a registry and an operation code object file associated with the registry, where the registry includes an OID of a plurality of nodes to be synchronized and The address of the corresponding n operations, n > 0 and n is an integer; for the node to be deleted, the number of addresses of the operation corresponding to the OID of the node is ⁇ 0, that is, the corresponding operation address is empty; Node, the number of addresses of the operation corresponding to the OID of the node n > 0, and the address of the operation points to an area in the operation code object file, where the content of the updated operation is saved; or
- determining that the node that needs to be synchronized includes only the newly added node, constructing a patch including a registry and an operation code object file associated with the registry, the registry including the OIDs of the plurality of nodes to be synchronized and their corresponding
- the address of m operations, m > 0 and m is an integer, the address of the operation points to an area in the operation code object file, in which the content of the updated operation is saved; or
- the patch When the node that needs to be synchronized includes only the deleted node, the patch includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address is empty.
- the sending unit is configured to send a request to the proxy in a manner of: sending one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation of a preset operation Type identifier
- the synchronization unit is configured to receive the SNMP protocol message, according to the operation carried therein
- the type identification performs the following actions: obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
- the invention realizes the upgrade of the MIB on the Agent through the "patch" method has the following advantages:
- Figure 1 is a schematic diagram of an MIB tree in SNMP network management
- FIG. 2 is a schematic diagram showing that the MIB of the Manager and the Agent are different, and the upgrade requirement is triggered;
- FIG. 3 is a flowchart of an embodiment of the present invention.
- FIG. 4 is a structural diagram of a "patch" according to an embodiment of the present invention. Preferred embodiment of the invention
- upgrading the MIB means adding several nodes and their corresponding operations to the MIB, or deleting several nodes and their corresponding operations from them. Therefore, the present invention considers the node of the extension part and its operation as a "patch", and the Manager dynamically enables or deletes the patch by the control agent to implement the upgrade of the MIB on the agent.
- the inventive concept of the present invention is: After the Manager starts the upgrade, the Manager traverses all the nodes of the local MIB, sends a request to the Agent, and the Agent determines, according to the received request, whether the MIB on the Manager is different from the local MIB, and if there is a difference, The difference is reported to the manager, and the manager determines the node that needs to be synchronized according to the reported difference, constructs a corresponding patch, and delivers the patch to the agent, and the agent synchronizes the local MIB according to the received patch. If there is no difference, the upgrade process ends.
- the MIB including the MIB of the Manager and the MIB of the Agent
- the patch control node that is, the MIB of the Manager and the Agent each include a node as a patch control node, and the OID of the node in the Manager is the same as the OID in the agent; the patch control node is preset.
- the corresponding operation is used to indicate the action performed by the agent.
- One preset operation corresponds to one or more actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the local MIB according to the received patch. .
- the agent sends the patch to the agent, and the step of the agent synchronizing the local MIB according to the received patch includes: the Manager instructs the agent to obtain a patch, parse the patch, and synchronize the local MIB according to the received patch by operating the patch control node. .
- the manager sends one or more SNMP message requests to the agent, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation, and the agent receives the SNMP protocol. After the message is executed, the corresponding action is performed according to the operation type identifier carried therein, and the process of obtaining the patch, parsing the patch, and synchronizing the local MIB according to the received patch is completed.
- the patch control node corresponds to a plurality of operations
- the first operation corresponding to the patch control node is used to instruct the agent to obtain a patch
- the second operation is used to instruct the agent to parse the patch
- the third operation is used to instruct the agent to perform the patch according to the patch.
- the local MIB is synchronized; when the manager instructs the agent to obtain the patch, the SNMP message request sent by the manager to the agent includes an OID (Object Identifiers) of the patch control node, an operation type identifier of the first operation, and
- the content of the patch is: when the manager instructs the agent to parse the patch, the SNMP message request sent by the manager to the agent includes the OID of the patch control node and the operation type identifier of the second operation; when the manager instructs the agent to receive the
- the SNMP protocol message sent by the Manager to the agent includes the OID of the patch control node and the operation type identifier of the third operation.
- the agent After receiving the SNMP message request, the agent performs the corresponding action according to the content carried in the received SNMP message request.
- the first operation, the second operation, and the third operation may be the same or different, and the action of the agent may be specified in the process of the agent when the operation type identifier is received, but it needs to be uniformly set with the manager.
- the Manger can indicate that the Agent performs two or more actions according to an operation type identifier, for example, the Manager sends the OID of the patch control node and the operation type identifier of the second operation, and the operation type identifier of the second operation instructs the Agent to parse the patch. And synchronize the local MIB, at this time The second operation is considered to be the same as the third operation.
- the process of the traversal operation of all the nodes of the local MIB, the sending of the request to the agent includes: the manager sending one or more SNMP message requests to the agent, to the OID of each node in the Manager local MIB and a corresponding operation thereof
- the operation type identifier of X is sent to the Agent.
- the Manager sends m SNMP message requests to the Agent, and each message request carries the OID of one node and the operation type identifier of the corresponding operation X.
- the operation X corresponding to the patch control node is used to indicate that the agent determines whether the MIB on the Manager is different from the local MIB.
- the step of determining, by the agent, whether the MIB on the Manager is different from the local MIB according to the received request includes: After receiving the message request, the agent reads the OID and the operation type identifier carried in the message request, and the operation type identifier that is identified by the operation type identifier triggers the agent to determine and record the first MIB and the second by using a node as a unit.
- the difference between the MIB and the specificity includes: the agent determines whether the local MIB has the same OID as the OID in the message request, and if so, determines that the local node has no difference from the node on the Manager, and if not, determines the local node and the Manager. The nodes on the difference are different, and the difference is recorded. After determining the OID in all the message requests, it is determined whether there are any nodes in the local MIB that have not been compared, and if so, it is determined that the node has a node with the Manager. Difference, and record the difference, if not, judge the operation is over.
- the difference recorded by the Agent includes the node OID.
- the difference can be classified: including MIB nodes that exist on the Manager but do not exist locally, and MIB nodes that exist locally but do not exist on the Manager.
- the patch constructed by the Manager includes different contents, which are as follows:
- the synchronization operation includes adding a node and deleting a node, that is, when the manager determines, according to the difference reported, that the node to be synchronized includes a newly added node and a deleted node, the patch includes a registry and is associated with the registry.
- the patch includes a registry and an operation code object file associated with the registry.
- the registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding m operations (m>0, and n is an integer), and the address of the operation points to a region in the operation code object file , where the content of the updated operation is saved (the content is given in the form of object code).
- OIDs are the same but the corresponding operations are different, they can be updated according to the process of adding a new node.
- the synchronization operation includes only deleting the node, that is, when the management determines that the node to be synchronized includes only the deleted node according to the reported difference, the patch includes a registry, and the registry includes multiple OIDs of the node to be deleted. , its corresponding operation address is empty.
- the step of synchronizing the agent local MIB according to the patch includes: 1) the agent selects an OID from the registry in the patch as the currently synchronized OID; 2) determines whether the OID corresponding operation address in the registry is empty, and if it is empty, Then, the node with the same OID in the local MIB is deleted. If it is not empty, it is determined whether there is a node with the same OID in the local MIB. If yes, the operation code object file is read according to the operation address corresponding to the OID, and an update is obtained.
- the registry is designed to achieve flexible configuration of dynamically extended nodes.
- the patch control node is extended according to the MIB node in the registry, and the MIB node does not exist in the registry, even if the operation code of the MIB exists in the operation code object file. , will not expand.
- the Manager is configured to: after the upgrade is started, the Manager traverses all nodes of the local MIB to send a request to the Agent; and is used to determine a section to be synchronized according to the difference reported by the Agent.
- the agent is configured to determine, according to the received request, whether the MIB on the Manager is different from the local MIB, and if there is a difference, report the difference to the Manager; and synchronize the local MIB according to the received patch.
- the manager includes: a first MIB unit, a sending unit, and a patch construction unit, where:
- the first MIB unit is configured to select any node in the MIB (first MIB) of the Manager as a patch control node, where the patch control node corresponds to multiple operations, and the operation is preset to instruct the agent to execute the following one. Or multiple actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the Agent local MIB (second MIB) according to the received patch;
- the sending unit is configured to: traverse all the nodes of the first MIB, and send a request to the agent after starting the upgrade; and send the patch to the agent based on the trigger of the patch construction unit;
- the patch construction unit is configured to: after receiving the MIB difference reported by the agent, determine a node that needs to be synchronized according to the difference, construct a corresponding patch, and trigger the sending unit;
- the agent includes a second MIB unit, a difference determining unit, a reporting unit, and a synchronization unit, where:
- the second MIB unit is configured to select any node in the second MIB as the patch control node, where the OID of the patch control node of the second MIB is the same as the OID of the patch control node in the first MIB, where the node corresponds to a plurality of operations, the operation is preset to perform one or more of the following actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the local second MIB according to the received patch;
- the difference judging unit is configured to: after receiving the request sent by the sending unit of the Manager, determine, according to the request, whether there is a difference between the first MIB on the Manager and the local second MIB, and if there is a difference, collect the difference and Trigger the upper unit;
- the reporting unit is configured to report the difference to the trigger based on the difference determining unit
- the synchronization unit is configured to synchronize the local second MIB according to the patch after receiving the patch sent by the sending unit of the Manager.
- the sending unit, the request sent to the agent includes one or more SNMP message requests, to send the OID of each node in the first local MIB of the Manager and its corresponding operation type identifier to the Agent;
- the difference judging unit is configured to determine, according to the trigger of the operation corresponding to the operation type identifier carried in the message request, the difference between the first MIB and the second MIB by using a node; the difference includes: MIB nodes that exist on the local but do not exist locally, and MIB nodes that exist locally but do not exist on the Manager.
- a form of the determining operation is: determining whether the local second MIB has the same OID as the OID in the message request, and if so, determining that the local node has no difference from the node on the Manager, and if not, determining the local node Different from the node on the Manager, and record the difference; After judging the OID in all the message requests, it is determined whether there are any nodes in the local MIB that have not been compared, if any, it is determined that the node and the node on the Manager have Difference, and record the difference, if not, judge the operation is over.
- the patch construction unit when determining that the node that needs to be synchronized includes only the newly added node, the constructed patch includes a registry and an operation code target file associated with the registry, where the registry includes a plurality of nodes to be synchronized.
- the patch construction unit when the node that needs to be synchronized only includes the deleted node, includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address is empty.
- the sending unit is configured to send one or more SNMP message requests to the agent, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation;
- the synchronization unit is configured to: after receiving the SNMP protocol message, perform the following actions according to the operation type identifier carried in the identifier, obtain a patch, parse the patch, and synchronize the local second MIB according to the received patch.
- a patch control node is preset in the MIB design.
- the node also has the function of controlling the MIB upgrade process on the Agent, including the MIB difference between the Agent and the Manager.
- the transmission, the transmission of the patch, and the notification agent are synchronized according to the patch; the methods for implementing the MIB upgrade include:
- Step 1 The Manager activates the patch process on the agent, that is, the agent sends a notification to enter the patch process.
- Step 2 The Agent sends a response to the Manager that has entered the patch process
- Step 3 The traversal operation of the local MIB by the Manager sends an SNMP request to the Agent, including the node OID and the corresponding operation type identifier.
- Step 4 After the agent receives the request sent by the manager, the operation triggered by the operation type identifier triggers the agent to compare the difference between the local MIB of the agent and the MIB of the manager.
- the agent collects the difference and reports the difference to the manager.
- the difference includes the manager. An MIB node that exists on the local but does not exist locally, and an MIB node that exists locally but does not exist on the Manager;
- Step 5 The Manager creates a corresponding patch according to the difference between the Agent local MIB of the Agent and the MIB on the Manager, and sends the patch to the Agent by operating the patch control node.
- the patch structure is as shown in FIG. 4, and includes: an operation code object file of the MIB node to be synchronized, and an OID of the MIB node to be synchronized and a registry of the corresponding operation. Each entry in the registry corresponds to the OID and its various operations. As described above, when the operation address corresponding to the OID is empty, it indicates that the agent needs to delete the node. If the operation address corresponding to the OID is not empty, it indicates that the agent needs to update the node.
- Figure 4 given in this embodiment is merely an example.
- Step 6 After the agent receives the patch successfully, the agent sends the trap message in the form of a trap, and the Manager is notified that the packet is successfully received.
- Step 7 The Manager operates the patch control node, and starts the operation of the Agent to resolve the "patch”;
- Step 8 The agent parses the patch, and synchronizes the local MIB according to the patch;
- the registry in the patch is read (structure is shown in FIG. 4), and the registry is traversed to extract the OID of each node and the object code information of the related operation.
- the agent registers the parsed node OID to the corresponding branch in the existing MIB, and constructs a node structure for attaching the OID according to the data structure of the node in the local MIB. Operation code. If the node OID that the agent resolves exists in the local MIB, the local node is updated in the overlay mode.
- Step 9 After the synchronization is complete, the agent notifies the Manager that the newly added node OID is completed in the form of a trap.
- Step 10 The Manager operates the patch control node to notify the agent that the patch process ends.
- the present invention may also have other improved methods, such as modification of the "patch" program making method, modification of the patch acquiring method, etc., but these corresponding changes and modifications should be protected by the appended claims. range.
- the invention realizes the upgrade of the MIB on the Agent through the "patch" method has the following advantages:
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
A method and system for upgrading a Management Information Base (MIB) on a Simple Network Management Protocol (SNMP) agent are disclosed by the present invention. The method includes the following steps: after a manager initiates the upgrade, the manager performs traversal operation on all the nodes in the local MIB of the manager and transmits a request to an agent; according to the received request, the agent judges that differences exist between the MIB on the manager and the local MIB of the agent, then reports the differences to the manager; according to the reported differences, the manager determines the nodes which need to be synchronized, constructs a corresponding patch and forwards the patch to the agent; the agent synchronizes the local MIB of the agent according to the received patch.
Description
一种 SNMP代理上管理信息库的升级方法和系统 Method and system for upgrading management information base on SNMP agent
技术领域 Technical field
本发明涉及基于简单网络管理协议 ( Simple Network Management Protocol, 简称 SNMP )进行设备远程网络管理的领域, 具体涉及 SNMP代理 ( Agent )上管理信息库(Management Information Base, MIB )的升级方法和 系统。 背景技术 The present invention relates to the field of remote network management of devices based on the Simple Network Management Protocol (SNMP), and specifically relates to a method and system for upgrading a Management Information Base (MIB) on an SNMP agent. Background technique
SNMP 协议是由互联网工程任务组定义的一套网络管理协议。 利用 The SNMP protocol is a set of network management protocols defined by the Internet Engineering Task Force. use
SNMP, 一个管理者( Manager )可以远程管理所有支持这种协议的网络设备。 SNMP, a manager can remotely manage all network devices that support this protocol.
SNMP管理模型有三个基本组成部分: 管理者( Manager ) ,代理( Agent ) 和管理信息库(Management Information Base, 简称 MIB ) , 其中: The SNMP management model has three basic components: Manager, Agent, and Management Information Base (MIB), where:
Manager驻留在管理设备中, 管理设备一般是一个单机设备或是一个共 享网络中的一员, Manager是网络管理员和网络管理系统的接口, 将网络管 理员的命令由 SNMP协议转换成 SNMP协议报文传递至驻留在被管理设备的 Agent, 通过 Agent的 MIB读取或设置被管理设备的参数。 The Manager resides in the management device. The management device is usually a stand-alone device or a member of a shared network. The Manager is the interface between the network administrator and the network management system, and converts the commands of the network administrator from the SNMP protocol to the SNMP protocol. The message is delivered to the Agent residing on the managed device, and the parameters of the managed device are read or set by the MIB of the Agent.
Agent驻留在被管理设备中,是用于跟踪监测被管理设备状态的特殊软件 或硬件, 每个代理都拥有自己本地的 MIB。 Agent翻译来自 Manager的协议 报文请求, 验证操作的可执行性, 通过搜索 MIB, 查找对应的设备参数, 执 行请求操作, 同时向 Manager返回响应信息。 Agents reside in managed devices and are special software or hardware used to track the status of managed devices. Each agent has its own local MIB. The Agent translates the protocol message request from the Manager, verifies the enforceability of the operation, searches the MIB, finds the corresponding device parameters, performs the request operation, and returns the response information to the Manager.
MIB包含被管理设备上所有可被查询和修改的操作对象, 以及允许对该 些操作对象进行的操作函数。 从组织结构上, 所有的操作对象被组织成为一 个对象树, 通常称作 MIB树, 如图 1所示, 树上的操作对象称为节点, 每个 节点关联若干个操作函数(如 Get、 Set, Get Next等, 该些操作函数目前无 统一中文术语) , 称为对该节点的操作。 The MIB contains all of the operational objects on the managed device that can be queried and modified, as well as the operational functions that are allowed to be performed on those operational objects. From the organizational structure, all the operation objects are organized into an object tree, usually called MIB tree. As shown in Figure 1, the operation objects on the tree are called nodes, and each node is associated with several operation functions (such as Get, Set). , Get Next, etc., these operating functions are currently not unified Chinese terms), called the operation of the node.
在实际应用中, Manager将要访问的节点信息通过 SNMP报文发送至 Agent, Agent接收到的节点信息, 在本地 MIB树中查找到节点, 并依据报文 In the actual application, the node information to be accessed by the Manager is sent to the Agent through the SNMP message, and the node information received by the agent finds the node in the local MIB tree, and according to the packet.
1
中指定的操作, 调用不同的操作函数, 实现对设备上某个参数的访问。 1 The operation specified in , calls a different operation function to achieve access to a parameter on the device.
通过以上介绍可知, Manager上必须具有与 Agent上相同结构的 MIB, 这样才能实现对 Agent上所有 MIB数据的访问。 但是在实际使用中, 由于需 求变更等原因,需要对 MIB进行升级,如图 2所示的情况。一般作为 Manager 的均为 PC机, 且物理位置集中, 所以对 Manager上 MIB可以方便地进行升 级, 但是对 Agent之上的 MIB, 由于 Agent物理位置分散, 对其 MIB进行升 级难度很大。 除此而外, 当 Agent为嵌入式系统时, 其上运行的软件系统为 一个整体, 如果需要升级 MIB, 就需要将整个软件系统进行升级。 Through the above description, the Manager must have the same structure as the MIB on the Agent, so that access to all MIB data on the Agent can be achieved. However, in actual use, the MIB needs to be upgraded due to changes in requirements, etc., as shown in Figure 2. Generally, the Manager is a PC and the physical location is centralized. Therefore, the MIB on the Manager can be easily upgraded. However, for the MIB above the Agent, it is very difficult to upgrade the MIB due to the geographical location of the Agent. In addition, when the Agent is an embedded system, the software system running on it is a whole. If the MIB needs to be upgraded, the entire software system needs to be upgraded.
现有技术中通过以下方法解决上述问题: 1 )在 Agent上预置多套 MIB, 或者若干个 MIB片段, 在需要对当前正在使用的 MIB进行升级时, 放弃正 在使用的 MIB, 而使用预置的其他 MIB; 2)将需要的且在本地存在的 MIB片 段增加到正在使用的 MIB中。 In the prior art, the foregoing problems are solved by the following methods: 1) Presetting multiple sets of MIBs or a plurality of MIB fragments on the Agent, when upgrading the currently used MIB, abandoning the MIB being used, and using presets Other MIBs; 2) Add the required and locally existing MIB fragments to the MIB being used.
可以看出, 无论是釆用预置多套 MIB的方法, 还是釆用预置 MIB片段 方法。 所能够升级的 MIB节点均受限于预置的 MIB套数, 或者预置的 MIB 片段数目。 MIB扩展的灵活度差, 另外预置的 MIB信息必然带来 Agent上的 数据冗余。 It can be seen that whether the preset MIB method is used or the preset MIB fragment method is used. The MIB nodes that can be upgraded are limited by the number of preset MIB sets or the number of preset MIB fragments. The flexibility of the MIB extension is poor, and the preset MIB information necessarily brings about data redundancy on the Agent.
发明内容 Summary of the invention
本发明要解决的技术问题是提供一种 SNMP代理上管理信息库的升级方 法和系统 , 能够实现对 Agent上 MIB的远程在线升级。 The technical problem to be solved by the present invention is to provide an upgrade method and system for managing an information base on an SNMP agent, which can implement remote online upgrade of the MIB on the agent.
为解决上述技术问题, 本发明提供了一种简单网络管理协议(SNMP ) 代理上管理信息库(MIB )升级方法, 包括: To solve the above technical problem, the present invention provides a Simple Network Management Protocol (SNMP) proxy management information base (MIB) upgrade method, including:
当管理者启动升级后, 所述管理者遍历操作所述管理者本地 MIB所有节 点,向代理发送请求,所述代理根据接收到的请求判断出所述管理者上的 MIB 与所述代理本地 MIB有差别, 则将所述差别上 ^艮给所述管理者, 所述管理者 根据上报的差别确定需要同步的节点, 构造相应补丁并将所述补丁下发到所 述代理, 所述代理根据接收到的补丁同步所述代理本地 MIB。 After the administrator initiates the upgrade, the administrator traverses all the nodes of the manager local MIB, sends a request to the agent, and the agent determines the MIB on the manager and the proxy local MIB according to the received request. If there is a difference, the difference is sent to the manager, the manager determines the node that needs to be synchronized according to the difference reported, constructs a corresponding patch, and delivers the patch to the agent, and the agent is configured according to The received patch synchronizes the proxy local MIB.
可选的,
所述管理者的 MIB和所述代理的 MIB中各包含一作为补丁控制节点的 节点, 两节点的对象标识符(OID )相同; Optional, The manager's MIB and the agent's MIB each include a node as a patch control node, and the object identifiers (OIDs) of the two nodes are the same;
所述方法还包括: 预设所述补丁控制节点对应的操作用于指示代理执行 的动作, 一个预设操作对应以下动作中的一个或多个: 判断管理者上的 MIB 与所述代理本地 MIB的差别、 获取补丁、 解析补丁, 以及根据接收到的补丁 同步所述代理本地 MIB。 The method further includes: presetting the operation corresponding to the patch control node to indicate an action performed by the agent, and the one preset operation corresponds to one or more of the following actions: determining the MIB on the manager and the proxy local MIB The difference, get the patch, parse the patch, and synchronize the proxy local MIB based on the received patch.
可选的, Optional,
所述管理者遍历操作本地 MIB所有节点, 向代理发送请求的步骤包括: 所述管理者向所述代理发送一个或多个 SNMP消息请求, 以将管理者本 地 MIB中每个节点的 OID及其对应的操作类型标识发送给所述代理。 The manager traverses all nodes of the local MIB, and sends a request to the proxy: the manager sends one or more SNMP message requests to the proxy to associate the OID of each node in the manager local MIB with A corresponding operation type identifier is sent to the agent.
可选的, Optional,
所述代理根据接收到的请求判断出所述管理者上的 MIB与所述代理本地 MIB有差别的步骤包括: The step of the agent determining, according to the received request, that the MIB on the manager is different from the proxy local MIB includes:
所述代理收到所述 SNMP消息请求后,读取该消息请求中携带的 OID及 操作类型标识 ,所述操作类型标识所标识的操作触发所述代理以节点为单位 , 判断并记录所述管理者上的 MIB与代理上的 MIB的差别的差别。 After receiving the SNMP message request, the proxy reads the OID and the operation type identifier carried in the message request, and the operation identified by the operation type identifier triggers the proxy to be a node, and determines and records the management. The difference between the MIB on the agent and the MIB on the agent.
可选的, Optional,
所述管理者根据上报的差别确定需要同步的节点, 构造相应补丁的步骤 包括: The administrator determines the nodes that need to be synchronized according to the difference reported, and the steps of constructing the corresponding patches include:
所述管理者根据上报的差别确定需要同步的节点包括新增的节点和删除 的节点时, 所述管理者构造的补丁包括注册表和与所述注册表关联的操作代 码目标文件, 所述注册表中包括多个待同步节点的 OID及其对应的 n个操作 的地址, n > 0且 n为整数; 对于待删除的节点, 该节点的 OID对应的操作的 地址个数 n=0, 即其对应的操作地址为空; 对于待增加的节点,该节点的 OID 对应的操作的地址个数 n > 0, 且所述操作的地址指向所述操作代码目标文件 中的一块区域, 其中保存有更新的操作的内容; 或者 When the administrator determines, according to the difference reported, that the node that needs to be synchronized includes a newly added node and a deleted node, the patch constructed by the administrator includes a registry and an operation code target file associated with the registry, and the registration The table includes the OIDs of the nodes to be synchronized and the addresses of the corresponding n operations, n > 0 and n is an integer. For the node to be deleted, the number of addresses corresponding to the OID of the node is n=0, that is, The corresponding operation address is empty; for the node to be added, the number of operations corresponding to the OID of the node is n > 0, and the address of the operation points to an area in the operation code object file, where the The content of the updated operation; or
所述管理者根据上报的差别确定需要同步的节点仅包括新增的节点时, 所述管理者构造的补丁包括注册表和与所述注册表关联的操作代码目标文
件, 所述注册表中包括多个待同步节点的 OID及其对应的 m个操作的地址, m > 0且 m为整数, 所述操作的地址指向所述操作代码目标文件中的一块区 域, 其中保存有更新的操作的内容; 或者 The administrator determines, according to the difference reported, that the node that needs to be synchronized includes only the newly added node, and the patch constructed by the administrator includes a registry and an operation code target text associated with the registry. The registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding m operations, m > 0 and m is an integer, and the address of the operation points to an area in the operation code object file. Where the content of the updated operation is saved; or
所述管理者根据上报的差别确定需要同步的节点仅包括删除的节点时, 所述管理者构造的补丁包括注册表, 所述注册表中包括多个待删除节点的 OID, 其对应的操作地址为空。 The administrator determines that the node to be synchronized includes only the deleted node according to the difference of the report, the patch constructed by the administrator includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address Is empty.
可选的, Optional,
所述管理者将补丁下发到代理, 所述代理根据接收到的补丁同步所述代 理本地 MIB的步骤包括: The administrator sends the patch to the proxy, and the step of the proxy synchronizing the proxy local MIB according to the received patch includes:
所述管理者通过操作所述补丁控制节点指示所述代理获取补丁、 解析补 丁, 以及根据接收到的补丁同步所述代理本地 MIB。 The administrator instructs the agent to acquire a patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node.
可选的, Optional,
所述管理者通过操作所述补丁控制节点指示所述代理获取补丁、 解析补 丁, 以及根据接收到的补丁同步所述代理本地 MIB的步骤包括: The step of the administrator instructing the agent to acquire a patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node includes:
所述管理者向所述代理发送一个或多个 SNMP消息请求,所述 SNMP消 息请求中包括所述补丁控制节点的 OID以及预设操作的操作类型标识, 所述 代理收到所述 SNMP协议消息后, 根据其中携带的操作类型标识执行相应的 动作, 完成获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本地 MIB的动作。 The administrator sends one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation, and the agent receives the SNMP protocol message. Then, performing the corresponding action according to the operation type identifier carried therein, completing the process of obtaining the patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
可选的, Optional,
1 )所述代理从补丁中的注册表中选取一 OID作为当前同步的 OID;1) the agent selects an OID from the registry in the patch as the currently synchronized OID;
2 )判断注册表中该 OID对应操作地址是否为空, 如果为空, 则将本地 MIB中的具有相同 OID的节点删除; 如果不为空, 则判断所述代理本地 MIB 中是否有相同 OID的节点, 如果有, 则按照该 OID对应的操作地址读取操作 代码目标文件,获取更新内容, 同步所述代理本地 MIB中的具有相同 OID的 节点, 如果没有, 则以该 OID在所述代理本地 MIB中注册一新节点, 根据从 操作代码目标文件中读取的更新内容, 同步新节点对应的操作;
3 )从补丁中的注册表中再选取一未同步过的 OID作为当前同步的 OID, 执行上述步骤 2 ) ; 2) determining whether the OID corresponding operation address in the registry is empty, if it is empty, deleting the node with the same OID in the local MIB; if not, determining whether the proxy local MIB has the same OID a node, if yes, reading an operation code object file according to an operation address corresponding to the OID, obtaining an update content, synchronizing a node having the same OID in the proxy local MIB, and if not, using the OID locally at the proxy Registering a new node in the MIB, synchronizing the operation corresponding to the new node according to the updated content read from the operation code object file; 3) Select an unsynchronized OID from the registry in the patch as the currently synchronized OID, and perform the above steps 2);
重复执行上述步骤 2 )和步骤 3 )直到注册表中的 OID全部同步完毕。 可选的, Repeat steps 2) and 3) above until the OIDs in the registry are all synchronized. Optional,
所述预设补丁控制节点对应的操作用于指示代理执行的动作的步骤包 括: 预设所述补丁控制节点对应的第一操作用于指示代理获取补丁, 第二操 作用于指示代理解析补丁, 第三操作用于指示代理根据补丁同步本地 MIB; 所述管理者通过操作所述补丁控制节点指示所述代理获取补丁、 解析补 丁, 以及根据接收到的补丁同步所述代理本地 MIB的步骤包括: The step of the operation corresponding to the preset patch control node for indicating the action performed by the agent includes: presetting that the first operation corresponding to the patch control node is used to instruct the agent to obtain the patch, and the second operation is used to instruct the agent to parse the patch. The third operation is used to indicate that the agent synchronizes the local MIB according to the patch; the step of the administrator instructing the agent to acquire the patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node includes:
当所述管理者指示所述代理获取补丁时, 所述管理者向所述代理发送的 When the manager instructs the agent to obtain a patch, the manager sends the agent to the agent
SNMP消息请求中包括所述补丁控制节点的 OID、 第一操作的操作类型标识 以及补丁内容; 当所述管理者指示所述代理解析补丁时, 所述管理者向所述 代理发送的 SNMP消息请求中包括所述补丁控制节点的 OID以及第二操作的 操作类型标识; 当所述管理者指示所述代理根据接收到的补丁同步所述代理 本地 MIB时 ,所述管理者向所述代理发送的 SNMP消息请求中包括所述补丁 控制节点的 OID 以及第三操作的操作类型标识; 所述代理根据接收到的 SNMP消息请求携带的内容执行相应的动作; 或者 The SNMP message request includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content; when the manager instructs the agent to parse the patch, the SNMP message request sent by the manager to the proxy Included in the OID of the patch control node and an operation type identifier of the second operation; when the manager instructs the agent to synchronize the proxy local MIB according to the received patch, the manager sends the identifier to the proxy The SNMP message request includes an OID of the patch control node and an operation type identifier of the third operation; the proxy performs a corresponding action according to the content carried by the received SNMP message request; or
当所述管理者指示所述代理获取补丁时, 所述管理者向所述代理发送的 SNMP消息请求中包括所述补丁控制节点的 OID、 第一操作的操作类型标识 以及补丁内容; 当所述管理者指示所述代理解析补丁和根据接收到的补丁同 步所述代理本地 MIB时,所述管理者向代理发送的 SNMP消息请求中包括所 述补丁控制节点的 OID以及第二操作的操作类型标识; 所述代理根据接收到 的 SNMP消息请求携带的内容执行相应的动作。 When the manager instructs the agent to obtain a patch, the SNMP message request sent by the manager to the agent includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content; When the administrator instructs the agent to parse the patch and synchronize the proxy local MIB according to the received patch, the SNMP message request sent by the administrator to the proxy includes the OID of the patch control node and the operation type identifier of the second operation. The agent performs a corresponding action according to the content carried by the received SNMP message request.
本发明还提供一种简单管理协议 ( SNMP )代理上管理信息库( MIB )升 级系统, 包括管理者和代理, 其中: The present invention also provides an Simple Management Protocol (SNMP) agent management information base (MIB) upgrade system, including administrators and agents, wherein:
所述管理者设置为: 在启动升级后, 遍历操作所述管理者本地 MIB所有 节点, 向所述代理发送请求; 以及根据所述代理上 "^的差别确定需要同步的 节点, 构造相应补丁并将所述补丁下发到所述代理;
所述代理设置为: 根据接收到的请求判断出所述管理者上的 MIB与所述 代理本地 MIB有差别, 则将所述差别上报给所述管理者; 以及根据接收到的 补丁同步所述代理本地 MIB。 The administrator is configured to: after starting the upgrade, traverse all nodes of the manager local MIB, send a request to the proxy; and determine a node that needs to be synchronized according to the difference of the proxy, construct a corresponding patch and Delivering the patch to the agent; The proxy is configured to: determine, according to the received request, that the MIB on the manager is different from the proxy local MIB, report the difference to the administrator; and synchronize the received patch according to the received Proxy local MIB.
可选的, Optional,
所述管理者包括: 第一 MIB单元、 发送单元和补丁构造单元, 所述第一 MIB单元设置为: 在所述管理者 MIB中选择任一节点作为补 丁控制节点, 所述补丁控制节点对应多个操作, 预设所述操作用于指示代理 执行以下一个或多个动作: 判断管理者上的 MIB与所述代理本地 MIB的差 另1 获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本地 MIB; 所述发送单元设置为: 在启动升级后, 遍历操作所述管理者 MIB的所有 节点, 向所述代理发送请求; 以及基于所述补丁构造单元的触发将所述补丁 下发到所述代理; The administrator includes: a first MIB unit, a sending unit, and a patch construction unit, where the first MIB unit is configured to: select any node in the manager MIB as a patch control node, where the patch control node corresponds to multiple operations, the predetermined operations for performing one or more actions indicative of agent: a difference between the agent on the local MIB MIB manager determines other acquisition patch 1, patch parsing, and synchronization based on the received patch The proxy local MIB is configured to: traverse all nodes of the manager MIB after the upgrade is started, send a request to the proxy; and issue the patch based on the trigger of the patch construction unit To the agent;
所述补丁构造单元设置为: 在接收到所述代理上报的 MIB差别后, 根据 所述差别确定需要同步的节点, 构造相应补丁, 并触发所述发送单元; The patch construction unit is configured to: after receiving the MIB difference reported by the proxy, determine a node that needs to be synchronized according to the difference, construct a corresponding patch, and trigger the sending unit;
所述代理包括第二 MIB单元、 差别判断单元、 上 ^艮单元和同步单元, 所述第二 MIB单元设置为: 在所述代理 MIB中选择任一节点作为补丁 控制节点, 所述代理 MIB中的补丁控制节点的对象标识符(OID )与所述管 理者 MIB中的补丁控制节点的 OID相同,所述节点对应多个操作,预设所述 操作用于执行以下一个或多个动作: 判断管理者上的 MIB 与所述代理本地 MIB的差别、 获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本 地 MIB; The proxy includes a second MIB unit, a difference judging unit, an upper unit, and a synchronization unit, where the second MIB unit is configured to: select any node in the proxy MIB as a patch control node, where the proxy MIB is The object identifier (OID) of the patch control node is the same as the OID of the patch control node in the manager MIB, and the node corresponds to a plurality of operations, and the operation is preset to perform one or more of the following actions: The difference between the MIB of the manager and the proxy local MIB, obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch;
所述差别判断单元设置为: 在接收到所述管理者的发送单元发送的请求 后, 根据所述请求判断出管理者上的 MIB与所述代理本地 MIB有差别, 则 收集差别并触发上 单元; The difference judging unit is configured to: after receiving the request sent by the sending unit of the manager, determining, according to the request, that the MIB on the manager is different from the proxy local MIB, collecting the difference and triggering the upper unit ;
所述上报单元设置为: 基于所述差别判断单元的触发, 将所述差别上报 给所述管理者; The reporting unit is configured to: report the difference to the manager based on a trigger of the difference determining unit;
所述同步单元设置为: 在接收到所述管理者的发送单元发送的补丁后, 根据所述补丁同步所述代理本地 MIB。
可选的, The synchronization unit is configured to: after receiving the patch sent by the sending unit of the manager, synchronize the proxy local MIB according to the patch. Optional,
所述发送单元是设置为以如下方式向代理发送请求: 向代理发送一个或 多个 SNMP消息请求, 以将所述管理者本地 MIB中每个节点的 OID及其对 应的操作类型标识发送给所述代理; The sending unit is configured to send a request to the proxy in the following manner: Send one or more SNMP message requests to the proxy to send the OID of each node in the administrator local MIB and its corresponding operation type identifier to the Agent
所述差别判断单元是设置为: 基于该消息请求中携带的操作类型标识对 应的操作的触发, 以节点为单位, 判断并记录所述管理者 MIB 与所述代理 MIB的差别。 The difference judging unit is configured to: trigger the operation corresponding to the operation type identifier carried in the message request, and determine and record the difference between the manager MIB and the proxy MIB in units of nodes.
可选的, Optional,
所述补丁构造单元是设置为以如下方式构造相应补丁: The patch construction unit is configured to construct a corresponding patch in the following manner:
在确定需要同步的节点包括新增的节点和删除的节点时, 构造包括注册 表和与所述注册表关联的操作代码目标文件的补丁, 所述注册表中包括多个 待同步节点的 OID及其对应的 n个操作的地址, n > 0且 n为整数; 对于待删 除的节点, 该节点的 OID对应的操作的地址个数 η=0 , 即其对应的操作地址 为空; 对于待增加的节点, 该节点的 OID对应的操作的地址个数 n > 0, 且所 述操作的地址指向所述操作代码目标文件中的一块区域, 其中保存有更新的 操作的内容; 或者 When determining that the node that needs to be synchronized includes a new node and a deleted node, constructing a patch including a registry and an operation code object file associated with the registry, where the registry includes an OID of a plurality of nodes to be synchronized and The address of the corresponding n operations, n > 0 and n is an integer; for the node to be deleted, the number of addresses of the operation corresponding to the OID of the node is η=0, that is, the corresponding operation address is empty; Node, the number of addresses of the operation corresponding to the OID of the node n > 0, and the address of the operation points to an area in the operation code object file, where the content of the updated operation is saved; or
在确定需要同步的节点仅包括新增的节点时, 构造包括注册表和与所述 注册表关联的操作代码目标文件的补丁, 所述注册表中包括多个待同步节点 的 OID及其对应的 m个操作的地址, m > 0且 m为整数, 所述操作的地址指 向所述操作代码目标文件中的一块区域, 其中保存有更新的操作的内容; 或 者 When determining that the node that needs to be synchronized includes only the newly added node, constructing a patch including a registry and an operation code object file associated with the registry, the registry including the OIDs of the plurality of nodes to be synchronized and their corresponding The address of m operations, m > 0 and m is an integer, the address of the operation points to an area in the operation code object file, in which the content of the updated operation is saved; or
在确定需要同步的节点仅包括删除的节点时, 构造包括注册表的补丁, 所述注册表中包括多个待删除节点的 OID, 其对应的操作地址为空。 When the node that needs to be synchronized includes only the deleted node, the patch includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address is empty.
可选的, Optional,
所述发送单元是设置为以如下方式向所述代理发送请求: 向所述代理发 送一个或多个 SNMP消息请求,所述 SNMP消息请求中包括所述补丁控制节 点的 OID以及预设操作的操作类型标识; The sending unit is configured to send a request to the proxy in a manner of: sending one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation of a preset operation Type identifier
所述同步单元是设置为收到所述 SNMP协议消息后, 根据其中携带的操
作类型标识执行以下动作: 获取补丁、 解析补丁, 以及根据接收到的补丁同 步所述代理本地 MIB。 The synchronization unit is configured to receive the SNMP protocol message, according to the operation carried therein The type identification performs the following actions: obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
本发明通过 "补丁" 方式实现 Agent上 MIB的升级有以下优点: The invention realizes the upgrade of the MIB on the Agent through the "patch" method has the following advantages:
1 ) "补丁" 的制作可以借用其他平台 (如 PC机), 不需要 Agent参与; 1) "Patch" can be produced by borrowing other platforms (such as PC) without Agent participation;
2 )通过制作不同的 "补丁" 可以实现对 MIB的灵活扩展; 2) Flexible extension of the MIB can be achieved by making different "patches";
3 ) 可以实现对 Agent上 MIB的远程在线升级, 较现有方法更为简洁、 灵活。 附图概述 3) The remote online upgrade of the MIB on the Agent can be implemented, which is more concise and flexible than the existing methods. BRIEF abstract
图 1为 SNMP网络管理中 MIB树示意图; Figure 1 is a schematic diagram of an MIB tree in SNMP network management;
图 2为 Manager与 Agent上 MIB不相同引发升级需求的示意图; 图 3为本发明实施例流程图; FIG. 2 is a schematic diagram showing that the MIB of the Manager and the Agent are different, and the upgrade requirement is triggered; FIG. 3 is a flowchart of an embodiment of the present invention;
图 4为本发明实施例 "补丁" 结构图。 本发明的较佳实施方式 4 is a structural diagram of a "patch" according to an embodiment of the present invention. Preferred embodiment of the invention
由于 MIB从组织结构上呈 "树状" 结构, 对 MIB的升级也就是向 MIB 中添加若干节点及其对应的操作 ,或者从其中删除若干节点及其对应的操作。 因此, 本发明考虑将扩展部分的节点及其操作制作成 "补丁" , Manager通 过控制 Agent动态地启用或删除该补丁, 以实现对 Agent上 MIB的升级。 Since the MIB has a "tree" structure from the organizational structure, upgrading the MIB means adding several nodes and their corresponding operations to the MIB, or deleting several nodes and their corresponding operations from them. Therefore, the present invention considers the node of the extension part and its operation as a "patch", and the Manager dynamically enables or deletes the patch by the control agent to implement the upgrade of the MIB on the agent.
本发明的发明构思是: 当 Manager启动升级后, Manager遍历操作本地 MIB所有节点, 向 Agent发送请求, Agent根据接收到的请求判断 Manager 上的 MIB与本地 MIB是否有差别, 如果有差别, 则将所述差别上报给所述 Manager, 所述 Manager根据上报的差别确定需要同步的节点, 构造相应补丁 并将所述补丁下发到 Agent, Agent根据接收到的补丁同步本地 MIB。 如果没 有差别, 则本次升级过程结束。 The inventive concept of the present invention is: After the Manager starts the upgrade, the Manager traverses all the nodes of the local MIB, sends a request to the Agent, and the Agent determines, according to the received request, whether the MIB on the Manager is different from the local MIB, and if there is a difference, The difference is reported to the manager, and the manager determines the node that needs to be synchronized according to the reported difference, constructs a corresponding patch, and delivers the patch to the agent, and the agent synchronizes the local MIB according to the received patch. If there is no difference, the upgrade process ends.
优选地, 在设计 MIB (包括 Manager的 MIB和 Agent的 MIB )时, 任意 Preferably, when designing the MIB (including the MIB of the Manager and the MIB of the Agent),
8
选择其中一节点作为补丁控制节点, 即所述 Manager和 Agent的 MIB中各包 含一个作为补丁控制节点的节点, 该节点在 Manager中的 OID和在 Agent中 的 OID相同;预设所述补丁控制节点对应的操作用于指示 Agent执行的动作, 一个预设操作对应以下一个或多个动作:判断 Manager上的 MIB与本地 MIB 是否有差别、 获取补丁、 解析补丁, 以及根据接收到的补丁同步本地 MIB。 8 Select one of the nodes as the patch control node, that is, the MIB of the Manager and the Agent each include a node as a patch control node, and the OID of the node in the Manager is the same as the OID in the agent; the patch control node is preset. The corresponding operation is used to indicate the action performed by the agent. One preset operation corresponds to one or more actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the local MIB according to the received patch. .
所述 Manager将补丁下发到 Agent, Agent根据接收到的补丁同步本地 MIB的步骤包括: Manager通过操作所述补丁控制节点指示所述 Agent获取 补丁、解析补丁,以及根据接收到的补丁同步本地 MIB。可选的,所述 Manager 向 Agent发送一个或多个 SNMP消息请求, 所述 SNMP消息请求中包括所述 补丁控制节点的 OID 以及预设操作的操作类型标识, 所述 Agent收到所述 SNMP协议消息后, 根据其中携带的操作类型标识执行相应的动作, 完成获 取补丁、 解析补丁, 以及根据接收到的补丁同步本地 MIB的动作。 The agent sends the patch to the agent, and the step of the agent synchronizing the local MIB according to the received patch includes: the Manager instructs the agent to obtain a patch, parse the patch, and synchronize the local MIB according to the received patch by operating the patch control node. . Optionally, the manager sends one or more SNMP message requests to the agent, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation, and the agent receives the SNMP protocol. After the message is executed, the corresponding action is performed according to the operation type identifier carried therein, and the process of obtaining the patch, parsing the patch, and synchronizing the local MIB according to the received patch is completed.
具体地, 所述补丁控制节点对应若干操作, 预设所述补丁控制节点对应 的第一操作用于指示 Agent获取补丁, 第二操作用于指示 Agent解析补丁, 第三操作用于指示 Agent根据补丁同步本地 MIB;当所述 Manager指示 Agent 获取补丁时, 所述 Manager向 Agent发送的 SNMP消息请求中包括所述补丁 控制节点的 OID ( Object Identifiers, 对象标识符) 、 第一操作的操作类型标 识以及补丁内容; 当所述 Manager指示 Agent解析补丁时, 所述 Manager向 Agent发送的 SNMP消息请求中包括所述补丁控制节点的 OID以及第二操作 的操作类型标识;当所述 Manager指示 Agent根据接收到的补丁同步本地 MIB 时, 所述 Manager向 Agent发送的 SNMP协议消息中包括所述补丁控制节点 的 OID以及第三操作的操作类型标识。 Agent收到所述 SNMP消息请求后, 根据接收到的 SNMP消息请求携带的内容执行相应的动作。 Specifically, the patch control node corresponds to a plurality of operations, and the first operation corresponding to the patch control node is used to instruct the agent to obtain a patch, the second operation is used to instruct the agent to parse the patch, and the third operation is used to instruct the agent to perform the patch according to the patch. The local MIB is synchronized; when the manager instructs the agent to obtain the patch, the SNMP message request sent by the manager to the agent includes an OID (Object Identifiers) of the patch control node, an operation type identifier of the first operation, and The content of the patch is: when the manager instructs the agent to parse the patch, the SNMP message request sent by the manager to the agent includes the OID of the patch control node and the operation type identifier of the second operation; when the manager instructs the agent to receive the When the patch is synchronized with the local MIB, the SNMP protocol message sent by the Manager to the agent includes the OID of the patch control node and the operation type identifier of the third operation. After receiving the SNMP message request, the agent performs the corresponding action according to the content carried in the received SNMP message request.
上述第一操作、 第二操作和第三操作可以相同也可以不同, 可在 Agent 的流程中规定何时在收到哪种操作类型标识时执行怎样的动作, 但需要与 Manager统一设定。 The first operation, the second operation, and the third operation may be the same or different, and the action of the agent may be specified in the process of the agent when the operation type identifier is received, but it needs to be uniformly set with the manager.
优选地, Manger可根据一操作类型标识指示 Agent执行两步以上的动作, 例如, Manager发送补丁控制节点的 OID以及第二操作的操作类型标识, 通 过该第二操作的操作类型标识指示 Agent解析补丁及同步本地 MIB, 此时可
认为第二操作与第三操作相同。 所述 Manager遍历操作本地 MIB所有节点, 向 Agent发送请求的步骤包 括: 所述 Manager向 Agent发送一个或多个 SNMP消息请求, 以将 Manager 本地 MIB中每个节点的 OID及其对应的某一操作 X的操作类型标识发送给 Agent。 优选地, Manager本地 MIB中有 m个节点时, Manager向 Agent发送 m条 SNMP消息请求 ,每条消息请求中携带一个节点的 OID及其对应的操作 X的操作类型标识。 Preferably, the Manger can indicate that the Agent performs two or more actions according to an operation type identifier, for example, the Manager sends the OID of the patch control node and the operation type identifier of the second operation, and the operation type identifier of the second operation instructs the Agent to parse the patch. And synchronize the local MIB, at this time The second operation is considered to be the same as the third operation. The process of the traversal operation of all the nodes of the local MIB, the sending of the request to the agent includes: the manager sending one or more SNMP message requests to the agent, to the OID of each node in the Manager local MIB and a corresponding operation thereof The operation type identifier of X is sent to the Agent. Preferably, when there are m nodes in the Manager local MIB, the Manager sends m SNMP message requests to the Agent, and each message request carries the OID of one node and the operation type identifier of the corresponding operation X.
预设所述补丁控制节点对应的操作 X用于指示 Agent判断 Manager上的 MIB与本地 MIB是否有差别; 所述 Agent根据接收到的请求判断 Manager上 的 MIB与本地 MIB是否有差别的步骤包括: Agent收到该消息请求后, 读取 该消息请求中携带的 OID及操作类型标识, 所述操作类型标识所标识的操作 X触发 Agent以节点为单位, 判断并记录所述第一 MIB与第二 MIB的差别 , 具体包括: Agent判断本地 MIB中是否有与消息请求中的 OID相同的 OID, 如果有, 则判断该本地节点与 Manager上的节点无差别, 如果没有, 则判断 该本地节点与 Manager上的节点有差别, 并记录所述差别; 当判断完所有消 息请求中的 OID后,判断本地 MIB中是否还有未进行过比较的节点,如果有, 则判断该节点与 Manager上的节点有差别, 并记录该差别, 如果没有, 判断 操作结束。 优选地, Agent记录的差别包括节点 OID。 The operation X corresponding to the patch control node is used to indicate that the agent determines whether the MIB on the Manager is different from the local MIB. The step of determining, by the agent, whether the MIB on the Manager is different from the local MIB according to the received request includes: After receiving the message request, the agent reads the OID and the operation type identifier carried in the message request, and the operation type identifier that is identified by the operation type identifier triggers the agent to determine and record the first MIB and the second by using a node as a unit. The difference between the MIB and the specificity includes: the agent determines whether the local MIB has the same OID as the OID in the message request, and if so, determines that the local node has no difference from the node on the Manager, and if not, determines the local node and the Manager. The nodes on the difference are different, and the difference is recorded. After determining the OID in all the message requests, it is determined whether there are any nodes in the local MIB that have not been compared, and if so, it is determined that the node has a node with the Manager. Difference, and record the difference, if not, judge the operation is over. Preferably, the difference recorded by the Agent includes the node OID.
优选地, 可分类记录差别: 包括 Manager上存在而本地不存在的 MIB节 点, 以及本地存在而 Manager上不存在的 MIB节点。 Preferably, the difference can be classified: including MIB nodes that exist on the Manager but do not exist locally, and MIB nodes that exist locally but do not exist on the Manager.
对应不同的情况所述 Manager构造的补丁包括的内容不同,有以下几种: According to different situations, the patch constructed by the Manager includes different contents, which are as follows:
1 )所述同步操作包括新增节点和删除节点时, 即 Manage根据上报的差 别确定需要同步的节点包括新增的节点和删除的节点时, 所述补丁包括注册 表和与所述注册表关联的操作代码目标文件, 所述注册表中包括多个待同步 节点的 OID及其对应的 n个操作的地址(n > 0, 且 n为整数) , 对于待删除 的节点, 该节点的 OID对应的操作的地址个数 n=0时, 即其对应的操作地址 为空; 对于待增加的节点, 该节点的 OID对应的操作的地址个数 n > 0, 且所 述操作的地址指向所述操作代码目标文件中的一块区域, 其中保存有更新的 操作的内容(所述内容以目标代码形式给出) , 该 OID表示的节点对应的操 1) The synchronization operation includes adding a node and deleting a node, that is, when the manager determines, according to the difference reported, that the node to be synchronized includes a newly added node and a deleted node, the patch includes a registry and is associated with the registry. The operating code object file, the registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding n operations (n > 0, and n is an integer), and for the node to be deleted, the OID of the node corresponds to When the number of addresses of the operation is n=0, that is, the corresponding operation address is empty; for the node to be added, the number of addresses of the operation corresponding to the OID of the node is n>0, and the address of the operation points to the An area in the operation code object file in which the content of the updated operation is saved (the content is given in the form of object code), and the node corresponding to the OID represents the operation
10
作需被更新或该节点需被增加。 10 The work needs to be updated or the node needs to be added.
2 )所述同步操作仅包括新增节点时, 即 Manage根据上报的差别确定需 要同步的节点仅包括新增的节点时, 所述补丁包括注册表和与所述注册表关 联的操作代码目标文件, 所述注册表中包括多个待同步节点的 OID及其对应 的 m个操作的地址(m > 0 , 且 n为整数) , 所述操作的地址指向所述操作代 码目标文件中的一块区域, 其中保存有更新的操作的内容(所述内容以目标 代码形式给出) 。 2) When the synchronization operation only includes adding a new node, that is, when the management determines that the node to be synchronized includes only the newly added node according to the difference reported, the patch includes a registry and an operation code object file associated with the registry. The registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding m operations (m>0, and n is an integer), and the address of the operation points to a region in the operation code object file , where the content of the updated operation is saved (the content is given in the form of object code).
如果 OID相同但对应的操作不同时, 可按照新增节点的流程进行更新。 If the OIDs are the same but the corresponding operations are different, they can be updated according to the process of adding a new node.
3 )所述同步操作仅包括删除节点时, 即 Manage根据上报的差别确定需 要同步的节点仅包括删除的节点时, 所述补丁包括注册表, 所述注册表中包 括多个待删除节点的 OID, 其对应的操作地址为空。 3) The synchronization operation includes only deleting the node, that is, when the management determines that the node to be synchronized includes only the deleted node according to the reported difference, the patch includes a registry, and the registry includes multiple OIDs of the node to be deleted. , its corresponding operation address is empty.
所述根据补丁同步 Agent本地 MIB的步骤包括: 1 ) Agent从补丁中的注 册表中选取一 OID作为当前同步的 OID; 2 )判断注册表中该 OID对应操作 地址是否为空, 如果为空, 则将本地 MIB中的具有相同 OID的节点删除, 如 果不为空, 则判断本地 MIB中是否有相同 OID的节点, 如果有, 则按照该 OID对应的操作地址读取操作代码目标文件, 获取更新内容, 同步本地 MIB 中的具有相同 OID的节点, 如果没有, 则以该 OID在本地 MIB中注册一新 节点, 根据从操作代码目标文件中读取的更新内容, 同步新节点对应的操作; 3 )从补丁中的注册表中再选取一未同步过的 OID作为当前同步的 OID, 执 行上述步骤 2 ); 重复执行上述步骤 2 )和步骤 3 )直到注册表中的 OID全部 同步完毕。 The step of synchronizing the agent local MIB according to the patch includes: 1) the agent selects an OID from the registry in the patch as the currently synchronized OID; 2) determines whether the OID corresponding operation address in the registry is empty, and if it is empty, Then, the node with the same OID in the local MIB is deleted. If it is not empty, it is determined whether there is a node with the same OID in the local MIB. If yes, the operation code object file is read according to the operation address corresponding to the OID, and an update is obtained. Content, synchronizes the node with the same OID in the local MIB, if not, registers a new node in the local MIB with the OID, and synchronizes the operation corresponding to the new node according to the updated content read from the operation code object file; Then, select an unsynchronized OID from the registry in the patch as the currently synchronized OID, and perform the above steps 2); repeat the above steps 2) and 3) until the OIDs in the registry are all synchronized.
注册表的设计是为了实现动态扩展节点的灵活配置, 补丁控制节点每次 按照注册表中的 MIB节点进行扩展, 注册表中不存在的 MIB节点, 即使操 作代码目标文件中存在该 MIB的操作代码, 也不会进行扩展。 The registry is designed to achieve flexible configuration of dynamically extended nodes. The patch control node is extended according to the MIB node in the registry, and the MIB node does not exist in the registry, even if the operation code of the MIB exists in the operation code object file. , will not expand.
实现上述升级方法的系统, 包括 Manager和 Agent, 其中: The system that implements the above upgrade method, including Manager and Agent, where:
所述 Manager, 用于在启动升级后, Manager遍历操作本地 MIB所有节 点, 向 Agent发送请求; 以及用于根据 Agent上报的差别确定需要同步的节 The Manager is configured to: after the upgrade is started, the Manager traverses all nodes of the local MIB to send a request to the Agent; and is used to determine a section to be synchronized according to the difference reported by the Agent.
11
点, 构造相应补丁并将所述补丁下发到 Agent; 11 Point, construct the corresponding patch and deliver the patch to the Agent;
所述 Agent, 用于根据接收到的请求判断 Manager上的 MIB与本地 MIB 是否有差别, 如果有差别, 则将所述差别上报给所述 Manager; 以及用于根 据接收到的补丁同步本地 MIB。 The agent is configured to determine, according to the received request, whether the MIB on the Manager is different from the local MIB, and if there is a difference, report the difference to the Manager; and synchronize the local MIB according to the received patch.
优选地: 所述 Manager包括: 第一 MIB单元、发送单元、补丁构造单元, 其中: Preferably, the manager includes: a first MIB unit, a sending unit, and a patch construction unit, where:
所述第一 MIB单元 , 用于在 Manager的 MIB (第一 MIB )中选择任一节 点作为补丁控制节点, 所述补丁控制节点对应多个操作, 预设所述操作用于 指示 Agent执行以下一个或多个动作:判断 Manager上的 MIB与本地 MIB是 否有差别、获取补丁、解析补丁,以及根据接收到的补丁同步 Agent本地 MIB (第二 MIB ) ; The first MIB unit is configured to select any node in the MIB (first MIB) of the Manager as a patch control node, where the patch control node corresponds to multiple operations, and the operation is preset to instruct the agent to execute the following one. Or multiple actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the Agent local MIB (second MIB) according to the received patch;
所述发送单元, 用于在启动升级后, 遍历操作所述第一 MIB所有节点, 向 Agent发送请求; 以及用于基于所述补丁构造单元的触发将所述补丁下发 到 Agent; The sending unit is configured to: traverse all the nodes of the first MIB, and send a request to the agent after starting the upgrade; and send the patch to the agent based on the trigger of the patch construction unit;
所述补丁构造单元, 用于在接收到 Agent上报的 MIB差别后, 根据所述 差别确定需要同步的节点, 构造相应补丁, 并触发所述发送单元; The patch construction unit is configured to: after receiving the MIB difference reported by the agent, determine a node that needs to be synchronized according to the difference, construct a corresponding patch, and trigger the sending unit;
优选地: 所述 Agent包括第二 MIB单元、 差别判断单元、 上报单元、 同 步单元, 其中: Preferably, the agent includes a second MIB unit, a difference determining unit, a reporting unit, and a synchronization unit, where:
所述第二 MIB单元, 用于在第二 MIB中选择任一节点作为补丁控制节 点,该第二 MIB的补丁控制节点的 OID与第一 MIB中的补丁控制节点的 OID 相同, 所述节点对应多个操作, 预设所述操作用于执行以下一个或多个动作: 判断 Manager上的 MIB与本地 MIB是否有差别、 获取补丁、 解析补丁, 以 及根据接收到的补丁同步本地第二 MIB; The second MIB unit is configured to select any node in the second MIB as the patch control node, where the OID of the patch control node of the second MIB is the same as the OID of the patch control node in the first MIB, where the node corresponds to a plurality of operations, the operation is preset to perform one or more of the following actions: determining whether the MIB on the Manager is different from the local MIB, obtaining a patch, parsing the patch, and synchronizing the local second MIB according to the received patch;
所述差别判断单元, 用于在接收到所述 Manager的发送单元发送的请求 后, 根据所述请求判断 Manager上的第一 MIB与本地第二 MIB是否有差别, 如果有差别, 则收集差别并触发上 单元; The difference judging unit is configured to: after receiving the request sent by the sending unit of the Manager, determine, according to the request, whether there is a difference between the first MIB on the Manager and the local second MIB, and if there is a difference, collect the difference and Trigger the upper unit;
所述上报单元, 用于基于所述差别判断单元的触发, 将所述差别上报给 The reporting unit is configured to report the difference to the trigger based on the difference determining unit
12
所述 Manager; 12 The Manager;
所述同步单元, 用于在接收到所述 Manager的发送单元发送的补丁后, 根据所述补丁同步本地第二 MIB。 The synchronization unit is configured to synchronize the local second MIB according to the patch after receiving the patch sent by the sending unit of the Manager.
优选地, 所述发送单元, 向 Agent发送的请求包括一个或多个 SNMP消 息请求,以将 Manager本地第一 MIB中每个节点的 OID及其对应的操作类型 标识发送给 Agent; Preferably, the sending unit, the request sent to the agent includes one or more SNMP message requests, to send the OID of each node in the first local MIB of the Manager and its corresponding operation type identifier to the Agent;
所述差别判断单元, 用于基于该消息请求中携带的操作类型标识对应的 操作的触发, 以节点为单位, 判断并记录所述第一 MIB与第二 MIB的差别; 所述差别包括: Manager上存在而本地不存在的 MIB节点, 以及本地存在而 Manager上不存在的 MIB节点。 判断操作的一种形式是: 判断本地第二 MIB 中是否有与消息请求中的 OID相同的 OID, 如果有, 则判断该本地节点与 Manager上的节点无差别, 如果没有, 则判断该本地节点与 Manager上的节 点有差别, 并记录所述差别; 当判断完所有消息请求中的 OID后, 判断本地 MIB中是否还有节点未进行过比较, 如果有则判断该节点与 Manager上的节 点有差别, 并记录该差别, 如果没有, 判断操作结束。 The difference judging unit is configured to determine, according to the trigger of the operation corresponding to the operation type identifier carried in the message request, the difference between the first MIB and the second MIB by using a node; the difference includes: MIB nodes that exist on the local but do not exist locally, and MIB nodes that exist locally but do not exist on the Manager. A form of the determining operation is: determining whether the local second MIB has the same OID as the OID in the message request, and if so, determining that the local node has no difference from the node on the Manager, and if not, determining the local node Different from the node on the Manager, and record the difference; After judging the OID in all the message requests, it is determined whether there are any nodes in the local MIB that have not been compared, if any, it is determined that the node and the node on the Manager have Difference, and record the difference, if not, judge the operation is over.
优选地, 所述补丁构造单元在确定需要同步的节点包括新增的节点和删 除的节点时, 构造的补丁包括注册表和与所述注册表关联的操作代码目标文 件, 所述注册表中包括多个待同步节点的 OID及其对应的 n个操作的地址, n > 0且 n为整数; 对于待删除的节点, 该节点的 OID对应的操作的地址个数 n=0, 即其对应的操作地址为空; 对于待增加的节点, 该节点的 OID对应的 操作的地址个数 n > 0, 且所述操作的地址指向所述操作代码目标文件中的一 块区域, 其中保存有更新的操作的内容; 或者 Preferably, the patch construction unit, when determining that the node that needs to be synchronized includes a newly added node and a deleted node, the configured patch includes a registry and an operation code target file associated with the registry, where the registry includes The OID of the node to be synchronized and the address of the corresponding n operations, n > 0 and n is an integer; for the node to be deleted, the number of addresses corresponding to the OID of the node is n=0, that is, its corresponding The operation address is empty; for the node to be added, the number of addresses of the operation corresponding to the OID of the node is n > 0, and the address of the operation points to an area in the operation code object file, where the update operation is saved. Content; or
所述补丁构造单元在确定需要同步的节点仅包括新增的节点时, 构造的 补丁包括注册表和与所述注册表关联的操作代码目标文件, 所述注册表中包 括多个待同步节点的 OID及其对应的 m个操作的地址, m > 0且 m为整数, 所述操作的地址指向所述操作代码目标文件中的一块区域, 其中保存有更新 The patch construction unit, when determining that the node that needs to be synchronized includes only the newly added node, the constructed patch includes a registry and an operation code target file associated with the registry, where the registry includes a plurality of nodes to be synchronized. The address of the OID and its corresponding m operations, m > 0 and m is an integer, the address of the operation points to an area in the operation code object file, where the update is saved
13
的操作的内容; 或者 13 The content of the operation; or
所述补丁构造单元在确定需要同步的节点仅包括删除的节点时, 构造的 补丁包括注册表, 所述注册表中包括多个待删除节点的 OID, 其对应的操作 地址为空。 The patch construction unit, when the node that needs to be synchronized only includes the deleted node, includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address is empty.
优选地, 所述发送单元,用于向 Agent发送一个或多个 SNMP消息请求, 所述 SNMP消息请求中包括所述补丁控制节点的 OID以及预设操作的操作类 型标识; Preferably, the sending unit is configured to send one or more SNMP message requests to the agent, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation;
所述同步单元, 用于收到所述 SNMP协议消息后, 根据其中携带的操作 类型标识执行以下动作, 获取补丁、 解析补丁, 以及根据接收到的补丁同步 本地第二 MIB。 The synchronization unit is configured to: after receiving the SNMP protocol message, perform the following actions according to the operation type identifier carried in the identifier, obtain a patch, parse the patch, and synchronize the local second MIB according to the received patch.
下面结合附图和具体实施例对本发明做进一步的阐述。 The present invention will be further described below in conjunction with the drawings and specific embodiments.
如图 3所示, 预先在 MIB设计时, 预设一个补丁控制节点; 该节点除了 具有一般 MIB节点具有的操作外,还具有控制 Agent上 MIB升级过程的功能, 包括 Agent和 Manager各自 MIB差异的传输, 补丁的传输, 以及通知 Agent 根据补丁进行同步操作; 实现 MIB升级的方法包括: As shown in FIG. 3, a patch control node is preset in the MIB design. In addition to the operations of the general MIB node, the node also has the function of controlling the MIB upgrade process on the Agent, including the MIB difference between the Agent and the Manager. The transmission, the transmission of the patch, and the notification agent are synchronized according to the patch; the methods for implementing the MIB upgrade include:
步骤 1: Manager激活 Agent上补丁流程, 即 Agent发送进入补丁流程的 通知; Step 1: The Manager activates the patch process on the agent, that is, the agent sends a notification to enter the patch process.
步骤 2: Agent向 Manager发送已进入补丁流程的响应; Step 2: The Agent sends a response to the Manager that has entered the patch process;
步骤 3: Manager遍历操作本地 MIB, 向 Agent发送 SNMP请求, 其中 包括节点 OID以及对应的操作类型标识; Step 3: The traversal operation of the local MIB by the Manager sends an SNMP request to the Agent, including the node OID and the corresponding operation type identifier.
步骤 4: Agent接收到 Manager发送的请求后, 由该操作类型标识所标识 的操作触发 Agent进行比较 Agent本地 MIB与 Manager上 MIB差别的操作, Agent收集该差别后上报给 Manager,所述差别包括 Manager上存在而本地不 存在的 MIB节点, 以及本地存在而 Manager上不存在的 MIB节点; Step 4: After the agent receives the request sent by the manager, the operation triggered by the operation type identifier triggers the agent to compare the difference between the local MIB of the agent and the MIB of the manager. The agent collects the difference and reports the difference to the manager. The difference includes the manager. An MIB node that exists on the local but does not exist locally, and an MIB node that exists locally but does not exist on the Manager;
步骤 5: Manager根据 Agent上 4艮的 Agent本地 MIB与 Manager上 MIB 的差别, 制作对应的补丁, 并通过操作补丁控制节点, 将补丁发送给 Agent; Step 5: The Manager creates a corresponding patch according to the difference between the Agent local MIB of the Agent and the MIB on the Manager, and sends the patch to the Agent by operating the patch control node.
14
该补丁结构如图 4所示, 包含: 待同步 MIB节点的操作代码目标文件, 以及待同步 MIB节点的 OID与对应操作的注册表。 该注册表每一个表项为 OID与其多种操作的对应。 如前所述, OID对应的操作地址为空时, 则表示 需要 Agent删除该节点,如果 OID对应的操作地址不为空,则表示需要 Agent 更新该节点。 本实施例所给出的图 4仅为示例。 14 The patch structure is as shown in FIG. 4, and includes: an operation code object file of the MIB node to be synchronized, and an OID of the MIB node to be synchronized and a registry of the corresponding operation. Each entry in the registry corresponds to the OID and its various operations. As described above, when the operation address corresponding to the OID is empty, it indicates that the agent needs to delete the node. If the operation address corresponding to the OID is not empty, it indicates that the agent needs to update the node. Figure 4 given in this embodiment is merely an example.
步骤 6: Agent成功接收补丁后, 以 Trap形式, 即主动发送 Trap报文的 方式, 通知 Manager接收成功; Step 6: After the agent receives the patch successfully, the agent sends the trap message in the form of a trap, and the Manager is notified that the packet is successfully received.
步骤 7: Manager操作补丁控制节点, 启动 Agent解析该 "补丁"的操作; 步骤 8: Agent解析补丁, 并根据补丁同步本地 MIB; Step 7: The Manager operates the patch control node, and starts the operation of the Agent to resolve the "patch"; Step 8: The agent parses the patch, and synchronizes the local MIB according to the patch;
具体地, 读取补丁中的注册表(结构如图 4 ) , 遍历该注册表, 提取出 每一个节点的 OID和相关操作的目标代码信息。 Specifically, the registry in the patch is read (structure is shown in FIG. 4), and the registry is traversed to extract the OID of each node and the object code information of the related operation.
以补丁中仅包括新增节点为例, Agent将解析得到的节点 OID注册到现 有 MIB中相应的分支, 按照本地 MIB中节点的数据结构, 构造一个节点结 构用来挂接该 OID的若干中操作代码。如果 Agent解析到的节点 OID在本地 MIB中存在, 则釆用覆盖的方式更新本地节点。 Taking the newly added node as an example, the agent registers the parsed node OID to the corresponding branch in the existing MIB, and constructs a node structure for attaching the OID according to the data structure of the node in the local MIB. Operation code. If the node OID that the agent resolves exists in the local MIB, the local node is updated in the overlay mode.
步骤 9: 同步完成后, Agent以 Trap形式通知 Manager本次新增的节点 OID完成; Step 9: After the synchronization is complete, the agent notifies the Manager that the newly added node OID is completed in the form of a trap.
步骤 10: Manager操作补丁控制节点, 通知 Agent补丁流程结束。 Step 10: The Manager operates the patch control node to notify the agent that the patch process ends.
上文描述了一种利用 "补丁" 技术对 Agent中 MIB进行远程在线升级的 方法实例, 其中可以看出本发明所提出的方法不需要在近端逐一对网络内被 管理设备 Agent的 MIB进行重新制作并更换, 只需在 Agent上增加 "补丁" 方式的少量支撑机制就可以实现 MIB的灵活升级, 有很强的实用性。 The foregoing describes an example of a method for remotely upgrading an MIB in an agent by using a "patch" technology. It can be seen that the method proposed by the present invention does not need to be re-established by the MIB of the management device agent in the near-end network. To make and replace, you only need to add a small amount of support mechanism in the "patch" mode on the Agent to realize the flexible upgrade of MIB, which has strong practicability.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各单元可以釆用硬件 One of ordinary skill in the art will appreciate that all or a portion of the steps above may be accomplished by a program to instruct the associated hardware, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each unit in the above embodiment can use hardware
15
的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任何特 定形式的硬件和软件的结合。 15 The form of the implementation can also be implemented in the form of software functional modules. The invention is not limited to any specific form of combination of hardware and software.
当然, 本发明还可有其他多种实例, 在不背离本发明精神及其实质的情 些相应的改变和变形都应属于本发明所附的权利要求的保护范围。 The invention may, of course, be embodied in various other forms and modifications without departing from the spirit and scope of the invention.
此外, 本发明还可以有其它改进方法, 如对 "补丁" 程序制作方法的修 改, 对获取补丁方法的修改等等, 但这些相应的改变和变形都应属于本发明 所附的权利要求的保护范围。 In addition, the present invention may also have other improved methods, such as modification of the "patch" program making method, modification of the patch acquiring method, etc., but these corresponding changes and modifications should be protected by the appended claims. range.
工业实用性 Industrial applicability
本发明通过 "补丁" 方式实现 Agent上 MIB的升级有以下优点: The invention realizes the upgrade of the MIB on the Agent through the "patch" method has the following advantages:
1 ) "补丁" 的制作可以借用其他平台 (如 PC机), 不需要 Agent参与; 1) "Patch" can be produced by borrowing other platforms (such as PC) without Agent participation;
2 )通过制作不同的 "补丁" 可以实现对 MIB的灵活扩展; 2) Flexible extension of the MIB can be achieved by making different "patches";
3 ) 可以实现对 Agent上 MIB的远程在线升级, 较现有方法更为简洁、 灵活。 3) The remote online upgrade of the MIB on the Agent can be implemented, which is more concise and flexible than the existing methods.
16
16
Claims
1、 一种简单网络管理协议(SNMP )代理上管理信息库(MIB )升级方 法, 包括: 1. A Simple Network Management Protocol (SNMP) agent management information base (MIB) upgrade method, including:
当管理者启动升级后, 所述管理者遍历操作所述管理者本地 MIB所有节 点,向代理发送请求,所述代理根据接收到的请求判断出所述管理者上的 MIB 与所述代理本地 MIB有差别, 则将所述差别上 ^艮给所述管理者, 所述管理者 根据上报的差别确定需要同步的节点, 构造相应补丁并将所述补丁下发到所 述代理, 所述代理根据接收到的补丁同步所述代理本地 MIB。 After the administrator initiates the upgrade, the administrator traverses all the nodes of the manager local MIB, sends a request to the agent, and the agent determines the MIB on the manager and the proxy local MIB according to the received request. If there is a difference, the difference is sent to the manager, the manager determines the node that needs to be synchronized according to the difference reported, constructs a corresponding patch, and delivers the patch to the agent, and the agent is configured according to The received patch synchronizes the proxy local MIB.
2、 如权利要求 1所述的方法, 其中, 2. The method of claim 1 wherein
所述管理者的 MIB和所述代理的 MIB中各包含一作为补丁控制节点的 节点, 两节点的对象标识符(OID )相同; The manager's MIB and the agent's MIB each include a node as a patch control node, and the object identifiers (OIDs) of the two nodes are the same;
所述方法还包括: 预设所述补丁控制节点对应的操作用于指示代理执行 的动作, 一个预设操作对应以下动作中的一个或多个: 判断管理者上的 MIB 与所述代理本地 MIB的差别、 获取补丁、 解析补丁, 以及根据接收到的补丁 同步所述代理本地 MIB。 The method further includes: presetting the operation corresponding to the patch control node to indicate an action performed by the agent, and the one preset operation corresponds to one or more of the following actions: determining the MIB on the manager and the proxy local MIB The difference, get the patch, parse the patch, and synchronize the proxy local MIB based on the received patch.
3、 如权利要求 1所述的方法, 其中, 所述管理者遍历操作本地 MIB所 有节点, 向代理发送请求的步骤包括: 3. The method according to claim 1, wherein the step of the administrator traversing all nodes of the local MIB and sending the request to the proxy comprises:
所述管理者向所述代理发送一个或多个 SNMP消息请求, 以将管理者本 地 MIB中每个节点的 OID及其对应的操作类型标识发送给所述代理。 The manager sends one or more SNMP message requests to the agent to send the OID of each node in the administrator's local MIB and its corresponding operation type identifier to the agent.
4、 如权利要求 3所述的方法, 其中, 所述代理根据接收到的请求判断出 所述管理者上的 MIB与所述代理本地 MIB有差别的步骤包括: 4. The method according to claim 3, wherein the step of the agent determining, according to the received request, that the MIB on the manager is different from the proxy local MIB comprises:
所述代理收到所述 SNMP消息请求后,读取该消息请求中携带的 OID及 操作类型标识 ,所述操作类型标识所标识的操作触发所述代理以节点为单位 , 判断并记录所述管理者上的 MIB与代理上的 MIB的差别的差别。 After receiving the SNMP message request, the proxy reads the OID and the operation type identifier carried in the message request, and the operation identified by the operation type identifier triggers the proxy to be a node, and determines and records the management. The difference between the MIB on the agent and the MIB on the agent.
5、 如权利要求 1所述的方法, 其中, 所述管理者根据上报的差别确定需 要同步的节点, 构造相应补丁的步骤包括: 5. The method according to claim 1, wherein the manager determines the node to be synchronized according to the difference reported, and the step of constructing the corresponding patch includes:
所述管理者根据上报的差别确定需要同步的节点包括新增的节点和删除 的节点时, 所述管理者构造的补丁包括注册表和与所述注册表关联的操作代 The administrator determines, according to the difference reported, that the node that needs to be synchronized includes a newly added node and a deleted node, and the patch constructed by the administrator includes a registry and an operation generation associated with the registry.
17 码目标文件, 所述注册表中包括多个待同步节点的 OID及其对应的 n个操作 的地址, n > 0且 n为整数; 对于待删除的节点, 该节点的 OID对应的操作的 地址个数 n=0, 即其对应的操作地址为空; 对于待增加的节点,该节点的 OID 对应的操作的地址个数11 > 0, 且所述操作的地址指向所述操作代码目标文件 中的一块区域, 其中保存有更新的操作的内容; 或者 17 a code object file, the registry includes an OID of a plurality of nodes to be synchronized and an address of the corresponding n operations, n > 0 and n is an integer; for the node to be deleted, an address of the operation corresponding to the OID of the node The number n=0, that is, the corresponding operation address is empty; for the node to be added, the number of addresses of the operation corresponding to the OID of the node is 11 > 0, and the address of the operation points to the operation code object file An area in which the contents of the updated operation are stored; or
所述管理者根据上报的差别确定需要同步的节点仅包括新增的节点时, 所述管理者构造的补丁包括注册表和与所述注册表关联的操作代码目标文 件, 所述注册表中包括多个待同步节点的 OID及其对应的 m个操作的地址, m > 0且 m为整数, 所述操作的地址指向所述操作代码目标文件中的一块区 域, 其中保存有更新的操作的内容; 或者 The administrator determines, according to the difference reported, that the node that needs to be synchronized only includes the newly added node, the patch constructed by the administrator includes a registry and an operation code target file associated with the registry, where the registry includes An OID of a plurality of nodes to be synchronized and an address of the corresponding m operations, m > 0 and m is an integer, and the address of the operation points to an area in the operation code object file, where the content of the updated operation is saved ; or
所述管理者根据上报的差别确定需要同步的节点仅包括删除的节点时, 所述管理者构造的补丁包括注册表, 所述注册表中包括多个待删除节点的 OID, 其对应的操作地址为空。 The administrator determines that the node to be synchronized includes only the deleted node according to the difference of the report, the patch constructed by the administrator includes a registry, and the registry includes multiple OIDs of the node to be deleted, and the corresponding operation address Is empty.
6、 如权利要求 1所述的方法, 其中, 所述管理者将补丁下发到代理, 所 述代理根据接收到的补丁同步所述代理本地 MIB的步骤包括: The method of claim 1, wherein the manager sends the patch to the agent, and the step of the agent synchronizing the proxy local MIB according to the received patch includes:
所述管理者通过操作所述补丁控制节点指示所述代理获取补丁、 解析补 丁, 以及根据接收到的补丁同步所述代理本地 MIB。 The administrator instructs the agent to acquire a patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node.
7、 如权利要求 6所述的方法, 其中, 所述管理者通过操作所述补丁控制 节点指示所述代理获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代 理本地 MIB的步骤包括: 7. The method according to claim 6, wherein the step of the administrator instructing the agent to acquire a patch, parse the patch, and synchronizing the proxy local MIB according to the received patch by operating the patch control node includes:
所述管理者向所述代理发送一个或多个 SNMP消息请求,所述 SNMP消 息请求中包括所述补丁控制节点的 OID以及预设操作的操作类型标识, 所述 代理收到所述 SNMP协议消息后, 根据其中携带的操作类型标识执行相应的 动作, 完成获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本地 MIB的动作。 The administrator sends one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation type identifier of a preset operation, and the agent receives the SNMP protocol message. Then, performing the corresponding action according to the operation type identifier carried therein, completing the process of obtaining the patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
8、 如权利要求 5或 6或 7所述的方法, 其中, 所述代理根据所述补丁同 步所述代理本地 MIB的步骤包括: 8. The method according to claim 5 or 6 or 7, wherein the step of the agent synchronizing the proxy local MIB according to the patch comprises:
1 )所述代理从补丁中的注册表中选取一 OID作为当前同步的 OID; 1) the agent selects an OID from the registry in the patch as the currently synchronized OID;
18 2 )判断注册表中该 OID对应操作地址是否为空, 如果为空, 则将本地 MIB中的具有相同 OID的节点删除; 如果不为空, 则判断所述代理本地 MIB 中是否有相同 OID的节点, 如果有, 则按照该 OID对应的操作地址读取操作 代码目标文件,获取更新内容, 同步所述代理本地 MIB中的具有相同 OID的 节点, 如果没有, 则以该 OID在所述代理本地 MIB中注册一新节点, 根据从 操作代码目标文件中读取的更新内容, 同步新节点对应的操作; 18 2) determining whether the OID corresponding operation address in the registry is empty, if it is empty, deleting the node with the same OID in the local MIB; if not, determining whether the proxy local MIB has the same OID a node, if yes, reading an operation code object file according to an operation address corresponding to the OID, obtaining an update content, synchronizing a node having the same OID in the proxy local MIB, and if not, using the OID locally at the proxy Registering a new node in the MIB, synchronizing the operation corresponding to the new node according to the updated content read from the operation code object file;
3 )从补丁中的注册表中再选取一未同步过的 OID作为当前同步的 OID, 执行上述步骤 2 ) ; 3) Select an unsynchronized OID from the registry in the patch as the currently synchronized OID, and perform the above steps 2);
重复执行上述步骤 2 )和步骤 3 )直到注册表中的 OID全部同步完毕。 9、 如权利要求 6或 7所述的方法, 其中, Repeat steps 2) and 3) above until the OIDs in the registry are all synchronized. 9. The method according to claim 6 or 7, wherein
所述预设补丁控制节点对应的操作用于指示代理执行的动作的步骤包 括: 预设所述补丁控制节点对应的第一操作用于指示代理获取补丁, 第二操 作用于指示代理解析补丁, 第三操作用于指示代理根据补丁同步本地 MIB; 所述管理者通过操作所述补丁控制节点指示所述代理获取补丁、 解析补 丁, 以及根据接收到的补丁同步所述代理本地 MIB的步骤包括: The step of the operation corresponding to the preset patch control node for indicating the action performed by the agent includes: presetting that the first operation corresponding to the patch control node is used to instruct the agent to obtain the patch, and the second operation is used to instruct the agent to parse the patch. The third operation is used to indicate that the agent synchronizes the local MIB according to the patch; the step of the administrator instructing the agent to acquire the patch, parse the patch, and synchronize the proxy local MIB according to the received patch by operating the patch control node includes:
当所述管理者指示所述代理获取补丁时, 所述管理者向所述代理发送的 SNMP消息请求中包括所述补丁控制节点的 OID、 第一操作的操作类型标识 以及补丁内容; 当所述管理者指示所述代理解析补丁时, 所述管理者向所述 代理发送的 SNMP消息请求中包括所述补丁控制节点的 OID以及第二操作的 操作类型标识; 当所述管理者指示所述代理根据接收到的补丁同步所述代理 本地 MIB时,所述管理者向所述代理发送的 SNMP消息请求中包括所述补丁 控制节点的 OID 以及第三操作的操作类型标识; 所述代理根据接收到的 SNMP消息请求携带的内容执行相应的动作; 或者 When the manager instructs the agent to obtain a patch, the SNMP message request sent by the manager to the agent includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content; When the administrator instructs the agent to parse the patch, the SNMP message request sent by the manager to the agent includes an OID of the patch control node and an operation type identifier of the second operation; when the manager indicates the agent When the proxy local MIB is synchronized according to the received patch, the SNMP message request sent by the administrator to the proxy includes an OID of the patch control node and an operation type identifier of the third operation; the proxy receives the The content carried by the SNMP message request performs the corresponding action; or
当所述管理者指示所述代理获取补丁时, 所述管理者向所述代理发送的 SNMP消息请求中包括所述补丁控制节点的 OID、 第一操作的操作类型标识 以及补丁内容; 当所述管理者指示所述代理解析补丁和根据接收到的补丁同 步所述代理本地 MIB时,所述管理者向代理发送的 SNMP消息请求中包括所 述补丁控制节点的 OID以及第二操作的操作类型标识; 所述代理根据接收到 When the manager instructs the agent to obtain a patch, the SNMP message request sent by the manager to the agent includes an OID of the patch control node, an operation type identifier of the first operation, and a patch content; When the administrator instructs the agent to parse the patch and synchronize the proxy local MIB according to the received patch, the SNMP message request sent by the administrator to the proxy includes the OID of the patch control node and the operation type identifier of the second operation. The agent is received according to
19 的 SNMP消息请求携带的内容执行相应的动作。 19 The content carried by the SNMP message request performs the corresponding action.
10、 一种简单管理协议(SNMP )代理上管理信息库(MIB )升级系统, 包括管理者和代理, 其中: 10. A Simple Management Protocol (SNMP) agent management information base (MIB) upgrade system, including managers and agents, where:
所述管理者设置为: 在启动升级后, 遍历操作所述管理者本地 MIB所有 节点, 向所述代理发送请求; 以及根据所述代理上 "^的差别确定需要同步的 节点, 构造相应补丁并将所述补丁下发到所述代理; The administrator is configured to: after starting the upgrade, traverse all nodes of the manager local MIB, send a request to the proxy; and determine a node that needs to be synchronized according to the difference of the proxy, construct a corresponding patch and Delivering the patch to the agent;
所述代理设置为: 根据接收到的请求判断出所述管理者上的 MIB与所述 代理本地 MIB有差别, 则将所述差别上报给所述管理者; 以及根据接收到的 补丁同步所述代理本地 MIB。 The proxy is configured to: determine, according to the received request, that the MIB on the manager is different from the proxy local MIB, report the difference to the administrator; and synchronize the received patch according to the received Proxy local MIB.
11、 如权利要求 10所述的系统, 其中, 11. The system of claim 10, wherein
所述管理者包括: 第一 MIB单元、 发送单元和补丁构造单元, The manager includes: a first MIB unit, a sending unit, and a patch construction unit,
所述第一 MIB单元设置为: 在所述管理者 MIB中选择任一节点作为补 丁控制节点, 所述补丁控制节点对应多个操作, 预设所述操作用于指示代理 执行以下一个或多个动作: 判断管理者上的 MIB与所述代理本地 MIB的差 另 获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本地 MIB; The first MIB unit is configured to: select any node in the manager MIB as a patch control node, where the patch control node corresponds to multiple operations, and preset the operation to instruct the agent to perform one or more of the following Action: determining a difference between the MIB on the manager and the proxy local MIB, acquiring a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch;
所述发送单元设置为: 在启动升级后, 遍历操作所述管理者 MIB的所有 节点, 向所述代理发送请求; 以及基于所述补丁构造单元的触发将所述补丁 下发到所述代理; The sending unit is configured to: after starting the upgrade, traverse all the nodes of the manager MIB, send a request to the agent; and deliver the patch to the agent based on the trigger of the patch construction unit;
所述补丁构造单元设置为: 在接收到所述代理上报的 MIB差别后, 根据 所述差别确定需要同步的节点, 构造相应补丁, 并触发所述发送单元; The patch construction unit is configured to: after receiving the MIB difference reported by the proxy, determine a node that needs to be synchronized according to the difference, construct a corresponding patch, and trigger the sending unit;
所述代理包括第二 MIB单元、 差别判断单元、 上 ^艮单元和同步单元, 所述第二 MIB单元设置为: 在所述代理 MIB中选择任一节点作为补丁 控制节点, 所述代理 MIB中的补丁控制节点的对象标识符(OID )与所述管 理者 MIB中的补丁控制节点的 OID相同,所述节点对应多个操作,预设所述 操作用于执行以下一个或多个动作: 判断管理者上的 MIB 与所述代理本地 MIB的差别、 获取补丁、 解析补丁, 以及根据接收到的补丁同步所述代理本 地 MIB; The proxy includes a second MIB unit, a difference judging unit, an upper unit, and a synchronization unit, where the second MIB unit is configured to: select any node in the proxy MIB as a patch control node, where the proxy MIB is The object identifier (OID) of the patch control node is the same as the OID of the patch control node in the manager MIB, and the node corresponds to a plurality of operations, and the operation is preset to perform one or more of the following actions: The difference between the MIB of the manager and the proxy local MIB, obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch;
所述差别判断单元设置为: 在接收到所述管理者的发送单元发送的请求 The difference judging unit is configured to: receive a request sent by the sending unit of the manager
20 后, 根据所述请求判断出管理者上的 MIB与所述代理本地 MIB有差别, 则 收集差别并触发上 单元; 20 After determining, according to the request, the MIB on the manager is different from the proxy local MIB, collecting the difference and triggering the upper unit;
所述上报单元设置为: 基于所述差别判断单元的触发, 将所述差别上报 给所述管理者; The reporting unit is configured to: report the difference to the manager based on a trigger of the difference determining unit;
所述同步单元设置为: 在接收到所述管理者的发送单元发送的补丁后, 根据所述补丁同步所述代理本地 MIB。 The synchronization unit is configured to: after receiving the patch sent by the sending unit of the manager, synchronize the proxy local MIB according to the patch.
12、 如权利要求 11所述的系统, 其中, 12. The system of claim 11 wherein:
所述发送单元是设置为以如下方式向代理发送请求: 向代理发送一个或 多个 SNMP消息请求, 以将所述管理者本地 MIB中每个节点的 OID及其对 应的操作类型标识发送给所述代理; The sending unit is configured to send a request to the proxy in the following manner: Send one or more SNMP message requests to the proxy to send the OID of each node in the administrator local MIB and its corresponding operation type identifier to the Agent
所述差别判断单元是设置为: 基于该消息请求中携带的操作类型标识对 应的操作的触发, 以节点为单位, 判断并记录所述管理者 MIB 与所述代理 MIB的差别。 The difference judging unit is configured to: trigger the operation corresponding to the operation type identifier carried in the message request, and determine and record the difference between the manager MIB and the proxy MIB in units of nodes.
13、 如权利要求 11所述的系统, 其中, 所述补丁构造单元是设置为以如 下方式构造相应补丁: 13. The system according to claim 11, wherein the patch construction unit is configured to construct a corresponding patch in the following manner:
在确定需要同步的节点包括新增的节点和删除的节点时, 构造包括注册 表和与所述注册表关联的操作代码目标文件的补丁, 所述注册表中包括多个 待同步节点的 OID及其对应的 n个操作的地址, n > 0且 n为整数; 对于待删 除的节点, 该节点的 OID对应的操作的地址个数 η=0 , 即其对应的操作地址 为空; 对于待增加的节点, 该节点的 OID对应的操作的地址个数 n > 0, 且所 述操作的地址指向所述操作代码目标文件中的一块区域, 其中保存有更新的 操作的内容; 或者 When determining that the node that needs to be synchronized includes a new node and a deleted node, constructing a patch including a registry and an operation code object file associated with the registry, where the registry includes an OID of a plurality of nodes to be synchronized and The address of the corresponding n operations, n > 0 and n is an integer; for the node to be deleted, the number of addresses of the operation corresponding to the OID of the node is η=0, that is, the corresponding operation address is empty; Node, the number of addresses of the operation corresponding to the OID of the node n > 0, and the address of the operation points to an area in the operation code object file, where the content of the updated operation is saved; or
在确定需要同步的节点仅包括新增的节点时, 构造包括注册表和与所述 注册表关联的操作代码目标文件的补丁, 所述注册表中包括多个待同步节点 的 OID及其对应的 m个操作的地址, m > 0且 m为整数, 所述操作的地址指 向所述操作代码目标文件中的一块区域, 其中保存有更新的操作的内容; 或 者 When determining that the node that needs to be synchronized includes only the newly added node, constructing a patch including a registry and an operation code object file associated with the registry, the registry including the OIDs of the plurality of nodes to be synchronized and their corresponding The address of m operations, m > 0 and m is an integer, the address of the operation points to an area in the operation code object file, in which the content of the updated operation is saved; or
在确定需要同步的节点仅包括删除的节点时, 构造包括注册表的补丁, When determining that the node that needs to be synchronized includes only the deleted node, construct a patch including the registry.
21 所述注册表中包括多个待删除节点的 OID, 其对应的操作地址为空。 twenty one The registry includes multiple OIDs of the node to be deleted, and the corresponding operation address is empty.
14、 如权利要求 13所述的系统, 其中, 14. The system of claim 13 wherein
所述发送单元是设置为以如下方式向所述代理发送请求: 向所述代理发 送一个或多个 SNMP消息请求,所述 SNMP消息请求中包括所述补丁控制节 点的 OID以及预设操作的操作类型标识; The sending unit is configured to send a request to the proxy in a manner of: sending one or more SNMP message requests to the proxy, where the SNMP message request includes an OID of the patch control node and an operation of a preset operation Type identifier
所述同步单元是设置为收到所述 SNMP协议消息后, 根据其中携带的操作类 型标识执行以下动作: 获取补丁、 解析补丁, 以及根据接收到的补丁同步所 述代理本地 MIB。 The synchronization unit is configured to perform the following actions according to the operation type identifier carried in the SNMP protocol message: obtaining a patch, parsing the patch, and synchronizing the proxy local MIB according to the received patch.
22 twenty two
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010213090.4A CN102299814B (en) | 2010-06-24 | 2010-06-24 | Method and system for upgrading MIB (management information base) on SNMP (simple network management protocol) agent |
CN201010213090.4 | 2010-06-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011160497A1 true WO2011160497A1 (en) | 2011-12-29 |
Family
ID=45360001
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2011/073668 WO2011160497A1 (en) | 2010-06-24 | 2011-05-04 | Method and system for upgrading management information base on simple network management protocol (snmp) agent |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102299814B (en) |
WO (1) | WO2011160497A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104486344A (en) * | 2014-12-22 | 2015-04-01 | 上海斐讯数据通信技术有限公司 | User access system and method based on SNMP (simple network management protocol) |
CN105426505A (en) * | 2015-11-26 | 2016-03-23 | 上海斐讯数据通信技术有限公司 | Management information base document processing system and method |
CN107294749A (en) * | 2016-03-31 | 2017-10-24 | 北京优朋普乐科技有限公司 | A kind of system and method for updating management information bank MIB |
CN106709051B (en) * | 2017-01-06 | 2020-04-07 | 腾讯科技(深圳)有限公司 | Method, equipment and system for displaying comparison information |
CN108958758A (en) * | 2017-05-23 | 2018-12-07 | 大唐移动通信设备有限公司 | A kind of management information bank MIB data managing method and device |
CN110018835B (en) * | 2018-01-09 | 2022-08-02 | 中兴通讯股份有限公司 | YANG model configuration data processing method and device, terminal device and storage medium |
CN110034943B (en) * | 2018-01-12 | 2020-12-04 | 大唐移动通信设备有限公司 | Method and device for deleting Management Information Base (MIB) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005069544A1 (en) * | 2004-01-15 | 2005-07-28 | Utstarcom Korea Limited | Automatic update system and method for using a meta mib |
CN101242302A (en) * | 2008-03-12 | 2008-08-13 | 华为技术有限公司 | Data synchronization method, device and system |
CN101729286A (en) * | 2008-10-21 | 2010-06-09 | 大唐移动通信设备有限公司 | Method, device and system for modifying variables in management information base of agent terminal |
CN101753351A (en) * | 2008-12-11 | 2010-06-23 | 大唐移动通信设备有限公司 | Method for extending and de-extending management information base, method and equipment for searching management object |
-
2010
- 2010-06-24 CN CN201010213090.4A patent/CN102299814B/en not_active Expired - Fee Related
-
2011
- 2011-05-04 WO PCT/CN2011/073668 patent/WO2011160497A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005069544A1 (en) * | 2004-01-15 | 2005-07-28 | Utstarcom Korea Limited | Automatic update system and method for using a meta mib |
CN101242302A (en) * | 2008-03-12 | 2008-08-13 | 华为技术有限公司 | Data synchronization method, device and system |
CN101729286A (en) * | 2008-10-21 | 2010-06-09 | 大唐移动通信设备有限公司 | Method, device and system for modifying variables in management information base of agent terminal |
CN101753351A (en) * | 2008-12-11 | 2010-06-23 | 大唐移动通信设备有限公司 | Method for extending and de-extending management information base, method and equipment for searching management object |
Also Published As
Publication number | Publication date |
---|---|
CN102299814A (en) | 2011-12-28 |
CN102299814B (en) | 2014-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011160497A1 (en) | Method and system for upgrading management information base on simple network management protocol (snmp) agent | |
EP3664370B1 (en) | Network function information management method and related device | |
US9246781B2 (en) | Method, terminal, apparatus, and system for device management | |
KR100620054B1 (en) | System and method of managing device for device managing technology | |
JP4940353B2 (en) | Policy and charging rule function control method, control network element, network system | |
US7974211B2 (en) | Methods and apparatus for network configuration baselining and restoration | |
US20130144989A1 (en) | Unified device management method and system | |
WO2007085178A1 (en) | A device management method of communication terminal and a communication terminal and system thereof | |
JP5074567B2 (en) | Method for operation of a management network of a communication network | |
WO2011091646A1 (en) | Method, server and domain name system for realizing synchronization of the domain name system zone creation | |
CN103747535A (en) | Method, apparatus and system for recovering CAPWAP control channel | |
WO2006122477A1 (en) | A method for upward-transferring terminal information as well as method and system for maintaining terminal device | |
CN109166352B (en) | Cloud parking lot management system | |
CN101827455B (en) | Method for automatically establishing link connection, device and base station | |
JP4480702B2 (en) | Communication method, communication system, router and program thereof | |
WO2010124571A1 (en) | Node information acquirement method, client, and server | |
CN102571390B (en) | Equipment management method, equipment and system | |
WO2013017020A1 (en) | Method and system for operating executable node | |
EP3837808B1 (en) | Management model for network equipment performance measurements | |
Cisco | 8.4.10 Version Software Release Notes Cisco StrataView Plus for AIX Release Notes | |
EP1936865B1 (en) | A method, a system and an apparatus for synchronizing the stream between the bearer control layer and bearer layer devices | |
KR100452629B1 (en) | Apparatus and Method of Network Management by Upgrading Simple Network Management Protocol Management information Base Bundle Dynamically | |
JP4882942B2 (en) | Management information providing apparatus, node, and management information providing program | |
KR101346480B1 (en) | Method and system for integrally managing wired and wireless devices | |
JP5095831B6 (en) | Device management method, terminal, apparatus and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 11797528 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 11797528 Country of ref document: EP Kind code of ref document: A1 |