npm package: @itentialopensource/snmp-management
Description: SNMP Community Strings management on network devices via Itential Automation Platform (IAP)
Author: Itential Artifacts
Latest version: 0.5.6-2023.1.0

# SNMP Community Management

The SNMP Community Management pre-built demonstrates the ability to agnostically manage SNMP community strings across multiple device types via Itential Automation Platform (IAP).

<!-- ![workflow shot](./img/snmp-flow.png) -->
<table><tr><td>
	<img src="./img/snmp-flow.png" alt="workflow shot" width="800px">
</td></tr></table>

This pre-built allows users to execute the automation against their network devices that are managed by Ansible. Currently, the supported device OS types are Cisco-IOS, Cisco-IOSXR & Cisco-NX.

This pre-built utilizes an Itential provided Ansible Role "itential_manage_snmp" which allows device level abstraction when configurating SNMP community strings on selected device types.

## Pre-Requisites

In order to take full advantage of the SNMP Community Strings Management pre-built automation, users will need to satisfy the following pre-requisites:

1. Verify Itential Ansible Manager is successfully installed and functional.
2. Connectivity has been established between Itential Automation Platform and Ansible Manager Instance
3. Devices are onboarded within Ansible Manager and device connectivity has been established.
4. Itential provided Ansible Role: **itential_manage_snmp** has been onboarded into Ansible Manager and decorated with appropriate metadata. (How to onboard Ansible Roles & decorate them)
5. Itential Automation Platform: `^2021.2`

## How to Onboard & Decorate an Ansible Role within Itential Ansible Manager

**Perform the procedure below for "itential_manage_snmp" role.

[Download 'itential_manage_snmp' Role](./lib/itential_manage_snmp.tar.gz)

1. Download and transfer the Itential provided Ansible Role: **itential_manage_snmp** to the VM where Itential Ansible Manager is installed.
2. Un-tar or Unzip the **itential_manage_snmp** tar file and move it to **/usr/share/ansible/roles**
3. Log into the Ansible Manager GUI and browse to the API Documentation Page and execute the /roles/refresh API located under the Roles section (As shown in the figure below)

<!-- ![role-refresh](./img/role-refresh.png) -->
<table><tr><td>
	<img src="./img/role-refresh.png" alt="role-refresh" width="800px">
</td></tr></table>

5. Browse to the Roles section on the left side panel and verify the newly onboarded role can be seen.
6. Click on the **itential_manage_snmp** role and click the Edit button on the window in order to decorate the role with appropriate metadata.
7. Copy the content available within the following file : **/usr/share/ansible/roles/itential_manage_snmp/metadata/decoration.json** and paste it in the text section (As shown in the figure below) and click the **SAVE** button.

<!-- ![role-decorate](./img/role-decorate.png) -->
<table><tr><td>
	<img src="./img/role-decorate.png" alt="role-decorate" width="800px">
</td></tr></table>

8. At this point, you have successfully onboarded and decorated the **itential_manage_snmp** role.
9. Log into the Itential Automation Platform and browse Adapter status page: Settings ---> Systems ---> Adapters (Tab) and restart the Ansible Manager adapter (As shown in the figure below)

<!-- ![adapter-restart](./img/adapter-restart.png) -->
<table><tr><td>
	<img src="./img/adapter-restart.png" alt="adapter-restart" width="800px">
</td></tr></table>

10. Once the Ansible Manager adapter restarts successfully, the system would have auto-generated a network intelligent task that represents the newly onboarded Ansible Role.

## How to install

To install the pre-built:

* Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the [Requirements](#Requirements) section. 
* The pre-built can be installed from within `App-Admin_Essential`. Simply search for the name of your desired pre-built and click the install button (as shown below).

<!-- REPLACE BELOW WITH IMAGE OF YOUR PUBLISHED PRE-BUILT -->
<table><tr><td>
  <img src="./img/install.png" alt="install" width="600px">
</td></tr></table>
<!-- REPLACE ABOVE WITH IMAGE OF YOUR PUBLISHED PRE-BUILT -->

## How to run

1. Browse to the Operations Manager application and run Automation item called SNMP Management (As shown in the figure below).

  <!-- ![automation-catalog-create](./img/create-ac.png) -->
  <table><tr><td>
    <img src="./img/automation-item.png" alt="automation-item" width="400px">
  </td></tr></table>

2. Click the "Run Manually" button in order to kick off the SNMP Management automation (As shown in the figure above)
3. Fill in respective values into json-form as shown below (sample values only) and start the workflow.
<!-- ![banner-form](./img/banner-form.png) -->
  <table><tr><td>
    <img src="./img/snmp-initial-form.png" alt="banner-form" width="400px">
  </td></tr></table>
4. After the system finishes execution of a set of automated tasks, it will stop on a manual task to provide an existing list of SNMP Community strings already provisioned on the chosen device. Please modify or add SNMP community details as requested in the form (As shown in the figure below)

<!-- ![snmp-form](./img/snmp-form.png) -->
<table><tr><td>
	<img src="./img/snmp-form.png" alt="snmp-form" width="400px">
</td></tr></table>

5. Once all the information has been submitted via the form, the system will continue executing the rest of the automated tasks and present a manual task in order to provide a Pre-Check/Post-Check Diff of the configuration change on the network device. Please review the configuration diff by executing the manual task (As shown in the figure below) and click the **"Proceed"** button to end the automation.

  <!-- ![banner-config-diff](./img/pre-post-diff.png) -->
  <table><tr><td>
    <img src="./img/pre-post-diff.png" alt="banner-config-diff" width="800px">
  </td></tr></table>

## Additional Information
Please use your Itential Customer Success account if you need support when using this pre-built.