w - log watcher
w - log watcher#
Each agent generates a rich digest of information written to its log file. This utility will sift through these logs and extract the key bits of information that summarize what it did and how it finished. It can also be used to monitor a running job to check on it’s progress.
The principle of operation is that each agent appends to a log file for that day. The name of the log file includes a prefix of 2 to 5 characters that identifies the agent, followed by a date string. This utility will scan through a single log file and report on each agent instance it encounters.
Log file prefix#
Each agent generates log files with a designaed prefix. These logs are written
into the CncOp application log directory
Spool/Logs. To see a
comprehensive list of agent prefixes, use the
cncopjobs -t x command.
Requesting old logs#
By default, this utility will report on the most recent days log for the
designated agent type. An administrator can request older logs by specifying
--daysago option (defaults to 0 which means today). Keep in mind, when
asking for older logs, the utility counts days available, which can be
different then calendar days. For example, when looking at logs for a job that
runs weekly, if you ask for
--daysago 2, you will see two weeks ago.
This utility offers the option to open an agent’s daily log file in the system’s paginator. It will scan the system path for one of several paginator options. It will prefer pagers in the following order
The optional ‘PAGER’ environment variable
If the system finds the
less pager, it will used it’s enhanced options.
If no system paginator can be found, then the pager related functions cannot be used.
Due to the fact that
w is written in python, it introduces a problem
ccs3updater keeping the cncop3 system up-todate. While
running, ccs3updater cannot safely update the code. A multiplatform solution
requires two different approaches.
w will exec(3) the paginator
in the foreground of the terminal. By using exec, python will no longer be
running which will allow the
ccs3updater to work smoothly.
w will run the pagintor in a new console. The console will run
detached from the calling python process in it’s own process group and python
will end, which will allow
ccs3updater to work smoothly. If you are
w in WINDOWS and you’d prefer to not open a new console, use the
--fg option to keep the paginator in the current console.
w will detect if it is running on WINDOWS in a
CBS session and
automatically enable the
Command line options#
w.py [-h] [--debug] [-c CONFIG] [--tell] [--less] [--work]
[--finished] [--fg] [--peekexclude] [--daysago DAYSAGO] logprefix
Required positional arguments#
Identifies the log file prefix to report on. Each agent has a designated prefix, typically 2 to 5 characters long. To see the list of currently support prefix codes, run
cncopjobs -t x. The logprefix is treated case-insensitive.
Display help and exit
Generate debug output.
Alternate configuration file.
Display the name of the agent log file that would be used, and exit.
Invoke the system paginator on the log file.
Display the WORK summary line. Only available for those agents with discreet PEEK steps. This option is primarily intended for the
Show formatted job finished messages.
Keep paginator in foreground. This option is primarily intended for Windows sessions running within CBS.
Suppress PEEK-EXCLD messages. This option is only available with
Paginate log from DAYSAGO
Here are several examples of how to invoke
To launch the paginator on the most recent
w -l CIFS
To launch the paginator on yesterday’s
w -b 1 CIFS
To monitoring the progress of
To see the WORK line of the
w -w NQ
To see how
w -f RSYNC
To use the
more paginator to view the most recent
C:\>set PAGER=more.com C:\>w DQ
In the case of WINDOWS, you must specify the file extension of the pager executable when setting the PAGER environment variable.