salt.modules.win_snmp
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.
- Returns
-
A list of service types.
- Return type
CLI Example:
salt '*' win_snmp.get_agent_service_types
salt.modules.win_snmp.get_agent_service_types()
-
Determine the value of the SNMP sysContact, sysLocation, and sysServices settings.
- Returns
-
A dictionary of the agent settings.
- Return type
CLI Example:
salt '*' win_snmp.get_agent_settings
salt.modules.win_snmp.get_agent_settings()
-
Determine whether the host is configured to send authentication traps.
- Returns
-
True if traps are enabled, otherwise False
- Return type
CLI Example:
salt '*' win_snmp.get_auth_traps_enabled
salt.modules.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
- Returns
-
A dictionary of community names and permissions.
- Return type
CLI Example:
salt '*' win_snmp.get_community_names
salt.modules.win_snmp.get_community_names()
-
Get the permission types that can be configured for communities.
- Returns
-
A list of permission types.
- Return type
CLI Example:
salt '*' win_snmp.get_permission_types
salt.modules.win_snmp.get_permission_types()
-
Manage the SNMP sysContact, sysLocation, and sysServices settings.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_snmp.set_agent_settings contact='Contact Name' location='Place' services="['Physical']"
salt.modules.win_snmp.set_agent_settings(contact=None, location=None, services=None)
-
Manage the sending of authentication traps.
- Parameters
-
status (bool) -- True to enable traps. False to disable.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_snmp.set_auth_traps_enabled status='True'
salt.modules.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
- Parameters
-
communities (dict) -- A dictionary of SNMP community names and permissions. The possible permissions can be found via
win_snmp.get_permission_types
. - Returns
-
True if successful, otherwise False
- Return type
- Raises
-
CommandExecutionError -- If SNMP settings are being managed by Group Policy
CLI Example:
salt '*' win_snmp.set_community_names communities="{'TestCommunity': 'Read Only'}'
salt.modules.win_snmp.set_community_names(communities)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.win_snmp.html