salt.modules.win_snmp module

Module for managing SNMP service settings on Windows servers. The Windows feature 'SNMP-Service' must be installed.

salt.modules.win_snmp.get_agent_service_types()

Get the sysServices types that can be configured.

Returns:A list of the service types.
Return type:list

CLI Example:

salt '*' win_snmp.get_agent_service_types
salt.modules.win_snmp.get_agent_settings()

Determine the value of the SNMP sysContact, sysLocation, and sysServices settings.

Returns:A dictionary of the agent settings.
Return type:dict

CLI Example:

salt '*' win_snmp.get_agent_settings
salt.modules.win_snmp.get_auth_traps_enabled()

Determine whether the host is configured to send authentication traps.

Returns:A boolean representing whether authentication traps are enabled.
Return type:bool

CLI Example:

salt '*' win_snmp.get_auth_traps_enabled
salt.modules.win_snmp.get_community_names()

Get the current accepted SNMP community names and their permissions.

Returns:A dictionary of community names and permissions.
Return type:dict

CLI Example:

salt '*' win_snmp.get_community_names
salt.modules.win_snmp.get_permission_types()

Get the permission types that can be configured for communities.

Returns:A list of the permission types.
Return type:list

CLI Example:

salt '*' win_snmp.get_permission_types
salt.modules.win_snmp.set_agent_settings(contact, location, services=None)

Manage the SNMP sysContact, sysLocation, and sysServices settings.

Parameters:
  • contact (str) -- The SNMP contact.
  • location (str) -- The SNMP location.
  • services (str) -- A list of selected services. The possible service names can be found

via win_snmp.get_agent_service_types.

Returns:A boolean representing whether the change succeeded.
Return type:bool

CLI Example:

salt '*' win_snmp.set_agent_settings contact='Contact Name' location='Place' services="['Physical']"
salt.modules.win_snmp.set_auth_traps_enabled(status=True)

Manage the sending of authentication traps.

Parameters:status (bool) -- The enabled status.
Returns:A boolean representing whether the change succeeded.
Return type:bool

CLI Example:

salt '*' win_snmp.set_auth_traps_enabled status='True'
salt.modules.win_snmp.set_community_names(communities)

Manage the SNMP accepted community names and their permissions.

Parameters:communities (str) -- A dictionary of SNMP community names and permissions.

The possible permissions can be found via win_snmp.get_permission_types.

Returns:A boolean representing whether the change succeeded.
Return type:bool

CLI Example:

salt '*' win_snmp.set_community_names communities="{'TestCommunity': 'Read Only'}'