About process
|
basics
|
|
syntax
|
module process {
[warn <relation>]
[prob <relation>]
name <string>
[name ...]
[matchtype <flags>]
[userid <string>]
}
via <transport>
|
Dependencies
Arguments
Name |
Type |
Value |
warn |
optional relation, reg/regv not allowed |
Generate a warning if the specified relation matches the number of
processes found.
|
prob |
optional relation, reg/regv not allowed |
Generate a problem if the specified relation matches the number of
processes found.
|
name |
required string list |
The regular expression used to match the process. If more than
one is provided, each must match.
|
matchtype |
optional flags a,i |
If not provided, only the name of the program (argv[0]) is examined
to compare against the name filter.
- a indicates to examine the name of the program plus all
of the arguments.
- i indicates the program is run through an interpreter,
and so the name of the program begins with the second token.
|
userid |
optional string |
Match only those processes owned by this user. If the userid is
specified as a numeric uid rather than a username, this module may
run significantly faster on hosts with slow name service backends.
|
If neither warn nor prob are provided, matching no
processes will result in a problem while matching one or more processes
will return OK.
Description
The process module determines if zero or more processes are
running matching the provided regular expressions, optionally only
examining those with the provided userid. For SYSV
environments, For SYSV environments, ps -e -o
user,uid,pid,time,args is used, for BSD environments, ps -a
-o user,uid,pid,time,command is used if it can be determined
that such options are supported, otherwise ps -aux is used.
The matchtype argument can be used to adjust how matching
occurs. By default, only the name of the program is matched.
However, in some cases (a), the full argument string (as
obtained via ps) is necessary for comparison. In other
cases (i), programs are run through an interpreter (eg:
/usr/bin/perl or java), and the program name is
actually an argument to the interpreter running it.
Examples
- To verify that at least one process matching .*named owned
by root is running (the named and
namedSerial modules can be
used to verify that named is responding):
module process {
userid root
name .*named
}
via remote
- To verify that between 5 and 25 processes matching .*httpd
owned by the www user are running (the
protocol module can be used to
verify that httpd is responding):
module process {
userid www
name .*httpd
prob nb[5,25]
}
via remote
- To verify both regular and secure web servers are running, generating
a warning if less than 25 are found and a problem if none are found:
module process {
userid www
name .*httpd
name .*httpsd
warn lt[25]
prob lt[1]
}
via remote
- To look for a java process called javaApp:
module process {
name reg[.*javaApp]
matchtype i
}
via remote
$Date: 2006/11/19 21:16:27 $
$Revision: 0.12 $
|
keywords
matchtype
name
prob
userid
warn
|