Extract All Devices with SNMP Profile Configured
search cancel

Extract All Devices with SNMP Profile Configured

book

Article ID: 204308

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

We have a requirement to be able to extract all devices with their associated SNMP profile. The string does not need to be human readable (we put the string in the name).

 

Environment

Release : 20.2

Component : CA Performance Center

Resolution

You can get all this information through REST on the Data Aggregator but not in one call.
 
1. Do a get in a REST client or go to the URL below. 

URL: <http://<DA>:8581/rest/devices/manageable/filtered>
Method: POST
Body:
<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd"> 
  <Select use="exclude" isa="exclude"> 
     <Item use="exclude"> 
        <Name use="include"/>
     </Item> 
     <Device use="exclude"> 
        <PrimaryIPAddress use="include"/> 
         <HostName use="include"/>
     </Device>
      <ManageableDevice use="exclude"> 
         <SystemName use="include"/>
         <SNMPProfileID use="include"/> 
     </ManageableDevice> 
  </Select> 
</FilterSelect> 

 That gets you primary IP, hostname, system name, profile id of all devices

Sample output for a device:

<ManageableDeviceList>
    <ManageableDevice version="1.0.0">
        <ID>49633</ID>
        <SNMPProfileID>121697</SNMPProfileID>
        <SystemName>Sim35421:green17</SystemName>
        <Device version="1.0.0">
            <PrimaryIPAddress>10.84.200.97</PrimaryIPAddress>
        </Device>
        <Item version="1.0.0">
            <Name>Sim35421:green17</Name>
        </Item>
    </ManageableDevice>

2. Then you can do a get or go directly to the profile URL '<http://<DA>:8581/rest/profiles/<SNMPProfileID>' For name of the profile. 

URL: <http://<DA>:8581/rest/profiles/121697>

<CommunicationProfile version="1.0.0">
    <ID>121697</ID>
    <UseForWrite>false</UseForWrite>
    <Rank>1</Rank>
    <ProfileName>default</ProfileName>
    <IsAlso>
        <IsA name="SNMPv1Profile" rootURL="profiles/snmpv1" />
        <IsA name="Syncable" rootURL="syncable" />
    </IsAlso>
    <CommunicationFailurePolicy version="1.0.0">
        <Retries>2</Retries>
        <Timeout>3000</Timeout>
    </CommunicationFailurePolicy>
</CommunicationProfile>

3. You can go into the profile type to get the community name (string) but its encrypted:

<http://<DA>:8581/rest/profiles/snmpv1/121697>
<SNMPv1Profile version="1.0.0">
    <ID>121697</ID>
    <CommunityName>QUVTOv2rU7kbjNnWycBidE9etgw=&#xD;
</CommunityName>
    <PortNumber>161</PortNumber>
    <IsAlso>
        <IsA name="CommunicationProfile" rootURL="profiles" />
        <IsA name="Syncable" rootURL="syncable" />
    </IsAlso>
    <CommunicationProfile version="1.0.0">
        <UseForWrite>false</UseForWrite>
        <Rank>1</Rank>
        <ProfileName>default</ProfileName>
    </CommunicationProfile>
    <CommunicationFailurePolicy version="1.0.0">
        <Retries>2</Retries>
        <Timeout>3000</Timeout>
    </CommunicationFailurePolicy>
</SNMPv1Profile>