Date post: | 15-Apr-2017 |
Category: |
Technology |
Upload: | ca-technologies |
View: | 131 times |
Download: | 0 times |
World®’16
CAWorkloadAutomationDE&ESPEdition:SomeNovelUsesfortheESPmgr UtilityJohnRooney,CATechnologies,Sr.PrincipalConsultant
MFX32E
MAINFRAMEANDWORKLOADAUTOMATIONCONTENTAREA
2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.
Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.
ForInformationalPurposesOnlyTermsofthisPresentation
3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Abstract
ESPmgr isacommand-lineAPIsuppliedwithanagent.YouuseESPmgr tosenda
messagetoeitherCAWorkloadAutomationESP(CAWLAESP)orCAWorkload
AutomationDE(CAWLADE)fromtheagentplatform.Themessagecantellthe
servertoperformanactiononajoborApplication,suchasreleasingan
ApplicationorinsertingajobintoanApplicationoreventosetthestateofa
workloadobject.ThissessionwillgothroughsomeexamplesofusingESPmgr to
docommonthingslikecontrollingworkloadaswellastouseESPmgr tocreate
yourown3rd partyintegrationtoothersoftwarelikefiletransferproducts.
JohnP.RooneyCATechnologiesSr.PrincipalConsultant
4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Agenda
SYNTAXOFTHEESPMGR COMMAND
SECURINGTHEUSEOFESPMGR
CREATINGYOUROWNAGENTINTEGRATION
SUMMARY
1
2
3
4
5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ESPmgris…
§ BundledinwithallCAWorkloadAutomationSystemAgents
§ ESPmgr.exemustberunusingexecutableinpathoftherunningAgentthattheAutomationFrameworkMessage(AFM)istobesentthrough
§ UsedtosendmessagestotheWorkloadManagerbycreatinganAFM
§ TheAFMcaninstructaWorkloadManagerto:– Performanaction
§ ActonaWorkloadObject(WOB)inanapplication:Complete,Bypass,Insert
§ NotifytheWorkloadManagertochangetheStateofaWOB
§ Canberunfromthecommandlineorembeddedinscriptsbeingrunbytheagentorrunningoutsidethescopeoftheagent
6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ScriptingESPmgr
§ Theseenvars aremadeavailabletoWOBsrunningbyaCAWLASystemAGENT:– ESPAPPLMGR:theCAWLAESPorCAWLADEservername– ESPAGENTDIR:pathtoagentandESPmgr executable– ESPAGENT:nameofAgent– ESPAGENTPORT:Agentreceiverport– ESPAPGENGenerationnumberoftheApplication– ESPAPPLNameoftheApplication– ESPOBJECTFullyqualifiedpathnameofthejob– ESPWOBNameofthejob
7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ExampleofexecutionfromwithinanAgentSpawnedscript"%ESPAGENTDIR%\ESPmgr""Windowsjob.1/%ESPAPPL%.%ESPAPGEN%/MAINACTIONINSERT
Userid(user.roojo02)Type(NT)Rununit(JPRR1134)Container(%ESPAPPL%~~)
Command('c:\scripts\dseriesr113\sleep.bat')Args('10')"
8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
WhenExecutingoutsideofanAgentspawnedscript
Youneedtosettwoenvironmentvariables:
§ setESPAPPLMGR=CM_CAESP21– TellstheAgentwhichWorkloadManagertosendthemessage
§ setESPAGENTDIR=C:\ProgramFiles\CA\WAAgentR11.3.4– IdentifiestheAgentdirectory
NOTE:Bothoftheseparametersareautomaticallysetwhenexecutingascriptthroughanagent
9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ExampleWindowsscripttoexecutefromoutsidetheAgentREMChangethefollowingservicenametotheappropriateManager
setESPAPPLMGR=DSERIES113
REMChangethefollowingdirectorytotheagentdirectory
setESPAGENTDIR=C:\ProgramFiles\CA\WorkloadAutomation_R12\ESPSystemAgent
"%ESPAGENTDIR%\ESPMgr""Windowsjob.1/ADHOC.0/MAINACTIONINSERTUserid(user.JPR)Type(NT)Rununit(JPRR1134)Container(ADHOC~~)Command('c:\scripts\dseriesr113\sleep.bat')Args('10')"
10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ESPmgr “objectname verbsubverb[(keyword)]”
§ objectname– FullyqualifiednameoftheWOBtowhichtheAFMitdirectedto
§ verb– Indicatesactiontobetaken:ACTIONorSTATE
§ subverb– Furtherdefinesactiontobetaken
§ keyword– Modifiesverb/subverb combination
11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
objectname
jobname[.qualifier]/applname.applgen/MAIN
§ jobname[.qualifier]– nameofWOBinapplicationthatistargetAFM
§ applname.applgen– Applicationnameandapplicationgenerationnumberthatistargetof
AFM
§ MAIN– fixed
12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPandCAWLADE
§ VerbsandSubverbsMAYBEdifferentforAFMsdirectedtodifferentWorkloadManagers
§ Comprehensivedocumentationandsamplesexistforeachinthesebooks:– DE12.0:
§ https://docops.ca.com/ca-wla-de/12-0/en/reference/espmgr-utility– CAWLAESP11.4:
§ https://docops.ca.com/ca-workload-automation-esp-edition/11-4/reference/commands/espmgr-command-send-a-message-from-an-agent-version-2-0-or-higher
13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
verbs
§ Twochoices:– ACTION
§ Beginsdescriptionofchangestobemadetoobjectname– STATE
§ Beginsdescriptonofchangestobemadetostateofobjectname
14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ACTIONsubverbexamples
§ BYPASS|UNBYPASS§ DROPDEP§ HOLD§ INSERT§ READY§ RELEASE§ REQUEST|UNREQUEST§ RESET§ RESUB§ SET§ UNWAIT
15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
STATEsubverb examples
§ Activate§ Alert§ COMPLETE§ Cmpc(code)§ EXEC§ FAILED§ Intvrq§ Jobid(id)§ …manyothers(exampleslater…)
16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
keywords
§ Therearefartoomanytotalkaboutinthetimeallowedustoday
§ Keywordsare:– TargetServerdependent– CaseSensitive!
§ Keepcopiesofthedocumentationlistedafewscreensagohandy!
17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ExampleswherethesyntaxisexactlythesameforCAWLAESPandCAWLADEESPMgr "Win_test1/WINTEST.0/MAINSTATERUNNING
UserStatus(Someusefulinformation)“
ESPMgr "Win_test2/WINTEST.0/MAINACTIONHOLD“
ESPMgr "Win_test2/WINTEST.0/MAINACTIONRELEASE“
ESPMgr "Win_test2/WINTEST.0/MAINACTIONRESUB“
ESPMgr "Win_test2/WINTEST.0/MAINACTIONDROPDEPPRED(Win_test1)“
ESPMgr "Win_test1/WINTEST.0/MAINACTIONCOMPLETE"
18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Examplesofwherethesyntaxisdifferent
§ CAWLAESP
ESPMgr "Windowsjob.2/ADHOC.0/MAINACTIONINSERTType(NT)Statements(AGENTJPRR1134;CMDNAME
C:\Scripts\sleep.bat;ARGS10)"
§ CAWLADE
ESPMgr "Windowsjob.1/ADHOC.0/MAINACTIONINSERTUserid(user.JPR)Type(NT)Rununit(JPRR1134)
Container(ADHOC~~)Command('c:\scripts\dseriesr113\sleep.bat')Args('10')"
19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Troubleshooting§ Codekeywordsastheyaredocumented– CASEMATTERS
– Iftheactionyouinitiateddidnotoccurthiswilllikelybethecause!
§ Keepthedocumentationhandy
§ FollowtheAFMthroughthe:– AgentTransmitterlog– CAWLAESPAuditlog– CAWLADEtracelog
§ Alwaysuseabsolutegenerationnumbersinthetargetname
§ Ifscriptedlookinspoolfileforerrormessages– Checkyourenvironmentvariables
20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESP- MAPUSERCommandMapAgentSystemUserIDtoMainframeUserID
TheMAPUSERcommandmapsanagentsystemuserIDtoamainframeuserID.ThismappingisusedforauthorizingmessagessenttoCAWLAESPEditionusingtheESPmgrcommandusingthemainframesecurityrules.
Type
Sub-commandtotheLOADAGDFcommand.CodetheMAPUSERcommandintheAGENTDEFdatasetonthemasterandissueLOADAGDF.
21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESP- MAPUSERCommandMapAgentSystemUserIDtoMainframeUserID
SyntaxMAPUSER agentid TO(mainframeid)|SAFUSER(mainframeid) AGENT(agentname)
§ agentidSpecifiestheidentificationofauserloggingontoanAgent.Thisoperandiscasesensitiveandsupportswildcards.Ithasamaximumlengthof32alphanumericcharacters.
§ TO(mainframeid)|SAFUSER(mainframeid)TSOuserIDtobeusedforsecuritychecks.TOisequivalenttoSAFUSER
§ AGENT(agentname)NameoftheAgenttowhichthismappingapplies.
§ Example:MAPUSERCommandInthefollowingexample,CAWLAESPEditionisinstructedtouseCYBJD01forsecuritycheckswhenitseestheuserJDOElogonfromAgentTORSUN1:
MAPUSER JDOE SAFUSER(CYBJD01) AGENT(TORSUN1)
22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SpecifyingtheMAPUSERparameterinAGENTDEF
23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SpecifyingaseparatemappedUSERID
24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
BeforeandaftermessagesonaJobInsert
Before:
JPRR1134 JOB5.8/ADHOC.0/MAIN ACTION INSERT Type(NT) Statements(AGENT JPRR1134; CMDNAMEC:\Scripts\sleep.bat; ARGS 10) LocalUser(roojo02) User(JPRR1134) Host(ROOJO02W7)APPL ADHOC.2260 JOB JOB5.8 INSERTED BY ROOJO02
After:
JPRR1134 JOB5.9/ADHOC.0/MAIN ACTION INSERT Type(NT) Statements(AGENT JPRR1134; CMDNAME C:\Scripts\sleep.bat; ARGS 10) LocalUser(roojo02) User(JPRR1134) Host(ROOJO02W7)APPL ADHOC.2260 JOB JOB5.9 INSERTED BY CAWAPS
25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLADEsecurityforESPmgr
§ Thelocaluser executingthescriptmustbedefinedtoCAWLADEsecurityandhavetheauthoritytodotheaction
2016100523:05:58.863[dm:controlobject][INFO]DM.InputProcessor_110:[2016-10-05_23:05:58.862]ReceivedresponsefromAgentAGENT forwob "/MAIN/ADHOC.0/WINDOWSJOB.2"response:2016100523055885+0400DSERIES113AGENTWINDOWSJOB.2/ADHOC.0/MAINACTIONINSERTUserid(user.JPR)Type(NT)Rununit(JPRR1134)Container(ADHOC~~)Command('c:\scripts\dseriesr113\sleep.bat')Args('10')LocalUser(roojo02)User(AGENT)Host(ROOJO02W7)
26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CreateyourownApplicationIntegrationusingESPmgr
§ ESPmgr enablesyoutosetaStateforaWOB
§ Youcancreateyourown“States”ifyouwant– Critical,Transfer,ON_ICE,etc…
§ OnceaWOBisplacedintoa“COMPLETE”State,itcan’tbechanged
27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Examplesofsettingstatusanduserstatus
"%ESPAGENTDIR%\ESPmgr""DUMMY/%ESPAPPL%.%ESPAPGEN%/MAINStateRUNNINGStatus(RUNNING)UserStatus('RUNNINGalongwithsomelonguserstatus message')"
"%ESPAGENTDIR%\ESPmgr""DUMMY/%ESPAPPL%.%ESPAPGEN%/MAINStateCRITICALStatus(CRITICAL)UserStatus(CRITICAL)"
"%ESPAGENTDIR%\ESPmgr""DUMMY/%ESPAPPL%.%ESPAPGEN%/MAINStateON_ICEStatus(ON_ICE)UserStatus(ON_ICE)"
"%ESPAGENTDIR%\ESPmgr""DUMMY/%ESPAPPL%.%ESPAPGEN%/MAINStateCOMPLETEStatus(COMPLETE)UserStatus(COMPLETE)"
28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
SubtledifferencewhensettinganWOBtoFAIL(ed)
CAWLADE-
"%ESPAGENTDIR%\ESPmgr""DUMMY/%ESPAPPL%.%ESPAPGEN%/MAINStateFAILED Status(FAILED)UserStatus(FAILED)Reason(Failed)“
CAWLAESP–"%ESPAGENTDIR%\ESPmgr""DOBJ1/%ESPAPPL%.%ESPAPGEN%/MAINStateFAILStatus(FAIL)UserStatus(FAIL)"
29 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ConsidercreatingyourownAgentIntegration
§ ThesefourfieldsareeasilyupdatedbyusingESPmgr– State– Status– Tag– Userstatus
§ CanbeusedforMonitoringandDisplaypurposes
30 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
TheLengthsofthefourfieldsincharactersandothernotes§ CAWLADE
– State:64– Status:1024– HistorywillshowTextbeforeCompleteAction– Tag:128– HistorywillshowTextbeforeCompleteAction– User_status:128– HistorywillshowTextbeforeCompleteAction
§ CAWLAESP– State:8– Status:28– DoesnotshowupinHistoryFile– Tag:16– TextcanbeupdatedonsamecommandtoComplete– Userstatus:28– TextcanbeupdatedonsamecommandtoComplete
31 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
ESPmgr enablesupdatinganyWorkloadObjectandsettingtheStateforthatObject§ UseCAWLAESPandCAWLADEasa“STATEMACHINE”
§ SuggestionistouseaTASK– Itisamanualtypeofworkloadobject– Don’thavetoworryaboutitexecuting
§ CAWLAESPalsohasaDataobj thatcanbeusedforupdates– Thedataobj actsasthejobexecutionhistoryrepository
32 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPExampleofcreatinga“StateMachine”
33 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
AnexampleofdisplayingthecontentsofanCAWLAESPDataobjecho.echoUpdatetheWOBdataobjecttostarttrackingactivitiesecho."%ESPAGENTDIR%\ESPmgr""RUNTEPMFTLOG/%ESPAPPL%.%ESPAPGEN%/MAINACTIONSETMFTBEGINlOG('MFTOutboundbeginninglog')""%ESPAGENTDIR%\ESPmgr""RUNTEPMFTLOG/%ESPAPPL%.%ESPAPGEN%/MAINACTIONSETMFTWOBAPGEN('%ESPAPPL%.%ESPAPGEN%')""%ESPAGENTDIR%\ESPmgr""RUNTEPMFTLOG/%ESPAPPL%.%ESPAPGEN%/MAINACTIONSETMFTWOBAPPL('%ESPWOB%')""%ESPAGENTDIR%\ESPmgr""RUNTEPMFTLOG/%ESPAPPL%.%ESPAPGEN%/MAINACTIONSETMFTtask0('listofprocessingstateforoutboundMFT')"
34 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPdisplayingFileTransferProgress
35 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPdisplayingaFileTransferthatfailed
36 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPdisplayingtheFileTransferhistoryintheDataobj
37 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPdisplayingtheCompletedFileTransfer
38 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLADEExampleofcreatinga“StateMachine”
39 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLADEdisplayingFileTransferProgress
40 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLADEdisplayingaFileTransferthatfailed
41 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
CAWLAESPdisplayingtheCompletedFileTransfer
42 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Summary
§ Atooltobeusedtoinsertworkload
§ Atooltobeusedtocontrolworkload
§ UsesCAWLAESPmainframesecurityforuserauthorization
§ UsesCAWLADEusersecurityforuserauthorization
§ CanbeusedtocreatecustomApplicationIntegrations
43 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Questions?
44 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
RecommendedSessionsSESSION# TITLE DATE/TIME
MFX31EBetterBigDataAnalyticswithCAWorkloadAutomationforHadoop
11/14/2016at3:00pm
JasmineB
MFX24EWobtrigs andFileTriggerswithCAWorkloadAutomationESPEdition
11/15/2016at11:00am
JasmineB
MFX33EBestPracticesforsettingupCAWorkloadAutomationESPApplicationProcedures
11/15/2016at1:00pm
JasmineB
MFX129SVisionandRoadmap:CAWorkloadAutomationESPEdition
11/16/2016at12:45pm
JasmineC
45 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
MustSeeDemos
ModernWorkloadAutomation
CAWLADEMFandWorkloadAutomation
SeamlessApplicationAutomationAgents&AdvancedIntegrationsMFandWorkloadAutomation
CAConversionasaService
CAWorkloadAutomationMFandWorkloadAutomation
Innovations:MainframeWorkloadAutomationCAWLAESPEditionMFandWorkloadAutomation
@CAWORLD#CAWORLD ©2016CA.AllRIGHTSRESERVED.46 @CAWORLD#CAWORLD
MainframeandWorkloadAutomation
FormoreinformationonMainframeandWorkloadAutomation,pleasevisit:http://cainc.to/9GQ2JI
47 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD
Thankyou
Stayconnectedatcommunities.ca.com