how to use the uim api - ca technologies global · pdf file · 2016-09-143 ©...

16
1 © 2014 CA. ALL RIGHTS RESERVED. HOW TO USE THE UIM API

Upload: duongphuc

Post on 07-Mar-2018

495 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

1 © 2014 CA. ALL RIGHTS RESERVED.

HOW TO USE THE UIM API

Page 2: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

2 © 2014 CA. ALL RIGHTS RESERVED.

TOPICS

API Overview

PDS – Portable Data Stream

Probe Utility

PU.EXE

LUA in the NAS

UMP REST API

Page 3: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

3 © 2014 CA. ALL RIGHTS RESERVED.

UIM API OVERVIEW

UIM tenet #7: “Anything that can be done through a UI, can also be done programmatically”

API and SDKs available for UIM:

REST webservice SOAP webservice Perl SDK Java SDK .Net SDK Command line (PU.EXE) C, C++, C#, VB, VBScript, Lua

Page 4: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

4 © 2014 CA. ALL RIGHTS RESERVED.

PDS - PORTABLE DATA STREAM

Page 5: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

5 © 2014 CA. ALL RIGHTS RESERVED.

PDS – JAVA

NimUtility.displayPDS(pdsVariable); – This will print the output of the PDS in a readable format

NimRequest req = new NimRequest(“probeaddress”, “callback”, arguments)– Arguments are in PDS form.

PDS args = new PDS();

args.putString(“key”, “value”);

Return values by using pdsVariable.getString|Int(“key”);

PDS can return tables

Page 6: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

6 © 2014 CA. ALL RIGHTS RESERVED.

PDS – LUA

req = nimbus.request(“probeaddress”, “callback”, arguments)– Arguments are in PDS form.

args = pds.create()

Pds.putString(args, “key”, “value”);

Return values by looping through returned table– for k,v in pairs(req) do

– print (k .. “ “ .. v)

– end

Page 7: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

7 © 2014 CA. ALL RIGHTS RESERVED.

The Probe Utility accesses callbacks on probes and directly connects to internal hooks to force actions

Each probe supports multiple callback actions

Exploring these is the best way to learn them

PROBE UTILITY

Page 8: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

8 © 2014 CA. ALL RIGHTS RESERVED.

PU.EXE COMMAND LINE UTILITY

Usage: pu [options] <nim-address> [command] [data]-i interactive mode -u user user name -p password NMS passwd-s SID Valid SID-t sec timeout in seconds-H host use probe host-P port use probe port-d level set debug level-L list commands on probe-I show probe info-R restart probe-S stop probe

Usage of pu.exe is notonly for returning values,but also changing creds,deploying entire probes, or changing behavior

Running these types of commands from within a batch or PERL script and feeding in lists can result in high caliber automation and even touch-less administration

Page 9: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

9 © 2014 CA. ALL RIGHTS RESERVED.

To start a windows service: pu -u <user> -p <password> <Address> start_service <servicename>

To stop a windows service: pu -u <user> -p <password> <Address> stop_service <servicename>

Where: <user> is a Nimsoft user <password> is the password associated with the Nimsoft user <Address> is the Nimsoft address of the ntservices probe <servicename> is the name of the service

Format of Nimsoft address: /domain/hub/robot/ntservices

RESTART A WINDOWS SERVICE WITH PU.EXE

Page 10: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

10 © 2014 CA. ALL RIGHTS RESERVED.

LUA AND THE NAS

LUA Basics PDS args

nimbus.request()

Looping through tables

Interact with Alarms alarm.get()

alarm.list()

Examples: Interacting with Probes Add note/annotation script

Page 11: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

11 © 2014 CA. ALL RIGHTS RESERVED.

UMP REST API

REST API runs inside Wasp (UMP)

Uses Basic HTTP authentication Production Note: Configure Wasp to use HTTPS

Respects http accept header – returns xml/json/text

Endpoint is http://ump_host/rest

Wadl describes available services

Page 12: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

12 © 2014 CA. ALL RIGHTS RESERVED.

REST API EXAMPLES FOR PROVISIONING

Check if a probe is installed

Deploy a robot using a callback to ADE

Deploy a probe using a callback to distsrv

Retrieve current probe configuration

Configure a probe

Get alarms

Get performance data

Page 13: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

13 © 2014 CA. ALL RIGHTS RESERVED.

USE REST API TO VERIFY PROBE INSTALLATION

/probe/{domain}/{hub}/{robot}/{probe}/info

Command: curl -v -u api:CAdemo123

http://ump.nimsoft.com/rest/probe/Nimsoft-Monitor/WorldWideHQ/usildodnimms1/cdm/info | xmllint

Output:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><probeinfo>

<company>Nimsoft Corporation</company><connections>506</connections><libDate>Jun 12 2012</libDate><libVersion>6.01 (64bit)</libVersion><messages>4</messages><name>cdm</name><started> 2014-05-02T17:59:41-04:00</started><version>4.70</version>

</probeinfo>

Page 14: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

14 © 2014 CA. ALL RIGHTS RESERVED.

USE REST API TO DEPLOY A ROBOT

POST to /probe/{domain}/{hub}/{robot}/{probe}/{callback2}/submit_job

Page 15: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

15 © 2014 CA. ALL RIGHTS RESERVED.

USE REST API TO DEPLOY A PROBE

POST to /probe/{domain}/{hub}/{robot}/{probe}/{callback2}/submit_job

Page 16: HOW TO USE THE UIM API - CA Technologies Global · PDF file · 2016-09-143 © 2014 CA. ALL RIGHTS RESERVED. UIM API OVERVIEW UIM tenet #7: “Anything that can be done through a UI,

16 © 2014 CA. ALL RIGHTS RESERVED.

USE REST API TO CONFIGURE A PROBE

Get current configuration: curl -v -u api:CAdemo123

http://ump.nimsoft.com/rest/probe/Nimsoft-Monitor/Worldxxxxxx/usildodnimms1/cdm/config

Modify / add configuration: curl -v -u api:CAxxxxxxx -X PUT -H "Content-Type:

application/xml" -d "<probeConfigKeys><configkey><key>/cpu/alarm/error/threshold</key><value>42</value></configkey><configkey><key>/cpu/alarm/warning/active</key><value>no</value></configkey></probeConfigKeys>" http://ump.nimsoft.com/rest/probe/Nimsoft-Monitor/Worldxxxxxx/usixxxxxxxx/cdm/config