This command provides a command line interface to the LifeKeeper logging interface. It can be used in scripts that are part of the implementation of a Recovery Kit.
lklogmsg — command line interface to the LifeKeeper logging interface
LKROOT/bin/lklogmsg [-o] [-e] [-h] [-p progname] -l level -s source -a action -t tag -i messageid [-c command – cmd args ]|[–– message]
lklogmsg [-o] [-e] [-h] [-p progname] -l level -s source -a action -t tag -i messageid [-c command – cmd args ]|[–– message]
Messages that are to be logged may either be passed in as the final arguments with the special argument “– –” in front of it, or if no message parameters are present, this command will read input from stdin, and convert each line into a separate log message.
An additional mode of operation can be used where a command and its arguments are passed in via the -c option. In this mode, the stdout and stderr of the command are redirected through a pipe, and captured by face=“Courier New”>lklogmsg. The stdin of the command comes from /dev/null.
The -o option will cause the message to be echoed to stdout.
The -e option will cause the message to be echoed to stderr.
The -h option will cause lklogmsg to perform the same actions as nohup.
The -p should be the name of the script which is calling lklogmsg. It will be used as the application name that gets recorded in the log.
The -l option must be one of LK_NOTIFY, LK_FATAL, LK_ERROR, LK_WARN, LK_TRACE, LK_INFO or LK_DEBUG.
The -s option should be the Recovery Kit name which is calling lklogmsg (e.g., mysql, lvm, oracle).
The -a option should be the Recovery Kit action which is calling lklogmsg (e.g., restore, remove, recover, create, extend).
The -i option should be the (6-digit) message ID from the assigned range for the Recovery Kit.
/opt/LifeKeeper/bin/lklogmsg -e -l LK_ERROR -s gopher -a recover -t sample_tagname -i 222016 Unable to restart gopher server sends “Unable to restart gopher server” to both the LifeKeeper log, and to stderr.
/opt/LifeKeeper/bin/lklogmsg -l LK_INFO -s webserver -a create -t sample_sdr_resource -i 100315