In linux, snmptrap sends and receives requests to the managed server every five minutes because you need to manage server parameters, such as CPU usage and IOwait metrics. This type of indicator is a business indicator. It is a required parameter and an alarm indicator is required. However, because the alarm information is generally triggered by the managed server, the managed server cannot actively use snmpwalk, but the managed server uses snmptrap. Below www.2cto.com are some snmptrap settings for both parties. First, the administrator needs to configure snmptrapd first. conf, which can be placed with snmpd. conf is in the same path and in my local environment (/etc/snmp/snmptrapd. conf) configuration code: Conf code authcommunity execute, log, net public traphandle. 1.3.6.1.4.1.2021.251.1/root/traptest/test. in pl, authcommunity is used to set access permissions for all users: executable, record, and pass. Set traphandle (that is, execute test. pl when you receive OID information of the. 1.3.6.1.4.1.2021.251.1 class ). Content of test. pl: Perl code #! /Usr/bin/perl use strict; my $ file = "file. trap "; open (HANDOUT,">. /$ file "); while (<STDIN>) {print HANDOUT" $ _ ";} Then enter the command: Linux code snmptrapd-c/etc/snmp/snmptrapd. conf sets this configuration file as the default configuration file and starts the snmptrapd process: Linux code www.2cto.com # snmptrapd-d-f-Lo in the managed party. Run the following command: linux code snmptrap-v 2c-c public *. *. *. *"". 1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei" and then the Administrator will receive the following information: Linux Code Received 98 bytes from UD P: [221.176.14.88]: 58750 0000: 30 60 02 01 01 04 06 70 75 62 6C 69 63 A7 53 02 0 '..... public. s. 0016: 04 1B CE 4F F1 02 01 00 01 00 30 45 30 10 06... O ....... 0E0 .. 0032: 08 2B 06 01 01 01 03 00 43 04 28 8D B0 5B 30. + ....... c. (.. [0 0048: 18 06 0A 2B 06 01 03 01 01 01 00 06 0A 2B... + ........... + 0064: 06 01 04 01 8F 65 81 7B 01 30 17 06 08 2B 06 01 ..... e. {. 0... + .. 0080: 02 01 01 06 00 04 0B 6C 6F 6E 67 74 65 6E 67 66 ....... longtengf 0096: 65 69 ei www.2cto.com 2012-07-16 10:44:17 <UNKNOWN> [UDP: [221.176.14.88]: 58750]: DISMAN-EVENT-MIB: sysUpTimeInstance = Timeticks: (680374363) 78 days, 17:55:43. 63 SNMPv2-MIB: snmpTrapOID.0 = OID: UCD-SNMP-MIB: ucdStart SNMPv2-MIB: sysLocation.0 = STRING: longtengfei so far, the simplest snmptrap to send and receive completed. Author shenlan177