Manages SNMP on network devices.
codeauthor: | Mircea Ulinic <mircea@cloudflare.com> |
---|---|
maturity: | new |
depends: | napalm |
platform: | unix |
See also
New in version 2016.11.0.
salt.modules.napalm_snmp.
config
()¶Returns the SNMP configuration
CLI Example:
salt '*' snmp.config
salt.modules.napalm_snmp.
remove_config
(chassis_id=None, community=None, contact=None, location=None, test=False, commit=True)¶Removes a configuration element from the SNMP configuration.
Parameters: |
|
---|
and will commit the changes on the device. :param commit: Commit? (default: True) Sometimes it is not needed to commit the config immediately
after loading the changes. E.g.: a state loads a couple of parts (add / remove / update) and would not be optimal to commit after each operation. Also, from the CLI when the user needs to apply the similar changes before committing, can specify commit=False and will not discard the config.
Raises: | MergeConfigException -- If there is an error on the configuration sent. |
---|---|
Return a dictionary having the following keys: | |
there are no changes to be applied and successfully performs all operations it is still True and so will be the already_configured flag (example below) * comment (str): a message for the user * already_configured (bool): flag to check if there were no changes applied * diff (str): returns the config changes applied |
CLI Example:
salt '*' snmp.remove_config community='abcd'
salt.modules.napalm_snmp.
update_config
(chassis_id=None, community=None, contact=None, location=None, test=False, commit=True)¶Updates the SNMP configuration.
Parameters: |
|
---|
and will commit the changes on the device. :param commit: Commit? (default: True) Sometimes it is not needed to commit the config immediately
after loading the changes. E.g.: a state loads a couple of parts (add / remove / update) and would not be optimal to commit after each operation. Also, from the CLI when the user needs to apply the similar changes before committing, can specify commit=False and will not discard the config.
Raises: | MergeConfigException -- If there is an error on the configuration sent. |
---|---|
Return a dictionary having the following keys: | |
there are no changes to be applied and successfully performs all operations it is still True and so will be the already_configured flag (example below) * comment (str): a message for the user * already_configured (bool): flag to check if there were no changes applied * diff (str): returns the config changes applied |
CLI Example:
salt 'edge01.lon01' snmp.update_config location="Greenwich, UK" test=True
Output example (for the CLI example above):
edge01.lon01:
----------
already_configured:
False
comment:
Configuration discarded.
diff:
[edit snmp]
- location "London, UK";
+ location "Greenwich, UK";
result:
True