Important This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 22.1 for BMC Helix Operations Management.

process()


Return a list of processes from the PATROL Agent process cache.

Syntax

process(regular-expression)

Parameter

Parameter

Definition

regular- expression

character sequence that defines the pattern the process() function searches for in the PATROL Agent process cache The regular-expression conforms to the regular expressions defined in the Unix ed(1) command description and the Unix regexp(5) description. Following is a brief summary of several regular expression characters: 
^ beginning of line 
$ end of line 
. match any single character 
* match zero or more repetitions of the preceding 
[] match any of the characters contained within 
[^] match any characters except those contained within

Description

The process() function returns the list of processes from the name and cmd columns in the PATROL Agent's process cache that match the regular expression regular-expression

Each entry in the list is a string formatted as follows:

pid ppid user status size cputime command_name command-line

 

Parameter

Definition

pid

process identifier number

ppid

parent process identifier number

user

user name to which the process belongs

status

process status within the system*Valid Values* 
0 nonexistent 
S sleeping 
W waiting 
R running 
I intermediate 
Z terminated 
T stoppedf 
X growing

size

process core image size Depending on the platform of the PATROL Agent, this measurement can be in blocks or kilobytes.

cputime

integer number of CPU seconds consumed by the process

command_name

first word of the command line that started the process

command-line

complete command line that started the process Note that the command line may have been modified during process execution.

Note

Some platforms do not support all the return values. For most platforms, the process() function returns the same information as the ps command. However, on Solaris, O signifies Running process on processor, R signifies Runnable process is on run queue. 

The process() function returns the NULL string if no processes match regular-expression. The process() function returns a question mark ❓️ for any values that cannot be determined.

Example

The following example lists all active processes:

# find all processes
procs = process("");
print (procs);

The example produces the following output:

0 -1 <?> ? 0 0 Idle Idle
2 -1 <?> ? 1616 351 System System
21 2 SYSTEM ? 8772 0 smss smss
26 -1 <?> ? 49256 0 csrss csrss
35 21 SYSTEM ? 40556 1 winlogon winlogon
41 35 SYSTEM ? 46876 99 services services
44 35 SYSTEM ? 38380 173 lsass lsass
68 41 SYSTEM ? 71236 7 spoolss spoolss
96 -1 <?> ? 41676 0 AMGRSRVC AMGRSRVC
100 41 SYSTEM ? 16860 0 inetd32 inetd32
114 41 SYSTEM ? 29972 4 RpcSs RpcSs
122 41 SYSTEM ? 23052 0 snmp snmp
147 35 pfarrell ? 15468 0 nddeagnt nddeagnt
158 -1 Agent ? 18236 4 snmpmagt snmpmagt
160 -1 pfarrell ? 67408 567 Explorer Explorer
127 160 pfarrell ? 14596 0 SysTray SysTray
162 160 pfarrell ? 30540 0 ShStat ShStat
153 160 pfarrell ? 51384 73 HPPROPTY HPPROPTY
64 160 pfarrell ? 40144 0 HPNRA HPNRA
161 160 pfarrell ? 45896 283 FINDFAST FINDFAST
199 -1 pfarrell ? 24280 0 ddhelp ddhelp
183 160 pfarrell ? 87848 437 frame frame
192 160 pfarrell ? 37828 1984 PatrolAgent
82 192 pfarrell ? 18168 44 PatrolPerf
105 160 pfarrell ? 20364 0 DsServer DsServer
213 160 pfarrell ? 50292 799 Patrol Patrol
246 192 Agent ? 17008 0 cmd cmd
222 160 pfarrell ? 68308 343 ntvdm ntvdm
145 -1 pfarrell ? 36780 0 vantiv32 vantiv32
70 160 pfarrell ? 25408 192 TICKER TICKER
264 -1 <?> ? 39548 0 wordview wordview
238 160 pfarrell ? 20784 0 cdplayer cdplayer
140 70 pfarrell ? 62092 92 NETSCAPE NETSCAPE
0 -1 <?> ? 1160632 0 _Total _Total