How can we bulk update SNMP Profile used by devices in Data Aggregator
search cancel

How can we bulk update SNMP Profile used by devices in Data Aggregator

book

Article ID: 220413

calendar_today

Updated On:

Products

DX NetOps CA Performance Management - Usage and Administration

Issue/Introduction

How do I conduct bulk SNMP Community String Changes in Performance Management?

How to change the SNMP Profile used by a device without the Portal UI?

How to make SNMP Profile association changes to many devices at once on the Data Aggregator?

Environment

All supported DX NetOps Performance Management releases

Resolution

This process is to develop a list of device IDs to make the change against. Then REST calls can be used to make the change outside of the Portal web UI. The REST calls can be made one at a time.

The steps for a single device would be used in any custom script. They can also be scripted to be run one after the other, using an input list file as its source of values for each run. 

  1. Identify the SNMP Profile IDs. Determine which ID will be set against the device(s).
    1. Go to the following in a browser tab.
      • <scheme>://<DA_HostName>:<Port>/rest/profiles/
      • Replace these values:
        • <scheme> with the configured scheme. Default is http.
        • <DA_HostName> with the DA host name or IP address.
        • <Port> with the configured DA port. Default is 8581.
      • Log in with a valid Portal web UI user when prompted.
    2. Alternative: Use a REST API or CLI curl command with a GET.
      • curl -vk  -u <userName>  <scheme>://<DA_HostName>:<Port>/rest/profiles/ | xmllint --format -
      • Replace these values:
        • <userName> with a valid Portal web UI user that has Adminstrator Role access.
        • <scheme> with the configured scheme. Default is http.
        • <DA_HostName> with the DA host name or IP address.
        • <Port> with the configured DA port. Default is 8581.
      • Enter the Portal web UI users password when prompted.
  2. Note the IDs for the needed SNMP Profiles.
  3. On the DR DB open a VSql prompt as the dauser.
    • Run the following query to list all devices currently assigned to the selected SNMP Profile.
      • select item_id, name from <dauserName>.v_item where item_id in (select item_id from <dauserName>.v_attribute_instance where attr_qname = '{http://im.ca.com/inventory}ManageableDevice.SNMPProfileID' and long_value = <ProfileID>);
    • Replace these values:
      •  <dauserName> with the dauser name. Often the same as the schema.
        • Run \d in vsql prompt to confirm schema name.
      • <ProfileID> with the ID identified earlier.
  4. Run the following curl statement on the CLI of any host with DA access to change the SNMP Profile it uses.
    • curl -v -u <userName> -X PUT -H 'Content-type: application/xml' -d '<ManageableDevice version="1.0.0"><SNMPProfileID><ProfileID></SNMPProfileID><SNMPProfileVersion><version></SNMPProfileVersion></ManageableDevice>' <scheme>://<DA_HostName>:<Port>/rest/devices/manageable/<deviceItem_ID>
    • Replace these values:
      • <userName> with a valid Portal web UI user that has Adminstrator Role access.
      • <ProfileID> with the ID identified earlier.
      • <version> with the SNMP version to set.
        • Using SNMPv2? Use the value:
          • SNMPV2c
        • Using SNMPv3? Use the value:
          • SNMPV3
      • <scheme> with the configured scheme. Default is http.
      • <DA_HostName> with the DA host name or IP address.
      • <Port> with the configured DA port. Default is 8581.
      • <deviceItem_ID> is the Item_ID of the device from the DR DB query in step 3.
      • Enter the Portal web UI users password when prompted.
    • Example query for SNMPv2 and admin user with example IDs used.
      • curl -v -u admin -X PUT -H 'Content-type: application/xml' -d '<ManageableDevice version="1.0.0"><SNMPProfileID>123456</SNMPProfileID><SNMPProfileVersion>SNMPV2c</SNMPProfileVersion></ManageableDevice>' http://DataAggregator:8581/rest/devices/manageable/987654
    • Example query for SNMPv3 and admin user with example IDs used.
      • curl -v -u admin -X PUT -H 'Content-type: application/xml' -d '<ManageableDevice version="1.0.0"><SNMPProfileID>456456</SNMPProfileID><SNMPProfileVersion>SNMPV3</SNMPProfileVersion></ManageableDevice>' http://DataAggregator:8581/rest/devices/manageable/987654

Additional Information

To do this in bulk create a script to run the curl commands, passing the required values for each target device.