Module for managing SNMP service settings on Windows servers. The Windows feature 'SNMP-Service' must be installed.
Get the sysServices types that can be configured.
A list of service types.
CLI Example:
salt '*' win_snmp.get_agent_service_types
Determine the value of the SNMP sysContact, sysLocation, and sysServices settings.
A dictionary of the agent settings.
CLI Example:
salt '*' win_snmp.get_agent_settings
Determine whether the host is configured to send authentication traps.
True
if traps are enabled, otherwise False
CLI Example:
salt '*' win_snmp.get_auth_traps_enabled
Get the current accepted SNMP community names and their permissions.
If community names are being managed by Group Policy, those values will be returned instead like this:
TestCommunity:
Managed by GPO
Community names managed normally will denote the permission instead:
TestCommunity:
Read Only
A dictionary of community names and permissions.
CLI Example:
salt '*' win_snmp.get_community_names
Get the permission types that can be configured for communities.
A list of permission types.
CLI Example:
salt '*' win_snmp.get_permission_types
Manage the SNMP sysContact, sysLocation, and sysServices settings.
contact (str
, optional) -- The SNMP contact.
location (str
, optional) -- The SNMP location.
services (list
, optional) --
A list of selected services. The possible service names can be found
via win_snmp.get_agent_service_types
. To disable all services
pass a list of None, ie: ['None']
Default is None
.
True
if successful, otherwise False
.
CLI Example:
salt '*' win_snmp.set_agent_settings contact='Contact Name' location='Place' services='["Physical"]'
Manage the sending of authentication traps.
status (bool
, optional) --
True
to enable traps. False
to disable.
Default is True
.
True
if successful, otherwise False
.
CLI Example:
salt '*' win_snmp.set_auth_traps_enabled status='True'
Manage the SNMP accepted community names and their permissions.
Note
Settings managed by Group Policy will always take precedence over those set using the SNMP interface. Therefore if this function finds Group Policy settings it will raise a CommandExecutionError
communities (dict) -- A dictionary of SNMP community names and permissions. The possible
permissions can be found via win_snmp.get_permission_types
.
True
if successful, otherwise False
.
CommandExecutionError -- If SNMP settings are being managed by Group Policy
CLI Example:
salt '*' win_snmp.set_community_names communities='{"TestCommunity": "Read Only"}'