Summary
This document describes a custom perl script that you can use to run discovery using command line. You will need the name of the discovery profile, username and password for DA rest client.
Background
Although there is a scheduling option for managing discovery profiles, this script will give more flexibility for running discovery profiles.
Approach
A Perl script is provided, that kick starts discovery.
This script can be run from any machine which has Strawberry perl and a valid connection to Data Aggregator using rest client.
1. Issue aHTTP PUT to http://<dahost>8581/rest/tenant/<daTenantId>/discoveryprofiles/<daDiscoveryProfileId> with the following content:
Body:
<DiscoveryProfile version="1.0.0">
<RunStatus>START</RunStatus>
</DiscoveryProfile>
2. Print discovery status as Discovery complete if a "200 OK" is the return content in the PUT
Check the status of a discovery
You can periodically check the status of a running discovery.
1. Issue an HTTP GET to http://<dahost>8581/rest/discoveryprofiles/<daDiscoveryProfileId>.
2. Check the “RunStatus” value in the response. A “READY” or “SCHEDULED” status means that the discovery is complete.
Prerequisites
- Perl installed (tested with Strawberry Perl 5.18)
- Perl modules REST::Client, XML::Simple, MIME::Base64;
- access to the Data Aggregator REST webservice http://DA:8581/rest
Support
There is no support for this script. It has to be run at YOUR risk. See terms and conditions before running this script here (Terms for User sites - CA Technologies). Please email Seenu_Mathew (seenu.mathew@ca.com) for any feedback on this script.
Usage of runDiscovery.pl is as follows
-h <hostname or ip address of CA Data Aggregator + port> eg: dahost:8581
-u <Username that has access to DA (usually admin)>
-p <Password>
-n <Name of Discovery Profile>
Example:
1. perl runDiscovery.pl -h DataAggregatorHostname:8581 -user admin -pass admin -n "Routers DiscProfile""
The above command will run the discovery profile with the name Routers DiscProfile on the default tenant with id 1