Jump to content

SNMP Configuration


 Share

Recommended Posts

Hi all, I've done some research on how to set SNMP service with all the parameters, so you don't need to manualy configure each server (if you're planning SNMP monitoring...).. So this is what I came up with below. No variables for now, only want your opinion and experience on this matter .. and some help of course ;) :

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers", "2", "REG_SZ", "SNMP_SERVER_IP")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\RFC1156Agent", "sysContact", "REG_SZ", "System Administrator")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\RFC1156Agent", "sysContact", "REG_SZ", "System")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\ValidCommunities", "public", "REG_DWORD", "0x00000004")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\TrapConfiguration", "public", "REG_SZ", "SNMP_SERVER_IP")
Edited by skysel
Link to comment
Share on other sites

Hi all, I've done some research on how to set SNMP service with all the parameters, so you don't need to manualy configure each server (if you're planning SNMP monitoring...).. So this is what I came up with below. No variables for now, only want your opinion and experience on this matter .. and some help of course ;) :

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers", "2", "REG_SZ", "SNMP_SERVER_IP")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\RFC1156Agent", "sysContact", "REG_SZ", "System Administrator")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\RFC1156Agent", "sysContact", "REG_SZ", "System")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\ValidCommunities", "public", "REG_DWORD", "0x00000004")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SNMP\Parameters\PermittedManagers\TrapConfiguration", "public", "REG_SZ", "SNMP_SERVER_IP")

bump .. wanting to know, if this is _all_ that needs to be set for service to be configured properly?
Link to comment
Share on other sites

Well for all of those who want to configure their SNMP settings + install SNMP service on Windows servers, here is the complete working script with possibility to specify community name:

DIM $commname
$commname = InputBox("Name", "Please enter community name:")

$file = FileOpen("C:\settings.txt",1)

FileWrite($file,"[NetOptionalComponents]" & @CRLF)
FileWrite($file,"SNMP = 1" & @CRLF)
FileWrite($file,"[SNMP]" & @CRLF)
FileWrite($file,"Contact_Name = Your Name" & @CRLF)
FileWrite($file,"Location = Your Company" & @CRLF)
FileWrite($file,"Service = Physical, Internet, Applications, End-to-End" & @CRLF)
FileWrite($file,"Community_Name = " & $commname & @CRLF)
FileWrite($file,"Traps = 10.10.10.10" & @CRLF)
FileWrite($file,"Send_Authentication = No" & @CRLF)
FileWrite($file,"Accept_CommunityName = " & $commname & ":Read_Only" & @CRLF)
FileWrite($file,"Any_Host = No" & @CRLF)
FileWrite($file,"Limit_Host = 10.10.10.10" & @CRLF)

FileClose($file)

RunWait("C:\windows\system32\sysocmgr.exe /i:C:\windows\inf\sysoc.inf /u:c:\settings.txt /r")

FileDelete("C:\settings.txt")
RunWait("sc stop snmptrap")
RunWait("sc config snmptrap start= demand")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...