Solved

Configure Windows SNMP with VBscript

Posted on 2011-03-25
4
1,888 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now