Building Upon AppDynamics Automation
The AppDynamics Ansible Collection provides excellent automation for Java agents, Machine agents, and Database agents. To extend this automation ecosystem, I developed an Ansible solution specifically for Network Visibility (NetViz) agents that integrates seamlessly with AppDynamics’ security model.
Network Visibility provides crucial insights for modern applications:
Manual deployment across hundreds of servers is time-consuming and error-prone. Automation is essential.
AppDynamics properly secures their agent binaries behind authentication. The key breakthrough was implementing OAuth authentication directly in Ansible to work with AppDynamics’ identity service.
Here’s the authentication flow I developed:
- name: Get OAuth access token
uri:
url: "https://identity.msrv.saas.appdynamics.com/v2.0/oauth/token"
method: POST
headers:
Content-Type: "application/json"
body_format: json
body:
username: "{{ vault_oauth_username }}"
password: "{{ vault_oauth_password }}"
scopes: ["download"]
register: oauth_response
no_log: true
- name: Download NetViz with OAuth token
get_url:
url: "{{ netviz_download_url }}"
dest: "/tmp/netviz-agent.deb"
headers:
Authorization: "Bearer {{ oauth_response.json.access_token }}"
checksum: "sha256:35cb07adf9a78b2b8ffaf1c37711d1a3f362d13e1165eed52464f4b90152d2d3"The solution supports both Linux and Windows environments with platform-specific optimizations:
┌─────────────────┐ ┌──────────────────┐ ┌────────────────────┐
│ Ansible │ │ Target Servers │ │ AppDynamics │
│ Control Node │ │ │ │ Controller │
│ │ │ 🐧 Linux NetViz │ │ │
│ OAuth Auth │───▶│ 🪟 Windows NetViz│───▶│ Network Metrics │
│ Cross-Platform │ │ Port 3892 │ │ Service Maps │
│ Deployment │ │ Service Mgmt │ │ Dashboards │
└─────────────────┘ └──────────────────┘ └────────────────────┘The solution automatically handles platform differences:
Component Linux Windows Package DEB (3.8 MB) ZIP (27.4 MB) Path /opt/appdynamics/netviz C:\AppDynamics\NetViz Service systemd Windows Service Installation apt package manager ZIP extraction + installer
git clone https://github.com/Abhimanyu9988/appdynamics-netviz-ansible.git
cd appdynamics-netviz-ansibleCreate vars/controller.yaml:
# AppDynamics Controller
controller_host: "your-tenant.saas.appdynamics.com"
controller_port: "443"
controller_ssl_enabled: "true"
controller_account_name: "your-account-name"
controller_access_key: "{{ vault_controller_access_key }}"
# NetViz Configuration
netviz_version: "25.7.0.3267"
netviz_webservice_port: 3892
netviz_max_memory: "512MB"Use Ansible Vault for security:
ansible-vault create vars/vault.yamlAdd your credentials:
# AppDynamics Credentials (encrypted)
vault_oauth_username: "your-email@domain.com"
vault_oauth_password: "your-password"
vault_controller_access_key: "your-controller-access-key"The core playbook (deploy-netviz.yml) handles the entire process:
---
- name: Deploy AppDynamics NetViz Agent
hosts: netviz_servers
become: yes
tasks:
- name: Include vault variables
include_vars: "vars/vault.yaml"
- name: Get OAuth access token
uri:
url: "https://identity.msrv.saas.appdynamics.com/v2.0/oauth/token"
method: POST
body_format: json
body:
username: "{{ vault_oauth_username }}"
password: "{{ vault_oauth_password }}"
scopes: ["download"]
register: oauth_response
delegate_to: localhost
run_once: true
no_log: true
- name: Download NetViz DEB
get_url:
url: "https://download.appdynamics.com/download/prox/download-file/netviz-deb/25.7.0.3267/appd-netviz-x64-linux-25.7.0.3267.deb"
dest: "/tmp/netviz-agent.deb"
headers:
Authorization: "Bearer {{ oauth_response.json.access_token }}"
checksum: "sha256:35cb07adf9a78b2b8ffaf1c37711d1a3f362d13e1165eed52464f4b90152d2d3"
- name: Install NetViz Agent
apt:
deb: "/tmp/netviz-agent.deb"
state: present
- name: Configure NetViz Agent
template:
src: "templates/agent_config.lua.j2"
dest: "/opt/appdynamics/netviz/conf/agent_config.lua"
owner: appdynamics
group: appdynamics
- name: Start NetViz Service
systemd:
name: appd-netviz
state: started
enabled: yesThe agent configuration template ensures consistent setup:
-- AppDynamics NetViz Agent Configuration
agent_type = "netviz"
agent_name = "{{ inventory_hostname }}_netviz_agent"
-- Controller Configuration
controller_host = "{{ controller_host }}"
controller_port = {{ controller_port }}
controller_ssl_enabled = {{ controller_ssl_enabled }}
account_name = "{{ controller_account_name }}"
access_key = "{{ controller_access_key }}"
-- Network Configuration
webservice_port = {{ netviz_webservice_port }}
webservice_ip = "0.0.0.0"
-- Performance Settings
max_memory_usage = "{{ netviz_max_memory }}"
log_level = "{{ netviz_log_level }}"# Deploy to Linux localhost
ansible-playbook -i inventory/localhosts.yml deploy-netviz.yaml --ask-vault-pass# Deploy to Windows localhost
ansible-playbook -i inventory/windows-localhost.yml deploy-netviz-windows.yml --ask-vault-passThe solution includes platform-specific verification:
# Check service status
sudo systemctl status appd-netviz
# Verify network connectivity
sudo netstat -tlnp | grep 3892# Check service status
Get-Service "AppDynamics NetViz"
# Verify network connectivity
Test-NetConnection -Port 3892In production environments across both Linux and Windows infrastructure, this automation has delivered:
✅ One-Command Deployment: Single Ansible command deploys across entire infrastructure ✅ Secure Authentication: OAuth integration with encrypted credential storage ✅ Automatic Verification: Built-in checksum validation and service verification ✅ Production Ready: Proper user management, service configuration, and monitoring ✅ Scalable: Works for single servers or large fleet deployments
The complete solution is available on GitHub: appdynamics-netviz-ansible
Quick start:
git clone https://github.com/Abhimanyu9988/appdynamics-netviz-ansible.git
cd appdynamics-netviz-ansible
cp vars/controller.yaml.example vars/controller.yaml
# Edit with your details
ansible-vault create vars/vault.yaml
# Add your credentials
ansible-playbook -i inventory/localhost.yml deploy-netviz.yml --ask-vault-passThis OAuth-powered, cross-platform Ansible solution transforms NetViz deployment from a manual, time-consuming process into a unified one-command operation for both Linux and Windows environments. By building upon AppDynamics’ security model and integrating with their identity service, we achieve automation, security, and platform flexibility.
The solution demonstrates how to extend excellent existing automation ecosystems while respecting security boundaries, maintaining production-ready standards, and supporting diverse infrastructure environments.
Network visibility is crucial for modern applications, and with proper cross-platform automation, it integrates seamlessly into your existing AppDynamics monitoring strategy regardless of your infrastructure mix.
Platform Support: 🐧 Linux (Ubuntu/Debian) | 🪟 Windows (Server 2016+/Windows 10+)