This is a Desired State Configuration resource that'll help you configure SNMP on your Windows Servers.
It's build and designed for PowerShell v4 & v5. It has been tested only on Windows Server 2012R2 US & FR versions.
In order to install it, just downlooad the zip from Github and extract it in your Powershell Module Path.
Here is the link: https://www.powershellgallery.com/packages/cSNMP
Right now there are 5 resources availables:
- cSNMPCommunity - It'll create/remove the community and the rights associated on it.
- cSNMPEnableAuthenticationTrap - It'll enable/disable the authentication for traps.
- cSNMPManager - You can add/remove with this resource as many IP for your Nagios servers.
- cSNMPTrapCommunity - It'll help you assign/unassign a specific community for traps.
- cSNMPTrapDestination - Set/Unset the destination for your traps.
here is an example of what can be done.
Configuration Test {
Import-DscResource -ModuleName cSNMP
Node localhost {
WindowsFeature SNMPService {
Name = 'SNMP-Service'
Ensure = 'Present'
}
WindowsFeature SNMPRSAT {
Name = 'RSAT-SNMP'
Ensure = 'Present'
}
cSNMPCommunity Community {
Community = "Test"
Right = "ReadOnly"
Ensure = "Present"
DependsOn = '[WindowsFeature]SNMPRSAT'
}
}
}
}
After that you should now how to apply it - Test
and Start-DSCConfiguration
:)