CN103152195A - Data collection method and device - Google Patents

Data collection method and device Download PDF

Info

Publication number
CN103152195A
CN103152195A CN2013100489085A CN201310048908A CN103152195A CN 103152195 A CN103152195 A CN 103152195A CN 2013100489085 A CN2013100489085 A CN 2013100489085A CN 201310048908 A CN201310048908 A CN 201310048908A CN 103152195 A CN103152195 A CN 103152195A
Authority
CN
China
Prior art keywords
hardware data
service
snmp
acquired
telnet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013100489085A
Other languages
Chinese (zh)
Other versions
CN103152195B (en
Inventor
陈旭
邓召基
侯磊
刘须华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201310048908.5A priority Critical patent/CN103152195B/en
Publication of CN103152195A publication Critical patent/CN103152195A/en
Application granted granted Critical
Publication of CN103152195B publication Critical patent/CN103152195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a data collection method and device. The data collection method comprises the following steps of determining an access level of hardware data to be collected according to a hardware data collection request, wherein the access level of the hardware data comprises simple network management protocol (SNMP) access, telnet access and accessibility of SNMP and telnet; log in a device in which the hardware data to be collected is stored through a telnet service if the access level of the hardware data to be collected is SNMP access, and starting SNMP service on the device through the telnet service; collecting and returning the hardware data to be collected through the SNMP service; and closing the SNMP service on the device through the telnet service after the hardware data to be collected is returned through the SNMP service. Through the data collection method and device, the SNMP service is controlled through the telnet service, so that the expenditure caused by the SNMP service can be saved.

Description

Data acquisition method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data acquisition method and apparatus.
Background
With the continuous expansion of wireless networks, normal network operation is inseparable from normal work and life of people, and in a huge network body, a server becomes a critical healthy node. If an OMC (Operations & Maintenance Center) server crashes or runs abnormally, a catastrophic result is often brought to the management of a radio network controller and a base station; in addition, the low operation efficiency of the server brings difficulty and trouble to normal application, and finally affects the normal operation of the network. Therefore, maintenance personnel are required to clarify hardware data of the server in real time, such as hardware basic data and state information, so as to eliminate hidden dangers in time, solve problems in advance and ensure normal operation of the server and the network.
Due to the numerous and remote servers, remote access by operation and maintenance personnel is often required. At present, operation and maintenance personnel mostly acquire data through an SNMP (Simple Network Management Protocol) proxy mode or a TELNET access mode to perform operation, maintenance and Management.
In the SNMP agent mode, the SNMP agent presents the management data by variables. The SNMP management system retrieves the required hardware data from the equipment with the SNMP agent through GET, GETNEXT and GETBLK protocol commands; alternatively, the server SNMP agent uses TRAP or INFORM commands to transfer relevant hardware data without being queried.
The TELNET access mode mainly comprises the following 4 processes: (1) establishing a connection with a remote host locally, which is actually establishing a TCP connection, the user must know the IP address or domain name of the remote host; (2) transmitting the user name and password input on the local Terminal and any command or character input later to the remote host in NVT (network Virtual Terminal) format to collect corresponding hardware data and the like, wherein the process is actually to send an IP data packet from the local host to the remote host; (3) converting hardware data in NVT format output by the remote host into format accepted locally and sending the format back to the local terminal, wherein the format comprises input command playback and command execution results; (4) finally, the local terminal cancels the connection of the remote host, and the process is to cancel a TCP connection.
However, there is a problem in either of the above two methods. One problem is that both of the two modes can only collect partial hardware data, but cannot obtain complete hardware data, the returned result is limited, and the indexes which are crucial to collecting hardware equipment information may not be collected, for example, the TELNET remote login access mode cannot collect the CPU temperature of the hardware, the SNMP agent mode cannot complete a single query command or return of multiple data information of a data collection command, and the like. Another problem is that in the SNMP agent approach, if the SNMP service of the server is not opened, the manager cannot perform query maintenance; however, if the SNMP services are running all the time and many times these SNMP services are unnecessary, it will bring extra overhead to the server.
Disclosure of Invention
The invention provides a data acquisition method and a data acquisition device, which are used for solving at least one of the problems.
In order to solve the above problems, the present invention discloses a data acquisition method, comprising: determining the access level of the hardware data to be acquired according to the hardware data acquisition request, wherein the access level of the hardware data comprises: SNMP access, TELNET access, and both SNMP and TELNET access; if the access level of the hardware data to be acquired is the SNMP access, logging in equipment where the hardware data to be acquired is located through a TELNET service, and starting an SNMP service on the equipment through the TELNET service; the SNMP service collects and returns the hardware data to be collected; and after the SNMP service returns the hardware data to be collected, the SNMP service on the equipment is closed through the TELNET service.
Preferably, the data acquisition method further comprises: if the access level of the hardware data to be acquired is the TELNET access, logging in the equipment where the hardware data to be acquired is located through the TELNET service, and acquiring and returning the hardware data to be acquired by the TELNET service; if the access level of the hardware data to be acquired is that both the SNMP and the TELNET can be accessed, logging in equipment where the hardware data to be acquired is located through the TELNET service, and judging whether an SNMP service request for acquiring the hardware data to be acquired is received or not; if not, acquiring and returning the hardware data to be acquired by the TELNET service; if the hardware data is received, the SNMP service on the equipment is started through the TELNET service, the hardware data to be acquired is acquired and returned by the SNMP service, and the SNMP service on the equipment is closed through the TELNET service after the hardware data to be acquired is returned by the SNMP service.
Preferably, when the access level of the hardware data to be collected is the SNMP access, or when the access level of the hardware data to be collected is both the SNMP access and the TELNET access, and the TELNET service receives an SNMP service request for collecting the hardware data to be collected, the step of collecting and returning the hardware data to be collected by the SNMP service includes: carrying out Management Information Base (MIB) variable mapping of the SNMP service according to the hardware data to be collected; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is already operated; if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if the SNMP service is not operated, the SNMP service is operated through the TELNET service; and acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data.
Preferably, the data acquisition method further comprises: MIB variable mapping is carried out on the hardware data acquired by the SNMP service, and the hardware data subjected to the MIB variable mapping is converted into hardware data conforming to a set format; and/or performing character string extraction processing on the hardware data acquired by the TELNET service, and converting the hardware data subjected to the character string extraction processing into hardware data conforming to the set format.
Preferably, before the step of determining the access level of the hardware data to be collected according to the hardware data collection request, the method further includes: and setting the access level of the hardware data according to whether the hardware data receives the SNMP service and/or TELNET service access.
Preferably, when the access level of the hardware data to be acquired is the SNMP access, before the step of logging in the device where the hardware data to be acquired is located through the TELNET service and starting the SNMP service on the device through the TELNET service, the method further includes: carrying out Management Information Base (MIB) variable mapping of the SNMP service according to the hardware data to be collected; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; and determining that the SNMP service is closed according to a return result of the value taking command.
In order to solve the above problem, the present invention also discloses a data acquisition device, comprising: a determining module, configured to determine, according to a hardware data acquisition request, an access level of hardware data to be acquired, where the access level of the hardware data includes: SNMP access, TELNET access, and both SNMP and TELNET access; the first execution module is used for logging in equipment where the hardware data to be acquired is located through a TELNET service and starting an SNMP service on the equipment through the TELNET service if the access level of the hardware data to be acquired is the SNMP access; the SNMP service collects and returns the hardware data to be collected; and after the SNMP service returns the hardware data to be collected, the SNMP service on the equipment is closed through the TELNET service.
Preferably, the data acquisition device further comprises: a second execution module, configured to log in, through the TELNET service, the device where the hardware data to be acquired is located if the access level of the hardware data to be acquired is the TELNET access, and acquire and return the hardware data to be acquired by the TELNET service; a third execution module, configured to log in, through the TELNET service, the device where the hardware data to be acquired is located if the access level of the hardware data to be acquired is both accessible to the SNMP and TELNET, and determine whether an SNMP service request for acquiring the hardware data to be acquired is received; if not, acquiring and returning the hardware data to be acquired by the TELNET service; if the hardware data is received, the SNMP service on the equipment is started through the TELNET service, the hardware data to be acquired is acquired and returned by the SNMP service, and the SNMP service on the equipment is closed through the TELNET service after the hardware data to be acquired is returned by the SNMP service.
Preferably, when the access level of the hardware data to be acquired is the SNMP access and the first execution module acquires and returns the hardware data to be acquired by the SNMP service, mapping MIB variables in a management information database of the SNMP service according to the hardware data to be acquired; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is already operated; if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if the SNMP service is not operated, the SNMP service is operated through the TELNET service; acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data; or, when the access level of the hardware data to be acquired is both accessible to the SNMP and the TELNET, and the TELNET service receives an SNMP service request for acquiring the hardware data to be acquired, the third execution module performs MIB variable mapping on a management information database of the SNMP service according to the hardware data to be acquired when the hardware data to be acquired is acquired and returned by the SNMP service; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is already operated; if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if the SNMP service is not operated, the SNMP service is operated through the TELNET service; and acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data.
Preferably, the data acquisition device further comprises: and the setting module is used for setting the access level of the hardware data according to whether the hardware data receives the SNMP service and/or TELNET service access or not before the determining module determines the access level of the hardware data to be acquired according to the hardware data acquisition request.
Compared with the prior art, the invention has the following advantages:
in the invention, the hardware data which can be collected all have access levels, and the access levels are used for identifying which mode the hardware data can be collected. For example, when the access level is SNMP access, it indicates that it can only be collected by the SNMP service; when the access level is TELNET (remote login) access, the fact that only TELNET service acquisition can be carried out is indicated; when the access level is that both SNMP and TELNET can be accessed, the hardware data can be collected no matter SNMP service or TELNET service is used. When hardware data acquisition is needed, different service acquisition can be adopted according to the access level. Particularly, when the access level of the hardware data is SNMP access, firstly, equipment where the hardware data to be acquired is located is logged and connected through a TELNET service, then an SNMP service on the equipment is started, further, hardware data acquisition is carried out through the SNMP service, and the SNMP service on the equipment is still closed through the TELNET service after the hardware data are acquired. By the invention, hardware data of any access level can be collected. More importantly, the SNMP service is controlled through the TELNET service, so that on one hand, the SNMP service can be conveniently and timely opened when the SNMP service is required to collect data; on the other hand, when the SNMP service is not needed, the SNMP service can be closed, so that the expenditure caused by the SNMP service is saved.
Drawings
FIG. 1 is a flow chart illustrating steps of a data collection method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of the steps of a data acquisition method according to a second embodiment of the invention;
FIG. 3 is a flow chart of the steps of a data acquisition method according to a third embodiment of the present invention;
fig. 4 is a block diagram of a data acquisition apparatus according to a fourth embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Example one
Referring to fig. 1, a flowchart illustrating steps of a data acquisition method according to a first embodiment of the present invention is shown.
The data acquisition method of the embodiment comprises the following steps:
step S102: and determining the access level of the hardware data to be acquired according to the hardware data acquisition request.
Wherein, the access level of the hardware data comprises: SNMP access, TELNET access, and both SNMP and TELNET access.
When the access level is SNMP access, the hardware data can be collected only through SNMP service; when the access level is TELNET access, the hardware data can be acquired only through TELNET service; when the access level is both SNMP and TELNET accessible, the hardware data can be acquired through SNMP service or TELNET service.
Step S104: and if the access level of the hardware data to be collected is SNMP access, performing steps S106-S110.
Step S106: logging in the equipment where the hardware data to be acquired is located through the TELNET service, and starting the SNMP service on the equipment through the TELNET service.
In this embodiment, the SNMP on the device where the hardware data to be acquired is set to be in the off state when not needed, so as to save the overhead and the loss of the device. The start and the stop of the SNMP service are controlled by the TELNET service, so when the hardware data can only be collected by the SNMP service, the hardware data still can be logged in through the TELNET service connection, then the SNMP service is started by the TELNET service, and the hardware data is collected by the SNMP service.
Step S108: and the SNMP service collects and returns the hardware data to be collected.
The hardware data collection of the SNMP service can be implemented by referring to a related process, for example, sending a SET (value) command after mapping through an MIB (management information database) variable, and the like, which is not described herein again.
Step S110: and after the SNMP service returns the hardware data to be acquired, the SNMP service on the equipment is closed through the TELNET service.
After the hardware data is collected, the SNMP service can be temporarily stopped so as to save equipment overhead and loss. In addition, some hidden vulnerabilities may exist on the network, and running the SNMP service all the time may become a target for running a vulnerability attack, which causes a potential safety hazard of the server. And when the SNMP service is not needed, the SNMP service is closed, so that the attacks and hidden dangers can be effectively avoided.
In this embodiment, all the hardware data that can be collected have an access level, and by means of the access level, which manner the hardware data can be collected is identified. When hardware data acquisition is needed, different service acquisition can be adopted according to the access level. Particularly, when the access level of the hardware data is SNMP access, firstly, equipment where the hardware data to be acquired is located is logged and connected through a TELNET service, then an SNMP service on the equipment is started, further, hardware data acquisition is carried out through the SNMP service, and the SNMP service on the equipment is still closed through the TELNET service after the hardware data are acquired. With the present embodiment, hardware data can be collected at whatever access level. More importantly, the SNMP service is controlled through the TELNET service, so that on one hand, the SNMP service can be conveniently and timely opened when the SNMP service is required to collect data; on the other hand, when the SNMP service is not needed, the SNMP service can be closed, so that the expenditure caused by the SNMP service is saved; on the other hand, vulnerability attack can be effectively avoided, and equipment safety is guaranteed.
Example two
Referring to fig. 2, a flowchart illustrating steps of a data acquisition method according to a second embodiment of the present invention is shown.
The data acquisition method of the embodiment comprises the following steps:
step S202: and setting the access level of the hardware data according to whether the hardware data is accessed by SNMP service and/or TELNET service.
That is, the access level of the hardware data is set according to whether the hardware data can be collected by which service, and the set access level includes: SNMP access, TELNET access, SNMP and TELNET are all accessible.
Step S204: determining the access level of the hardware data to be acquired according to the hardware data acquisition request, and if the access level is SNMP access, executing the step S206; if the TELNET access is performed, step S214 is executed; if both SNMP and TELNET are accessible, step S216 is executed.
Step S206: carrying out management information database (MIB) variable mapping of the SNMP service according to hardware data to be collected; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; and determining that the SNMP service is closed according to a return result of the value taking command.
When the SNMP service management terminal determines that the SNMP service is needed to collect hardware data, the related instruction of the SNMP service is generated and sent to the SNMP service terminal provided with the SNMP agent so as to determine whether the SNMP service on the service terminal is in a closed state or not, and if the SNMP service is in an operating state currently, the SNMP service can be directly used for collecting data; in general, when the SNMP service is in a closed state, subsequent steps are required to be executed, the TELNET service is used to start the SNMP service, and then data is acquired.
Step S208: logging in the equipment where the hardware data to be acquired is located through the TELNET service, and starting the SNMP service on the equipment through the TELNET service.
Step S210: and the SNMP service started by the TELNET service collects and returns the hardware data to be collected.
The method comprises the following steps: MIB (management information database) variable mapping of SNMP service is carried out according to hardware data to be collected; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is operated; if the hardware data is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if not, operating the SNMP service through the TELNET service; and acquiring hardware data to be acquired according to the value-taking command and returning the hardware data.
Step S212: after the SNMP service returns the hardware data to be collected, the SNMP service on the device is turned off through the TELNET service, and step S222 is executed.
Step S214: if the access level of the hardware data to be acquired is TELNET access, the device where the hardware data to be acquired is located is logged in through the TELNET service, the hardware data to be acquired is acquired and returned by the TELNET service, and step S222 is executed.
The specific process of acquiring hardware data through the TELNET service may be implemented with reference to a related flow, and is not described herein again.
Step S216: if the access level of the hardware data to be acquired is both SNMP and TELNET accessible, logging in the equipment where the hardware data to be acquired is located through TELNET service, and judging whether an SNMP service request for acquiring the hardware data to be acquired is received; if not, go to step S218; if yes, go to step S220.
Step S218: if the SNMP service request for acquiring the hardware data to be acquired is not received, the TELNET service acquires and returns the hardware data to be acquired, and step S222 is executed.
Step S220: receiving an SNMP service request for acquiring hardware data to be acquired, starting an SNMP service on the device through the TELNET service, acquiring and returning the hardware data to be acquired by the SNMP service, and after the SNMP service returns the hardware data to be acquired, closing the SNMP service on the device through the TELNET service, and executing step S222.
The step of collecting and returning the hardware data to be collected by the SNMP service comprises the following steps: MIB (management information database) variable mapping of SNMP service is carried out according to hardware data to be collected; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is operated; if the hardware data is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if not, operating the SNMP service through the TELNET service; and acquiring hardware data to be acquired according to the value-taking command and returning the hardware data.
Step S222: MIB variable mapping is carried out on hardware data acquired by SNMP service, and the hardware data subjected to MIB variable mapping is converted into hardware data conforming to a set format; and/or performing character string extraction processing on the hardware data acquired by the TELNET service, and converting the hardware data subjected to the character string extraction processing into hardware data conforming to a set format.
The collected hardware data needs to be processed into a uniform format for subsequent processing, and the uniform format can be preset by those skilled in the art according to actual requirements.
In one hardware data acquisition, it is possible to acquire data using only one service, or it is possible to acquire data using two services. If only one service is used, only the data collected by the service can be processed, if only the SNMP service is used, MIB variable mapping can be carried out on the hardware data collected by the SNMP service, and the hardware data subjected to MIB variable mapping is converted into the hardware data conforming to the set format; if only the TELNET service is used, the hardware data acquired by the TELNET service can be subjected to character string extraction processing, and the hardware data subjected to the character string extraction processing is converted into hardware data conforming to a set format. When both the TELNET service and the SNMP service are used, MIB variable mapping is required to be performed on hardware data acquired by the SNMP service, and the hardware data subjected to MIB variable mapping is converted into hardware data conforming to a set format; it is also necessary to perform a string extraction process (e.g., remove redundant content in a string, extract required string content, etc.) on the hardware data acquired by the TELNET service, and convert the hardware data after the string extraction process into hardware data conforming to a set format.
With the embodiment, different services are used for acquisition and processing according to the access level of the hardware data to be acquired. But whatever level the hardware data belongs to, its acquisition needs to be logged and controlled by the TELNET service. According to the embodiment, by means of remote cross complementary data acquisition of SNMP and TELNET, effective access of a management end and a service end can be opened in a cross mode, basic data and state information of equipment are acquired to the maximum extent, and data are displayed to maintainers in a step-level mode in detail in a staged mode, so that the automation rate of OMC remote maintenance and the accuracy of problem diagnosis are improved, time is effectively saved, maintenance cost is reduced, working efficiency is improved, and network safety is guaranteed.
EXAMPLE III
Referring to fig. 3, a flowchart of steps of a data acquisition method according to a third embodiment of the present invention is shown.
The data acquisition method of the embodiment comprises the following steps:
step S302: an access level of the hardware data is determined.
The hardware data which can be collected is classified and graded, and the access level is divided according to whether the hardware data can be accessed by TELNET service or not and whether the hardware data can be accessed by SNMP service or not, so that the subsequent inquiry is facilitated. After classification and classification, the access level of the hardware data comprises: accessible only by SNMP services, accessible only by TELNET services, accessible by SNMP services or TELNET.
It should be noted that for hardware data without SNMP level (i.e. hardware data accessible only by TELNET service), the SNMP service will not be started.
Step S304: receiving a hardware data acquisition request, judging whether the hardware data to be acquired can be acquired by TELNET service according to the access level of the hardware data to be acquired, and executing step S306 if the hardware data to be acquired can not be acquired by the TELNET service; if the TELNET service can be acquired, step S332 is executed.
Step S306: and carrying out MIB variable mapping of the SNMP service according to the hardware data to be collected.
Step S308: and sending a value taking command of the SNMP service to the equipment where the hardware data to be acquired is located.
Step S310: judging whether the SNMP service is operated currently, if so, executing step S312; if not, go to step S320.
Step S312: if the SNMP service is currently operated, the server-side equipment receives the value-taking command of the SNMP service, processes the value-taking command of the SNMP service, and returns the processing result carried in the SNMP message.
If the SNMP service is operated, the SNMP service is processed according to a value-taking command such as an SET command, corresponding hardware data is collected, and then the collected hardware data is carried in an SNMP message and returned to a request terminal requesting the hardware data.
Step S314: MIB variable processing is mapped to the hardware data in the returned SNMP message, and step S316 is executed.
Step S316: and converting the processed hardware data into hardware data conforming to a set format, and returning data statistics.
Step S318: and requesting the TELNET service to close the SNMP service on the device where the collected hardware data is located.
Step S320: and displaying a data acquisition result and finishing the data acquisition process.
It should be noted that, the execution of step S318 and step S320 may not be in a sequential order, or may be executed in parallel.
Step S322: and if the SNMP service is not operated currently, requesting the TELNET service to open the SNMP service on the equipment where the hardware data to be acquired is located.
Step S324: judging whether a request of the SNMP service is received, if not, executing the step S326; if yes, go to step S330.
Step S326: and sending a value taking command of the TELNET service to the server side equipment where the hardware data is located.
Step S328: the server device processes the value taking command of the TELNET service, returns a message carrying a processing result, and directly executes step S320 after step S316.
Namely, hardware data are collected according to the value taking command of the TELNET service, and the collected hardware data are carried in the return message and returned.
Step S330: if the request of the SNMP service is received, the TELNET service remotely starts the SNMP service, and the step S308 is skipped to and executed.
Step S332: if the hardware data to be acquired can be acquired by the TELNET service, the TELNET service is used to log in the server device where the hardware data to be acquired is located, and step S324 is skipped to start execution.
In this embodiment, the data acquisition and access flow of the TELNET service may log in, send a command, receive a return message, and send the result to a corresponding processing device, such as a data acquisition center, according to the original process. Meanwhile, the TELNET service in this embodiment also needs to remotely start the SNMP service and remotely close the SNMP service when necessary.
The data acquisition and access process of the SNMP service in this embodiment needs to be controlled by the TELNET service in the whole process, and after the access level of the hardware data to be acquired is determined, the hardware data of the SNMP service access level can SET and acquire the hardware data of the server through SET and GET commands of the SNMP service. However, in many cases, the SNMP service is turned off, and for safer management, the SNMP service is preferably turned off, where the SNMP access is suspended, and requests the TELNET service to remotely start the SNMP service, and then the SET and GET command operations are resumed, and after the operations are successful, the data is pushed to the corresponding processing device, such as the data collection center, and the SNMP service is turned off. And if the SNMP service does not exist, stopping the processing process of the SNMP service, and only carrying out TELNET access.
For any kind of hardware data collected by the service, data statistics, summary display, storage and other processing are required. And after the two service acquisition processes reach the management terminal, processing the acquired hardware data, wherein an MIB table is mapped to an SNMP message, a character string is processed to a TELNET return message, and the MIB table and the TELNET return message are uniformly processed into the same form and then displayed and stored.
Through this embodiment, (1) parallel collection, raise the efficiency have been realized. The acquisition is carried out in parallel by two modes of SNMP service and TELNET service, so that the efficiency can be improved by two times when multiple tasks are originally inquired and acquired in a single mode, and the cost and the time can be greatly reduced for the inquiry, acquisition and maintenance of a centralized server; (2) the data are complementary, and the information is comprehensive. The data returned by the TELNET service is hashed and contains more redundant information; the data returned by the SNMP service is targeted, for example, the TELNET service can access the general situation of a CPU, and the CPUU temperature can be deeply inquired through the SNMP service, so that the most comprehensive hardware state information can be provided to the operation and maintenance personnel to the maximum extent; (3) and cross control is performed, so that the comprehensive control of the SNMP service is ensured, and the safety of the SNMP service is improved. In the embodiment, for hardware data acquired by the SNMP service, the TELNET service remotely opens the SNMP service before starting to access, so that normal access of the SNMP service is ensured. The phenomenon that the SNMP service can not be interacted by singly using the SNMP service is avoided under the condition that the SNMP service is not opened. After the access is finished, the TELNET service closes the SNMP service, so that unnecessary expenditure of a service end where hardware data are located is saved, and risks caused by the SNMP service are avoided.
Example four
Referring to fig. 4, a block diagram of a data acquisition apparatus according to a fourth embodiment of the present invention is shown.
The data acquisition device of this embodiment includes: a determining module 402, configured to determine, according to the hardware data acquisition request, an access level of the hardware data to be acquired, where the access level of the hardware data includes: SNMP access, TELNET access, and both SNMP and TELNET access; a first executing module 404, configured to log in, through a TELNET service, an apparatus where the hardware data to be acquired is located if an access level of the hardware data to be acquired is SNMP access, and start an SNMP service on the apparatus through the TELNET service; the SNMP service collects and returns the hardware data to be collected; and after the SNMP service returns the hardware data to be collected, the SNMP service on the equipment is closed through the TELNET service.
Preferably, the data acquisition apparatus of the present embodiment further includes: the second execution module 406 is configured to, if the access level of the hardware data to be acquired is TELNET access, log in the device where the hardware data to be acquired is located through a TELNET service, and acquire and return the hardware data to be acquired by the TELNET service.
Preferably, the data acquisition apparatus of the present embodiment further includes: a third executing module 408, configured to log in, through a TELNET service, a device where the hardware data to be acquired is located if the access level of the hardware data to be acquired is both SNMP and TELNET accessible, and determine whether an SNMP service request for acquiring the hardware data to be acquired is received; if not, acquiring and returning hardware data to be acquired by the TELNET service; and if the hardware data is received, starting the SNMP service on the equipment through the TELNET service, acquiring and returning the hardware data to be acquired by the SNMP service, and closing the SNMP service on the equipment through the TELNET service after the SNMP service returns the hardware data to be acquired.
Preferably, when the access level of the hardware data to be acquired is SNMP access, and the first execution module 404 is used for mapping the MIB variables of the SNMP service according to the hardware data to be acquired when the hardware data to be acquired is acquired by the SNMP service and returned; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is operated; if the hardware data is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if not, operating the SNMP service through the TELNET service; acquiring hardware data to be acquired according to the value taking command and returning the hardware data; or, when the access level of the hardware data to be acquired is both SNMP and TELNET accessible, and the TELNET service receives an SNMP service request for acquiring the hardware data to be acquired, the third execution module 408 performs MIB variable mapping of the SNMP service according to the hardware data to be acquired when the hardware data to be acquired is acquired by the SNMP service and returned by the SNMP service; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is operated; if the hardware data is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if not, operating the SNMP service through the TELNET service; and acquiring hardware data to be acquired according to the value-taking command and returning the hardware data.
Preferably, the data acquisition apparatus of the present embodiment further includes: the processing module 410 is configured to perform MIB variable mapping on hardware data acquired by the SNMP service, and convert the hardware data subjected to MIB variable mapping into hardware data conforming to a set format; and/or performing character string extraction processing on the hardware data acquired by the TELNET service, and converting the hardware data subjected to the character string extraction processing into hardware data conforming to a set format.
Preferably, the data acquisition apparatus of the present embodiment further includes: a setting module 412, configured to set an access level of the hardware data according to whether the hardware data receives an SNMP service and/or TELNET service access before the determining module 402 determines the access level of the hardware data to be acquired according to the hardware data acquisition request.
Preferably, when the access level of the hardware data to be acquired is SNMP access, the first execution module 404 further performs MIB variable mapping of the SNMP service according to the hardware data to be acquired before logging in the device where the hardware data to be acquired is located through the TELNET service and starting the SNMP service on the device through the TELNET service; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; and determining that the SNMP service is closed according to a return result of the value taking command.
The data acquisition device of this embodiment is used to implement the corresponding data acquisition method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
In the process of routing inspection and maintenance of the server, hardware data including basic data and state information of hardware directly reflect whether the equipment is normally operated or not, and the hardware data is key data for determining the operation state of the equipment. By the data acquisition scheme, the problems that in the process of OMC inspection maintenance or interaction between hardware basic data and state information based on a server, a single service access technology cannot remotely acquire hardware data, or the single service access technology has limited types of remotely acquired hardware data, low acquisition efficiency, network risks brought by SNMP (simple network management protocol) service and the like are solved. The data acquisition scheme of the invention can cross-communicate the effective access of the management end/client end and the service end by means of the remote cross complementary data acquisition of the SNMP service and the TELNET service, acquire the basic data and the state information of the equipment to the maximum extent, and display the data to the maintainers in detail in stages in a step-level mode. Therefore, the automation rate of OMC remote maintenance and the accuracy of problem diagnosis are improved, the time is effectively saved, the maintenance cost is reduced, the working efficiency is improved, and the network safety is ensured.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The data acquisition method and the data acquisition device provided by the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method of data acquisition, comprising:
determining the access level of the hardware data to be acquired according to the hardware data acquisition request, wherein the access level of the hardware data comprises: SNMP access, TELNET access, and both SNMP and TELNET access;
if the access level of the hardware data to be collected is the SNMP access, then
Logging in equipment where the hardware data to be acquired are located through a TELNET service, and starting an SNMP service on the equipment through the TELNET service; the SNMP service collects and returns the hardware data to be collected; and after the SNMP service returns the hardware data to be collected, the SNMP service on the equipment is closed through the TELNET service.
2. The method of claim 1, further comprising:
if the access level of the hardware data to be acquired is the TELNET access, logging in the equipment where the hardware data to be acquired is located through the TELNET service, and acquiring and returning the hardware data to be acquired by the TELNET service;
if the access level of the hardware data to be acquired is that both the SNMP and the TELNET can be accessed, logging in equipment where the hardware data to be acquired is located through the TELNET service, and judging whether an SNMP service request for acquiring the hardware data to be acquired is received or not; if not, acquiring and returning the hardware data to be acquired by the TELNET service; if the hardware data is received, the SNMP service on the equipment is started through the TELNET service, the hardware data to be acquired is acquired and returned by the SNMP service, and the SNMP service on the equipment is closed through the TELNET service after the hardware data to be acquired is returned by the SNMP service.
3. The method according to claim 1 or 2,
when the access level of the hardware data to be acquired is the SNMP access, or when the access level of the hardware data to be acquired is both the SNMP access and the TELNET access, and the TELNET service receives an SNMP service request for acquiring the hardware data to be acquired, the step of acquiring and returning the hardware data to be acquired by the SNMP service includes:
carrying out Management Information Base (MIB) variable mapping of the SNMP service according to the hardware data to be collected;
sending a value taking command to the SNMP service according to the result of the MIB variable mapping;
judging whether the SNMP service is already operated;
if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data;
if the SNMP service is not operated, the SNMP service is operated through the TELNET service; and acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data.
4. The method of claim 3, further comprising:
MIB variable mapping is carried out on the hardware data acquired by the SNMP service, and the hardware data subjected to the MIB variable mapping is converted into hardware data conforming to a set format;
and/or the presence of a gas in the gas,
and performing character string extraction processing on the hardware data acquired by the TELNET service, and converting the hardware data subjected to the character string extraction processing into hardware data conforming to the set format.
5. The method of claim 1, further comprising, prior to the step of determining the access level of the hardware data to be collected according to the hardware data collection request:
and setting the access level of the hardware data according to whether the hardware data receives the SNMP service and/or TELNET service access.
6. The method according to claim 1, wherein when the access level of the hardware data to be collected is the SNMP access, before the steps of logging in the device where the hardware data to be collected is located through a TELNET service and starting an SNMP service on the device through the TELNET service, the method further comprises:
carrying out Management Information Base (MIB) variable mapping of the SNMP service according to the hardware data to be collected;
sending a value taking command to the SNMP service according to the result of the MIB variable mapping;
and determining that the SNMP service is closed according to a return result of the value taking command.
7. A data acquisition device, comprising:
a determining module, configured to determine, according to a hardware data acquisition request, an access level of hardware data to be acquired, where the access level of the hardware data includes: SNMP access, TELNET access, and both SNMP and TELNET access;
the first execution module is used for logging in equipment where the hardware data to be acquired is located through a TELNET service and starting an SNMP service on the equipment through the TELNET service if the access level of the hardware data to be acquired is the SNMP access; the SNMP service collects and returns the hardware data to be collected; and after the SNMP service returns the hardware data to be collected, the SNMP service on the equipment is closed through the TELNET service.
8. The apparatus of claim 7, further comprising:
a second execution module, configured to log in, through the TELNET service, the device where the hardware data to be acquired is located if the access level of the hardware data to be acquired is the TELNET access, and acquire and return the hardware data to be acquired by the TELNET service;
a third execution module, configured to log in, through the TELNET service, the device where the hardware data to be acquired is located if the access level of the hardware data to be acquired is both accessible to the SNMP and TELNET, and determine whether an SNMP service request for acquiring the hardware data to be acquired is received; if not, acquiring and returning the hardware data to be acquired by the TELNET service; if the hardware data is received, the SNMP service on the equipment is started through the TELNET service, the hardware data to be acquired is acquired and returned by the SNMP service, and the SNMP service on the equipment is closed through the TELNET service after the hardware data to be acquired is returned by the SNMP service.
9. The apparatus according to claim 8 or 9,
when the access level of the hardware data to be acquired is the SNMP access and the first execution module is acquired by the SNMP service and returns the hardware data to be acquired, carrying out Management Information Base (MIB) variable mapping of the SNMP service according to the hardware data to be acquired; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is already operated; if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if the SNMP service is not operated, the SNMP service is operated through the TELNET service; acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data;
or,
when the access level of the hardware data to be acquired is that both the SNMP and the TELNET can be accessed, and the TELNET service receives an SNMP service request for acquiring the hardware data to be acquired, the third execution module performs MIB variable mapping on a management information database of the SNMP service according to the hardware data to be acquired when the hardware data to be acquired is acquired and returned by the SNMP service; sending a value taking command to the SNMP service according to the result of the MIB variable mapping; judging whether the SNMP service is already operated; if the hardware data to be acquired is operated, acquiring the hardware data to be acquired according to the value taking command and returning the hardware data; if the SNMP service is not operated, the SNMP service is operated through the TELNET service; and acquiring the hardware data to be acquired according to the value-taking command and returning the hardware data.
10. The apparatus of claim 7, further comprising:
and the setting module is used for setting the access level of the hardware data according to whether the hardware data receives the SNMP service and/or TELNET service access or not before the determining module determines the access level of the hardware data to be acquired according to the hardware data acquisition request.
CN201310048908.5A 2013-02-06 2013-02-06 Collecting method and device Active CN103152195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310048908.5A CN103152195B (en) 2013-02-06 2013-02-06 Collecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310048908.5A CN103152195B (en) 2013-02-06 2013-02-06 Collecting method and device

Publications (2)

Publication Number Publication Date
CN103152195A true CN103152195A (en) 2013-06-12
CN103152195B CN103152195B (en) 2015-12-02

Family

ID=48550070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310048908.5A Active CN103152195B (en) 2013-02-06 2013-02-06 Collecting method and device

Country Status (1)

Country Link
CN (1) CN103152195B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429755A (en) * 2018-03-21 2018-08-21 深圳天源迪科信息技术股份有限公司 Basic network security information dynamic management platform and method
CN109981362A (en) * 2019-03-21 2019-07-05 浪潮商用机器有限公司 A kind of server hardware information acquisition device, method, equipment and medium
CN111865639A (en) * 2019-04-30 2020-10-30 深信服科技股份有限公司 Method and device for collecting information of snmp service equipment and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030191590A1 (en) * 2002-04-04 2003-10-09 Catteleya Systems Interactive automatic-test GUI for testing devices and equipment using shell-level, CLI, and SNMP commands
CN1700653A (en) * 2004-05-21 2005-11-23 华为技术有限公司 Network management system and method
CN101420344A (en) * 2008-12-12 2009-04-29 北京邮电大学 Network performance automatic evaluation method based on Java and database
CN101998687A (en) * 2009-08-18 2011-03-30 中国移动通信集团广东有限公司 Method and device for collecting network parameters of WLAN (Wireless Local Area Network)
CN102123043A (en) * 2011-01-05 2011-07-13 中国南方电网有限责任公司超高压输电公司百色局 System capable of realizing secondary safety protection and supervision of substation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030191590A1 (en) * 2002-04-04 2003-10-09 Catteleya Systems Interactive automatic-test GUI for testing devices and equipment using shell-level, CLI, and SNMP commands
CN1700653A (en) * 2004-05-21 2005-11-23 华为技术有限公司 Network management system and method
CN101420344A (en) * 2008-12-12 2009-04-29 北京邮电大学 Network performance automatic evaluation method based on Java and database
CN101998687A (en) * 2009-08-18 2011-03-30 中国移动通信集团广东有限公司 Method and device for collecting network parameters of WLAN (Wireless Local Area Network)
CN102123043A (en) * 2011-01-05 2011-07-13 中国南方电网有限责任公司超高压输电公司百色局 System capable of realizing secondary safety protection and supervision of substation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
COWBOYK: "网络设备上如何打开SNMP协议", 《百度文库HTTP://WENKU.BAIDU.COM/VIEW/77F8EAA5B0717FD5360CDC0E.HTML》, 12 January 2012 (2012-01-12), pages 3 - 6 *
边缘路人704: "novartis关闭打印机SNMP服务小结", 《百度文库HTTP://WENKU.BAIDU.COM/VIEW/363D87F29E31433239689354.HTML》, 7 December 2011 (2011-12-07) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429755A (en) * 2018-03-21 2018-08-21 深圳天源迪科信息技术股份有限公司 Basic network security information dynamic management platform and method
CN108429755B (en) * 2018-03-21 2021-02-05 深圳天源迪科信息技术股份有限公司 Dynamic management platform and method for network security basic information
CN109981362A (en) * 2019-03-21 2019-07-05 浪潮商用机器有限公司 A kind of server hardware information acquisition device, method, equipment and medium
CN111865639A (en) * 2019-04-30 2020-10-30 深信服科技股份有限公司 Method and device for collecting information of snmp service equipment and electronic equipment
CN111865639B (en) * 2019-04-30 2023-07-14 深信服科技股份有限公司 Method and device for collecting information of snmp service equipment and electronic equipment

Also Published As

Publication number Publication date
CN103152195B (en) 2015-12-02

Similar Documents

Publication Publication Date Title
CN104811433B (en) The distributed Internet of things system and implementation method of a kind of C/S frameworks
CN108156038B (en) Request distribution method, device, access gateway and storage medium
CN103546343B (en) The network traffics methods of exhibiting of network traffic analysis system and system
CN101448277A (en) Method, system and device for processing wireless access network faults
CN111510325B (en) Alarm information pushing method, server, client and system
CN111683162B (en) IP address management method based on flow identification
CN102420765A (en) Method and device for determining physical link between switchboard and terminal
KR101341596B1 (en) Apparatus and method for monitoring of wep application telecommunication data by user
CN108833565A (en) A kind of method, apparatus of monitoring server, server and storage medium
CN103152195B (en) Collecting method and device
CN111064779A (en) SF of transformer substation6Online monitoring device, method and system
CN112052227A (en) Data change log processing method and device and electronic equipment
CN104955036B (en) Safe networking method and apparatus under public Wi-Fi environment
CN105809031A (en) Database auditing method, apparatus and system
CN108011870B (en) A kind of remote software online upgrading information automatic identification management method
CN104023001A (en) Method for AC equipment to forward unauthorized message information
CN113206879A (en) Terminal IP address automatic synchronization method, electronic equipment and storage medium
CN109218064A (en) network management system and management method
CN109889619B (en) Abnormal domain name monitoring method and device based on block chain
CN105721231A (en) Service quality sensing detection method and service quality sensing detection device
CN101662391B (en) SNMPv3-based cluster management method of Ethernet switches
CN104104526A (en) Network logging-on behavior monitoring method, device and system
CN112787846A (en) Equipment discovery method and device and computer equipment
KR20090063504A (en) Oma-dm system, device management server and terminal device
CN115834525B (en) Terminal access method and device based on ARP control, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant