Solved

Configure Windows SNMP with VBscript

Posted on 2011-03-25
4
1,937 Views
Last Modified: 2012-05-11
Configure Windows SNMP with VBscript

I have an SNMP service to configure in 100 windows 2003 server.
I need a script that reads the name of the servers from a text file-- the names are lined up in a column-- and makes the change to the SNMP config for each server.

the Tabs and fields I need to modify are :

Agent Tab:
Service
Physical=checked
Applications=Checked
Datalink and subnetworks=checked
Internet=checked
End-to-end=checked

Traps Tab
Community name=public
Trap destination= 10.10.10.10

Security Tab:

Community
Public= Read Only
Private = Read Create

Accept SNMP packets from these hosts= selected
                 10.10.10.10




0
Comment
Question by:jskfan
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
sam0x01 earned 500 total points
ID: 35229149
Save the below as a .reg file
Try importing this reg file into a test server with the same production SNMP settings.

If this corrupts the SNMP Settings, then I am unsure how this can be done.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters]
"EnableAuthenticationTraps"=dword:00000001
"NameResolutionRetries"=dword:00000010

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers]
"1"="10.10.10.10"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent]
"sysContact"=""
"sysLocation"=""
"sysServices"=dword:0000004f

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\public]
"1"="10.10.10.10"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities]
"public"=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Security]
"Security"=hex:01,00,14,80,b8,00,00,00,c4,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,88,00,06,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,\
  00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,00,01,\
  00,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,\
  00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,\
  01,01,00,00,00,00,00,05,12,00,00,00

Open in new window

0
 

Author Comment

by:jskfan
ID: 35340197
Thanks..
I tried it in my workstation and it worked just fine.

How do I deploy it to multiple computers without login into each computer?
0
 
LVL 3

Assisted Solution

by:sam0x01
sam0x01 earned 500 total points
ID: 35347451
You can run "regedit /s \\servername\share\path\filename.reg" or "reg /import as the command to import. Unfortunately neither regedit or reg /import allow to perform this remotely.

Suggest putting the .reg file on a shared resource and using psexec to perform this remotely. Psexec is a command that allows remote execution of tasks.

Make sure you try it on a single server before pushing it to the masses because it may behave unusually if there is prior SNMP config.

Alternative ways would be using the "AT" command to schedule once. Think schtasks also is in Windows 2003 Server.
0
 

Author Closing Comment

by:jskfan
ID: 35453213
thanks a lot
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question