Recently participated in a project, need to do a system monitoring, the requirement is to use the control host to obtain the host information of each agent machine, using the SNMP protocol.
Machine Information:
1.3.6.1.2.1.1.1.0 SYSDESCR Get basic information about the hardware and software of the monitored system
1.3.6.1.2.1.1.5.0 SysName Get the host name of the monitored system
1.3.6.1.2.1.4.20.1.1.[actual IP Address] ipadentaddr. [Actual IP Address] because the network card is not the only reason, here can actually get multiple network card information
1.3.6.1.2.1.25.2.2.0 Total Physical Memory (KB)
1.3.6.1.2.1.25.2.3.1.4.[9] Total number of clusters (numbers in parentheses represent physical memory)
1.3.6.1.2.1.25.2.3.1.6.[9] Number of clusters already in use
1.3.6.1.2.1.25.2.3.1.5.[9] A total of blocks that can be used
1.3.6.1.2.1.25.3.3.1.2.[3-6] 4 cores Each CPU usage (it's unclear why 3 First, maybe two were hidden? )
Information on each process:
1.3.6.1.2.1.25.4.2.1.2.[pid] can find the corresponding PID under the OID group according to the process name is multi- Less
1.3.6.1.2.1.25.5.1.1.2.[PID] Memory allocated by each process (KB)
1.3.6.1.2.1.25.5.1.1.1.[pid] The number of time slices (units: hundred) that each process took to start running One second)
There is no direct way to get the percentage of process occupancy, which must be calculated manually, as follows:
Time slice 1: First acquisition of PID time slices
Total time 1: Time slice for all PID acquired for the first time
Time Slice 2: Second acquisition of the PID time slice
Total time 2: time slice of all PID acquired for the second time
PID occupancy rate = (time slice 2-time slice 1)/(Total time 2-Total time 1)
So this time interval is more critical because SNMP does not have real-time reporting process information (perhaps configurable?). ), I was in the experiment, the interval of 2 minutes, this time slice reflects.
You might want to take a look at this.
MIB structure under Windows 7