经常需要在Windows服务器上配置SNMP服务,一项项手动填写信息太麻烦。所以就用命令行执行配置文件来实现。
1) 创建snmp.inf
[NetOptionalComponents]
SNMP = 1
SNMP = 1
[SNMP]
Contact_Name = " ITSupport"
Location = " ServerRoom"
Service = Physical, Applications, End-to-End
Community_Name = Type_your_string_here
Traps = Type_the_destination_IP
Send_Authentication = Yes
Accept_CommunityName = Type_your_string_here: Read_Only
Any_Host = no
Limit_Host = Type_the_destination_IP
Contact_Name = " ITSupport"
Location = " ServerRoom"
Service = Physical, Applications, End-to-End
Community_Name = Type_your_string_here
Traps = Type_the_destination_IP
Send_Authentication = Yes
Accept_CommunityName = Type_your_string_here: Read_Only
Any_Host = no
Limit_Host = Type_the_destination_IP
2) 在服务器上运行以下命令
C:/Windows/System32/Sysocmgr.exe /i:%windir%/inf/sysoc.inf /u:
path_to_the_file/snmp.inf