How to find which user id used to discover server

Hi All,

We have added multiple user profile for server discovery. Is there any way to find which profile is used for discovery. 

Regards,

Sridhara.

  • Suggested Answer

    Hi Sridhara,

    There are no OOTB reports that can provide such information. You may use the following approach. 

    • In the InfrastructureElement CI type, there is an attribute credentials_id. For some CIs, like ntcmd, ssh, it holds the id of the credentials used for discovery. You can create a view by importing the TQL and View from the attached file. 
    • Run the report. It will show you a list of credential id and the nodes discovered by them.
    • You can use either the REST API /dataflowmanagement/credentials (GET) or JMX method exportCredentialsAndRangesInformation to find the credential name corresponding to the id. 

    Nodes discovered by credentials.zip

    Hope it helps.

    Thanks,

    Leslie

  • Hi Leslie,

    Thanks for providing xml file for query and view. When I saw preview of report I am getting just empty values as in below snap.

    Regards,

    Sridhara.

  • It's weird. The view has a condition on the Agent query node to return agents whose crednetial_id is not null. What is the UCMDB version? Could you make the "Reference to the credentials dictionary entry (credentials_id)" attribute visible and check what is the value in CIs? 

  • Hi Leslie,

    UCMDB version is 2022.05. I could not find attribute "Reference to the credentials dictionary entry (credentials_id)" in report to make it visible.

    Regards,

    Sridhara.

  • The attribute is in the InfrastructureElement CI Type. Please go to CI Type Manager to locate the attribute and make it visible. 

  • Hi Leslie,

    I have made the attribute as visible and added to report and it is coming blank.

    Regards,

    Sridhara.

  • Verified Answer

    Hi Sridhara,

    The credential_id is populated to the agent CIs rather than nodes so that the report will not show it. Please import the query attached to your env. In the Modeling Studio, you preview it and open the properties of any agent in the preview result. Check what is the value in the 'Reference to the credentials dictionary entry' attribute.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <resource:XmlResourceWrapper xmlns:resource="http://www.hp.com/ucmdb/1-0-0/ResourceDefinition" xmlns:ns4="http://www.hp.com/ucmdb/1-0-0/PolicyRuleDefinition" xmlns:tql="http://www.hp.com/ucmdb/1-0-0/TopologyQueryLanguage" xmlns:ns3="http://www.hp.com/ucmdb/1-0-0/ViewDefinition">
        <resource xsi:type="tql:Query" name="Agents with credential id" is-active="false" priority="low" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tql:node class="agent" name="Agent" id="11">
                <tql:where>
                    <tql:properties>
                        <tql:not>
                            <tql:is-null>
                                <tql:property-ref name="credentials_id"/>
                            </tql:is-null>
                        </tql:not>
                    </tql:properties>
                    <tql:data-stores>
                        <tql:data-store>UCMDB</tql:data-store>
                    </tql:data-stores>
                </tql:where>
                <tql:content>
                    <tql:properties>
                        <tql:property name="display_label"/>
                        <tql:property name="credentials_id"/>
                    </tql:properties>
                </tql:content>
            </tql:node>
        </resource>
        <resourceBundle>integration_tqls_bundle</resourceBundle>
    </resource:XmlResourceWrapper>
    

    Thanks,

    Leslie

  • Hi Leslie,

    Thanks much for providing queries and View. I am able to extract the node discovered credential ID details.

    Regards,

    Sridhara.

  • Glad to see it works. You may mark this as Verified Answer. Slight smile