GitHub

Why use pst3 for check_procs on Solaris?

Solaris systems restrict the information that is available when you run ps. On other Unix systems, running ps will list you the entire arguments, but Solaris restricts the arguments to the first 64 characters at the kernel.

This is a problem if you need to access the arguments to find out a specific process (common for listing Java programs).

/usr/ucb/ps does list the full arguments, but only for your own processes. If you are root, then running /usr/ucb/ps can get the full arguments for all processes. However, the columns for RSS and VSZ merge together when the values are too large and check_procs cannot pull the value out correctly.

The chosen approach is to create our own ps-like command, pst3. This outputs the required information in a known format for check_procs to parse. This is the default if you run ./configure on a Solaris system.

Because pst3 needs access to some kernel structures, it needs to be compiled in 32 and 64 bit modes.

If you are comfortable with the limitations, it is possible to use a Solaris ps command by specifying these options to ./configure:

--with-ps-command="/usr/bin/ps -eo 's uid pid ppid vsz rss pcpu etime comm args'" \
--with-ps-format="%s %d %d %d %d %d %f %s %s %n" \
--with-ps-cols=10 \
--with-ps-varlist="procstat,&procuid,&procpid,&procppid,\
&procvsz,&procrss,&procpcpu,procetime,procprog,&pos"

The --with-ps-varlist should be on one line - separated here for readability.