Help Docs

Configuring SNMP agents on different Windows servers

Monitor your Windows servers agentless, with the support of SNMP. Simply install and configure SNMP agents on your servers, install an On-Premise Poller, and your server for monitoring. 

Synopsis

Installing SNMP agents on Windows 10 1803 or later

The SNMP service is not listed in the Windows features list in the Control Panel on Windows 10. Install the SNMP service directly from Microsoft servers using any of the three steps below:

  • Optional Features graphical interface
  • PowerShell
  • DISM

Installing using the Optional Features graphical interface

  1. Go to the SettingsAppsApps & FeaturesManage Optional FeatureAdd Feature
  2. Select the following from the list: Simple Network Management Protocol (SNMP) and WMI SNMP Provider (to get all SNMP service configuration tabs).

Installing using PowerShell

  1. Navigate to StartWindows PowerShell folderWindows PowerShell.
  2. Run the following command:
    Add-WindowsCapability -Online -Name "SNMP.Client~~~~0.0.1.0"

Installing using DISM

  1. You can also use the deployment image servicing and management (DISM) tool. Go to StartCommand Prompt.
  2. Right-click the top result, and select Run as administrator.
  3. Execute the following command, and press Enter:
    DISM /online /add-capability /capabilityname:SNMP.Client~~~~0.0.1.0

Configuring SNMP agents on Windows 10 1803 or later

  1. Navigate to StartSettingsControl Panel.
  2. Under Administrative Tools, click Services.
  3. In the details pane, right-click SNMP Service and select Properties. If stopped, start the service by clicking the Start button, and change the Startup type to Automatic.
  4. In the Security tab, under Accepted community names, click Add.
  5. Under Community Rights, select a permission level for this host to process SNMP requests from the selected community.
  6. In Community Name, type a case-sensitive community name, and then click Add.
  7. Choose whether or not to accept SNMP packets from a host:
    • To accept SNMP requests from any host on the network, regardless of identity, click Accept SNMP packets from any host.
    • To limit accepting SNMP packets, click Accept SNMP packets from these hosts, and click Add. Then, type the appropriate host name, IP, or IPX address, and then click Add.
  8. Click Apply.

Configuring SNMP agents on Windows Vista, Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2, or Windows Server 2016 or later

  1. Go to the Control Panel. Click on ProgramsPrograms and Features, and then click on Turn Windows features on or off. If you’re prompted with User Account Control dialog box, click Continue or Yes (varies with versions).
  2. In Turn Windows features on or off, check the box next to Simple Network Management Protocol (SNMP) or SNMP feature (again, varies with versions) and click OK
  3. After this, follow the steps given above for Configuring SNMP agents on Windows 10 1803 or later.

Configuring SNMP agents on Windows NT systems

  1. Navigate to StartSettingsControl Panel.
  2. Under Administrative Tools, click Services.
  3. In the Details pane, right-click SNMP Service, and select Properties.
  4. Under Accepted community names, click Add.
  5. In the Community Names box, type the community name to authenticate SNMP requests.
  6. Click Add to move the community name to the list of Accepted Community Names.
  7. Repeat steps 6 and 7 to add more community names.
  8. Choose whether to accept SNMP packets from any host or only from specified hosts:
    • Click Accept SNMP Packets From Any Host, if you wish to accept SNMP packets from any host with no IP restriction.
    • Click Only Accept SNMP Packets From These Hosts if you wish accept SNMP packets only from specific hosts. To enter the desired hosts click Add; type the name or address of the host in IP Host or IPX Address box, and then click Add.
  9. Repeat step 9 to add more hosts.
  10. In the Agent tab, specify information like comments about the user, location, and services.
  11. Click OK to apply the changes.

The SNMP agent running on Windows NT does not respond to Host Resource Data by default. To support this you may need Windows NT service pack 6 or above. Check your pack details before following the steps below.
  
Note: Windows NT 4.0 server does not come with a Host Resource MIB.

If you are running Windows NT Service Pack 6a and use Windows 2000 server, then follow these steps:

  1. Copy the %SystemRoot%\System32\hostmib.dll file from the Windows 2000 server to %SystemRoot%\System32folder on your Windows NT 4.0 Server.
  2. Run regedit or regedt32, and add the following keys and values:
    • Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HostMIB\CurrentVersion
    • Value Name: Pathname
    • Type: REG_SZ
    • Data: C:\WinNT\system32\hostmib.dll

    • Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents
    • Value Name: 3
    • Type: REG_SZ
    • Data: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HostMIB\CurrentVersion
  3. For registering DLL using the Microsoft REGSVR utility, follow the steps below:
    • Copy the file to C:\Windows\SysWOW64\ (for 32bit) or C:\Windows\System32\ (for 64bit)
    • To complete this step, you should run Command Prompt as an administrator. 
    • Paste the following command into the Command Line window that opens, and press Enter.
      %windir%\System32\regsvr32.exe hostmib.dll (for 32 bit)
      %windir%\SysWoW64\regsvr32.exe hostmib.dll (for 64 bit)
  4. Restart your Windows NT box.

Configuring SNMP agent on Windows XP, Windows 2000, and Windows 2003 systems

  1. Navigate to StartSettingsControl Panel.
  2. Under Administrative Tools, click Services.
  3. In the Details pane, right-click SNMP Service, and select Properties.
  4. Under Accepted community names, click Add.
  5. Under Community Rights, select a permission level for this host to process SNMP requests from the selected community.
  6. In Community Name, type a case-sensitive community name, and then click Add.
  7. Choose whether or not to accept SNMP packets from a host:
    • To accept SNMP requests from any host on the network, regardless of identity, click Accept SNMP packets from any host.
    • To limit accepting SNMP packets, click Accept SNMP packets from these hosts, and click Add. Then, type the appropriate host name, IP, or IPX address, and then click Add.
  8. Click Apply.

Testing SNMP on Windows 

Test the SNMP reachability using MIB browser.


PowerShell-based SNMP configuration 

In this section, we'll cover:

Prerequisites for Remote Execution

To create remote sessions and run remote commands, the local and remote machines must meet the below requirements.

  1. System requirements
  2. User permissions
  3. Windows network/firewall permission
  4. Run as administrator
1. System requirements

The following are the system requirements for script execution on remote machines.

  1. To run remote sessions on Windows PowerShell 3.0, the local and remote computers must have:
    • Windows PowerShell 3.0 or later.
    • Microsoft .NET Framework 4 or later.
    • Windows Remote Management 3.0.
  2. To run remote sessions on Windows PowerShell 2.0, the local and remote computers must have:
    • Windows PowerShell 2.0 or later.
    • Microsoft .NET Framework 2.0 or later.
    • Windows Remote Management 2.0.
2. User permission

By default, the current user needs to be a member of the administrators group on the remote computer or provide the credentials of an administrator.

3. Windows network/firewall permission

The remote connection from both the server and client side must not be blocked by the firewall.

4. Run as administrator

Administrator privileges are mandatory to enable and configure SNMP.

Installation using PowerShell

    1. Navigate to Start > Windows PowerShell folder > Windows PowerShell.
    2. Run the following command: Add-WindowsCapability -Online -Name "SNMP.Client~~~~0.0.1.0"

NOTE:

    1. Please confirm that the prerequisites for remote execution are met.
    2. Check if the host and client devices are available on the same network domain.
    3. Enable PSRemoting on remote devices that this particular script will be executed on. This can be executed with a Remote Desktop connection.

Steps to enable SNMP on a Windows device using PowerShell

  1. Download the SNMPEnabler.ps1 script.
  2. Open the Windows PowerShell utility as an administrator.
  3. Run the SNMPEnabler.ps1 script and provide the required input parameters.
  4. Execute the script with the inputs provided. It will automatically enable and configure SNMP on your local or remote devices.

Input parameters for script execution

The following input parameters can be processed by the script executions.

Input parameter Usage Default values Required? Example
h Host name that the SNMP service needs to be enabled in. - Mandatory (if -f not given) -h ben-3515
f Part of the file that contains multiple hosts. File format: (XXXXX.txt) s24x7-dev1 localhost 192.21.23.1 ben-3515.zohocorpin.com - Mandatory (if -h not given) -f D:\SNMP\hostlist.txt
username Username of the account used for remote access - Mandatory for remote machines, optional for the local host. -username workgroup\administrator
pass Password of the account used for remote access -

Optional for the local host. Remote: It can be provided as an argument. You'll be asked for the password during remote execution.

-pass password@987
onlyConfigure

Used to configure the SNMP settings on already SNMP-enabled machines.

Possible values are “true” or “false”. If “true”, the script will only go for configuration.

false Optional -onlyConfigure true
communityName The SNMP community string that will be added after script execution. public Optional -communityName networkcommunity
snmpType

Permission to be added from the community string. Allowed integer values: “1” - NONE “2” - NOTIFY “4” - READONLY “8” - READWRITE “16” - READCREATE

4 Optional -snmpType 4
permittedHost The host that needs SNMP access from the remote machine The name of the default localhost machine that the script was executed from. Optional -permittedHost s24x7-dev7
debug

Used for debugging.Possible values are “true” or “false”.

false Optional -debug true

Script Commands and Usage

1. Host-specific enabling

Options to enable and configure a single host with default or custom options.

Commands

1.1 To enable and configure SNMP (with default options) on a local machine:

Execute:.\SNMPEnabler.pst1 -h localhost

1.2 To enable and configure SNMP (with default options) on a remote machine:

Execute:.\SNMPEnabler.ps1 -h -username

1.3. To enable and configure SNMP (with custom input options) on a local machine:

Execute: .\SNMPEnabler.ps1 -h localhost -communityName -snmpType -permittedHost

1.4. To enable and configure SNMP (with custom input options) on a remote machine:

Execute:.\SNMPEnabler.ps1 -h -username -communityName -snmpType -permittedHost

1.5. To configure the community and permitted hosts on an SNMP-enabled local machine:

Execute.\SNMPEnabler.ps1 -h localhost -onlyConfigure true -communityName -snmpType -permittedHost

1.6. To configure the community and permitted hosts on an SNMP-enabled remote machine:

Execute.\SNMPEnabler.ps1 -h -username -pass -onlyConfigure true -communityName -snmpType -permittedHost

2. Bulk enabling (using an input file containing hosts)

By passing the file path that contains a list of hosts, you can enable and configure SNMP for multiple servers.

Commands

2.1 To enable and configure SNMP (with default options) on multiple local or remote machines:

Execute:.\SNMPEnabler.ps1 -f -username

2.2 To enable and configure SNMP (with custom options) on multiple local or remote machines:

Execute:.\SNMPEnabler.ps1 -f -username -communityName -snmpType -permittedHost

2.3 To configure the community and permitted hosts on SNMP-enabled local or remote machines:

Execute:.\SNMPEnabler.ps1 -f -username -onlyConfigure true -communityName -snmpType -permittedHost


Related articles

Was this document helpful?

Shortlink has been copied!