HP-UX Directory Server Administrator Guide HP-UX Directory Server Version 8.1 (5900-3098, May 2013)

The pipe script can monitor another process, such as the directory server. You will have to supply
the PID of the process to the pipe script either directly, or by specifying the name of the file
containing the PID. It is not necessary for a PID file to exist. The script checks the file for the PID till
the timeout period.
-s|--serverpidfile - name of file containing the server PID.
-t|--servertimeout - number of seconds to wait for the PID file to exist and the PID to be
running. By default, the wait time for the PID file is 60 seconds.
--serverpid - specifics the PID of the server directly. The server must already be running.
A plug-in can be specified with the script. The plug-in must define a function that will be called
with each line read from the pipe. A pre-function is specified optionally, that will get called when
the plug-in is loaded. Plug-in command line arguments are passed to the pre-function. Also, a post
function can be specified optionally, which will get called when the script exists.
--plugin=/path/to/pluginfile.py pluginfile.arg1 ... pluginfile.argN
Each plug-in may have arguments specified in the command line. If the plug-in file is called
pluginfile.py, the arguments are specified on the command line by pluginfile.argname.
The script will parse the arguments and pass them to the plug-in through the pre-function, so the
plug-in must define a pre-function in order to get the command line arguments. Multiple arguments
with the same argname are passed as a list of values.
You must configure the directory server to use named pipe as the log instead of the default log
file. For more information, see “Directory Server Log Configuration ” (page 514).
Example 26 Usage examples :
ds-logpipe.py /var/opt/dirsrv/slapd-instance_name/log/errors.pipe -m 1000
It creates a named pipe that will keep the last 1000 lines read.
ds-logpipe.py /var/opt/dirsrv/slapd-instance_name/log/errors.pipe \
--plugin= /opt/dirsrv/share/data/logregex.py logregex.regex="a bad error" > baderrors
This logs only lines containing the string a bad error to the file baderrors.
14.3.1 Directory Server Log Configuration
The three logs access, error, and audit has several different configuration parameters. Modify the
configuration parameters accordingly, to enable the use of the named pipe for the log. For example,
use ldapmodify with the following LDIF, for the server to use a pipe for the access log:
dn: cn=config
changetype: modify
replace: nsslapd-accesslog-maxlogsperdir
nsslapd-accesslog-maxlogsperdir: 1
-
replace: nsslapd-accesslog-logexpirationtime
nsslapd-accesslog-logexpirationtime: -1
-
replace: nsslapd-accesslog-logrotationtime
nsslapd-accesslog-logrotationtime: -1
-
replace: nsslapd-accesslog
nsslapd-accesslog: /var/log/dirsrv/slapd-localhost/access.pipe
-
replace: nsslapd-accesslog-logbuffering
514 Monitoring Server and Database Activity