9. Uses of Discovery Services in LDMS 2017.1
1. Ivanti License Optimizer
§ Requires the purchase of License Optimizer
§ Concorde Core Control Agent installed separately
2. ServiceDesk Adhoc Queries (Windows Console)
3. ServiceDesk Importer (Windows Console)
4. ServiceDesk Adhoc Queries (Workspaces, disable by default)
5. âŠAlso, write your own app to the Discovery Services odata API
10. LDMS & Discovery Services Architecture
LDMS
DB
( M S S Q L
C o m p u t e r
T a b l e s )
ldinv32
I n v e n t o r y
S c a n s
API
Reconciler
Normalizer D i s c o v e r y
D B
( J S O N i n
E l a s t i c S e a r c h )
Workspaces
SCNinqueue
(ldlscan)
scn2json
JSONinqueue
N o d e . j s
ldinv32,postcgi
IISorother
l d a p i ( I I S )
Windows
Console
W e b S e r v i c e s
( I I S ) & D B
D r i v e r s
DataServRESTAPI
SCANSinqueue
(DiscoveryStorage)
W o r k s p a c e s
D B
( M S S Q L )
35. Data Object Model
§ Data is entered and retrieved as JSON documents
§ Includes: device info, system configuration, scheduler, etc
§ Nesting of objects is allowed
§ Can dynamically extend the schema at any time
§ Once a type is assigned to a property, it is fixed
§ Exception is metadata which is XML in OASIS format
§ XML Namespace Document for OData Version 4.0
§ http://docs.oasis-open.org/odata/ns/edm
§ https://localhost/discovery/api/v1/$metadata
§ In the system, information is maintained indicting where the data
came from and changes over time.
36. Minimal Device Data Example
{
"DeviceID": "{E54E1391-2BB8-0E48-B54D-BE99497358C5}",
"DiscoveryId": "AVgwRZjJCN2US9MUJEy8",
"DeviceName": "XPCOMP2",
"OS": {
"Version": "5.1",
"Name": "Microsoft Windows XP Professional"
},
"Network": {
"TCPIP": {
"Address": "10.16.227.239"
}
},
"System": {
"Model": "VMware Virtual Platform"
}
}
38. API Overview
§ Follows the LANDESK RESTful API Specification
§ RESTful Web API + OData
§ In production environments:
§ HTTPS Only, no HTTP
§ Authentication required
§ Compatible with any client that can GET/POST HTTPS
§ OAuth 2.0 Authentication
§ Postman for Chrome recommended for instructive &
troubleshooting purposes
40. API Security
§ All requests done via HTTPS
§ Types of authentication
§ STS SAML (Old Method â Not Recommended)
§ Retrieve SAML token from: https://localhost/sts/isstoken
§ Use a JSON Viewer / formatter to âunescapeâ string
§ Include in Authorization header
§ Identity Server JWT (New Method â Recommended)
§ OAuth 2.0 Authentication
§ Include in Authorization header
§ Developer Mode (i.e. No authentication)
§ Authorization header still required but can be any string
§ Suggest use for lab or developer use, NOT production.
41. API Security - OAuth 2.0 Example in Postman
Show token details: https://jwt.io/
*Use with Caution. Not for
production environments.
42. Inserting Data
§ All data added has specified:
§ Type
§ Provider origin
§ POST https://localhost/discovery/api/v1/[type]/[provider]
§ type: type of data provided. e.g. device
§ provider: name of the provider posting data.
§ e.g. LDMS-hardware, LDMS-software
§ Body formatted as JSON document
43. Inserting Data (Cont)
§ Built-in LDMS Inventory Data Collectors
§ runCollectFromCore: Pull from LDMS DB
§ runCollectFromDiscoveryStorage: Pull from LDMS folder
§ runCollectFromSCN: Read SCN files from any folder
44. Inserting Data - POST Example
§ POST https://localhost/discovery/api/v1/device/providerexample
§ Body:
{
"DeviceID": "{2E08D59B-57C6-664F-8B2A-7302BC400C23}",
"Name": "LMEMMOTT-WIN7B",
"Type": "Workstation",
"Network": {
"TCPIP": {
"Address": "010.016.228.249"
}
}
}
45. Inserting Data - Another POST Example
§ POST https://localhost/discovery/api/v1/pizza/mypizzaprov
§ Body:
{
"Type": "Chicago",
"Size": "Large",
"Topping": "Pepperoni",
"Cheese": "Regular"
}
46. Inserting Data (Cont)
§ Data Normalization
§ Left-hand Rules: Change schema
§ Right-hand Rules: Format values
§ Data Reconciliation
§ Purpose: Is this a device the system has seen before?
§ If so, merge or replace
§ If not, add
§ If not enough data, reject
§ Rules based that are run in priority order
47. Retrieving Data
§ Data returned as JSON documents using HTTP GET
§ https://localhost/discovery/api/v1/device
§ Query interface supports:
§ Metadata
§ Select, Column Sets & Count
§ Filters
§ Pagination
§ Order By & Group By
§ Aggregation
§ Provider Priority Order
§ Historical Data
48. Retrieving Data (cont)
§ Data returned as JSON documents using HTTP GET
§ https://localhost/discovery/api/v1/device
§ Metadata
§ https://localhost/discovery/api/v1/$metadata
§ Select & Expand
§ https://localhost/discovery/api/v1/device?$select=DiscoveryId
§ https://localhost/discovery/api/v1/device?$select=Network
§ https://localhost/discovery/api/v1/device?$select=Network,OS
§ https://localhost/discovery/api/v1/device?$expand=Network,OS
§ Column Sets
§ https://localhost/discovery/api/v1/device?$colset=default
§ https://localhost/discovery/api/v1/device?$colset=all
§ https://localhost/discovery/api/v1/device?$colset=abc
49. Retrieving Data (cont)
§ Filters
§ https://localhost/discovery/api/v1/device?$filter=DiscoveryId eq
'AViTEQOgycQLu_owMy8S'
§ Also: eq, ne, lt, le, gt, ge
§ https://localhost/discovery/api/v1/device?$filter=endswith(DeviceID,'dd0}')
§ Also: endswith(), startswith(), contains()
§ Pagination: Top & Skip
§ https://localhost/discovery/api/v1/device?$top=1&$skip=1
§ Order by
§ https://localhost/discovery/api/v1/device?$orderby=DisplayName asc
§ Aggregation
§ https://localhost/discovery/api/v1/device?$apply=aggregate(Processor.Speed
with max as SpeedMax)
§ Includes: sum, countdistinct, average, min, max, count
50. Retrieving Data (cont)
§ Group by
§ https://localhost/discovery/api/v1/device?$apply=groupby((Processor.Typ
e))
§ Count
§ https://localhost/discovery/api/v1/device/$count
§ Provider Priority order
§ https://localhost/discovery/api/v1/device?$providerOrder=LDMS-
hardware,LDMS-software,iQuate
51. Retrieving Data (cont)
§ Changes over Time Recorded in the system
§ Deltas
§ https://localhost/discovery/api/v1/history/device/removed
§ https://localhost/discovery/api/v1/history/device/added
§ https://localhost/discovery/api/v1/history/device/changedTo
§ https://localhost/discovery/api/v1/history/device/changedFrom
§ https://localhost/discovery/api/v1/history/device/added,changedTo
§ âŠalso combine with filter criteria
§ Snapshots
§ WIP
52. Misc: Configuration Settings
§ Configuration settings installed via JSON files, imported to the DB
and then available through the API
§ https://localhost/discovery/api/v1/config
§ https://localhost/discovery/api/v1/config/logger.config/
§ https://localhost/discovery/api/v1/config/logger.config/level
§ Use runImportConfigFiles.js to import from files system
§ Also, post updates through API
53. Misc: Logs
§ Log info available through the API
§ https://localhost/discovery/api/v1/logs
§ https://localhost/discovery/api/v1/logs/runCollectFromCore
54. Misc: Script Scheduler
§ JS Script scheduler built into the system as a Windows Service
called âLANDESK Script Schedulerâ
§ Uses cron notation for the schedule
§ Configured Tasks:
§ https://localhost/discovery/api/v1/config/scheduler.config/
§ Current task status:
§ https://localhost/discovery/api/v1/scheduledjobs
55. Performance Stats
§ Performance stats available for tasks
§ Examples:
§ https://localhost/discovery/api/v1/resources?$filter=stats*
§ https://localhost/discovery/api/v1/resources/stats/runCollectFromC
ore.lmcore101vm.latest.stats.json
§ https://localhost/discovery/api/v1/resources/stats/runCollectFromC
oreDiscoveryStorage.lmcore101vm.latest.stats.json
56. Other Related Sessions at Interchange 2017
§ AMB130 - Discovery â The Foundation of Any Asset Management
Solution (Wednesday at 10:45 AM)
§ AMB50 - State of the Union: Ivanti IT Asset Management (Tuesday
at 3:15 PM and 4:30 PM)