VMware Cloud Community
jarushepic
Enthusiast
Enthusiast
Jump to solution

get process list from guest

I'm trying to build a synchronous run program in guest (linux) since for some ridicules reason vRO doesn't provide this out of the box.  All I need to do is figure out how to check if the exitCode or endTime of a process is null/undefined and I can't seem to figure out what it wants.

The process list task returns an array of:

{pid:number, name:string, owner:string, cmdLine:string, startTime:Date, endTime:Date, exitCode:number}

If I iterate over the return value,  I can System.log(pid.exitCode) or pid[exitCode] and it says "__NULL__".  If I try and do something like: if (pid.exitCode === null) ... or undefined ... it tosses out this error code:

Invalid JavaScript value of type ch.dunes.model.type.TypeConverter$NullObject

How can I check to see if endTime or exitCode are populated?  once they have actual values I'll be able to assume the process has ended.

Reply
0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Rather than building out all this logic yourself, have you tried out the Guest Script Manager package we released here in the communities? If I'm not mistaken it already has code built in to handle what you are describing:

Guest script manager package

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

Reply
0 Kudos
3 Replies
Burke-
VMware Employee
VMware Employee
Jump to solution

Rather than building out all this logic yourself, have you tried out the Guest Script Manager package we released here in the communities? If I'm not mistaken it already has code built in to handle what you are describing:

Guest script manager package

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Reply
0 Kudos
jarushepic
Enthusiast
Enthusiast
Jump to solution

I didn't know it existed.  Is there some centralized "app store" like thingy where I should be looking for these types of things?  What you did is the sort of thing I expected to be "built-in".  My workflow works, but your's is better, so I'll use that Smiley Happy  thanks.

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Communities documents and flowgrab.com is where you will find a lot of these packages.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos