/usr/share/doc/xwatch/html/xwatch02.html is in xwatch 2.11-15build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | <html>
<head>
<title> XWatch <br> The Logfiles Watcher </title>
</head>
<body >
<hr>
<ul>
<li> <a href="xwatch.html">Table of Contents</a>
<li> <a href="xwatch01.html">Previous Chapter</a>
<li> <a href="xwatch03.html">Next Chapter</a>
</ul>
<hr>
<a name="l2"></a>
<h1>Chapter 2: Using xwatch</h1>
<p>
You typically start <code>xwatch</code> when activating an X session; e.g.,
from the file which xdm uses to fire up a user's session (this file is
normally <code>/usr/X11/lib/X11/xdm/Xsession</code>). The command that starts
<code>xwatch</code> is something like
<p>
<pre>
xwatch [options] files &
</pre>
<p>
where `options' are optional flags, files are the files to watch, and
the ampersand character is used to start <code>xwatch</code> in the background. The
files to watch are typically in the directory <code>/var/adm/</code>: files which
are created by the syslog daemon (see the file <code>syslogd.conf.SAMPLE</code> in
the distribution for an example). <code>XWatch</code> accepts only filenames which
are:
<p>
<ul>
<p>
<li> ordinary files, no sockets, directory names,
<p>
<li> which are not binary files.
<p>
</ul>
<p>
Other files as stated on the commandline are not monitored. When any
`non-proper' file is given on the commandline, <code>xwatch</code> warns about the
file not being acceptable and deletes it from its list of names.
<p>
<a name="l3"></a>
<h2>2.1: Options to the xwatch program</h2>
<p>
The options are many, start <code>xwatch</code> without arguments to see what is
supported. All options can also be stated in the file
<code>/usr/lib/X11/app-defaults/XWatch</code> as X resources (see the file
<code>XWatch.ap</code> as an example). In the following enumeration, a <em>nr</em>
denotes a number:
<p>
<ul>
<p>
<li> <code>-border</code> <em>nr</em>: Specifies whether <code>xwatch</code> should start
with a border. The <em>nr</em> must be 0 or 1. When you start <code>xwatch</code>
without a border, your window manager may not be able to resize or
even recognize it. Incidentally, this may be what you want -- I use it
to `hide' the presence of <code>xwatch</code> from my window manager <code>fvwm</code>.
<p>
<li> <code>-geometry</code> <em>geom</em>: Specifies the display geometry, á-la
other X programs. You can express the geometry in terms of <em>WxH</em>
(width by height), optionally postfixed by <em>+X+Y</em> (x and y offset)
or <em>-X-Y</em> (offsets relative to the lower right corner) and other
combinations.
<p>
Note that previous switches that emulated the geometry specification,
such as <code>-xpos</code> and <code>-height</code>, are now obsolete. Use the geometry
setting.
<p>
<li> <code>-fg</code> <em>color</em> and <code>-bg</code> <em>color</em>: These options define the
default foreground and background of the watch window.
<p>
Note that previous switches, such as <code>-bred</code> and <code>-bblue</code>, are now
obsolete.
<p>
<li> <code>-printtime</code> <em>nr</em>: Defines whether <code>xwatch</code> should prefix
any info on the watched files with a timestamp. The <code>nr</code> can be 0 or
zero; the timestamp is printed when <em>nr</em> is 1.
<p>
<li> <code>-printname</code> <em>nr</em>: Defines whether <code>xwatch</code> should prefix
any info on the watched files with the filename. The <em>nr</em> is again a
flag, 0 or 1.
<p>
<li> <code>-newline</code> <em>nr</em>: Defines whether <code>xwatch</code> should let a
newline follow the time and/or filename stamp, so that the actual
information is displayed on its own line.
<p>
<li> <code>-interval</code> <em>nr</em>: Defines the scanning interval. Each <em>nr</em>
seconds, <code>xwatch</code> will check if new information has arrived on the
watched files. The <em>nr</em> may be between 1 and 30 seconds.
<p>
<li> <code>-fontsize</code> <em>nr</em>: Defines the initial size of the display
font. The <em>nr</em> may range from 1 to 4; 1 being the smallest font and
4 being the largest.
<p>
<li> <code>-fontstyle</code> <em>nr</em>: Defines the style of the used font. The
<em>nr</em> is a number between 0 and 15 (0 being the default). Start
<code>xwatch</code> without arguments or read the application defaults file to
see what fonts the numbers choose.
<p>
<li> <code>-firstwarnings</code> <em>nr</em>: Defines whether <code>xwatch</code> should
print initial warnings into the watch window. E.g., you might like to
set <code>firstwarnings</code> to zero, and then start <code>xwatch</code> with the file
argument <code>/var/adm/*</code>. Warnings about, e.g., <code>utmp</code> being a
binary file would then be suppressed.
<p>
<li> <code>-printversion</code> <em>nr</em>: Controls whether <code>xwatch</code> prints its
version number and copyright notice upon startup in the watch window.
<p>
<li> <code>-gag</code> <em>text</em>: This option, when present, prevents all lines
with <em>text</em> in them from being shown in the display window. You can
specify more than one string to `gag', in that case, separate the
strings with <code>|</code>.
<p>
<li> <code>-colorstring</code> <em>col:string</em>: This option causes lines that
contain <code>string</code> to be displayed using the specified color.
The string is matched literally.
E.g., if you use the option <code>-colorstring blue:connection</code> then
all lines containing <code>connection</code> are displayed in pure blue.
<p>
You can specify several colorstrings by separating all options with a
| character, as in <code>-colorstring blue:connection|red:error</code>. Note
that, for reasons of shell expansion, you should quote such options on
the commandline.
<p>
<li> <code>-title</code> <em>name</em>: This option sets the window title of the
watch window. Note that the title will only be visible when <code>border</code>
is not 0. This option may be useful if you have several XWatch
windows, monitoring different things.
<p>
<li> <code>-ignore</code> <em>fileA|fileB|fileC|...</em>: This option is handy if
you start XWatch with a wildcard file argument, but when you want
XWatch <strong>not</strong> to process some files. The <code>-ignore</code> flag removes
the stated files from the watchlist. Note that, for reasons of shell
commandline expansion, you must quote the file specification (or the
shell will interpret the | characters as pipes). (Thanks, Frank
Brokken, <code>frank@icce.rug.nl</code> for the code).
<p>
</ul>
<p>
<strong>Debian Maintainer's note: Applications defaults are stored in
/etc/X11/app-defaults/XWatch . System adminitrators who want to
customize xwatch globally may also create a file
/etc/X11/Xresources/xwatch for these configurations by prefixing
the entries with Xwatch (see /usr/share/doc/xwatch/README.Debian
for an example). Individual users can make the same types of
changes in their ~/.Xdefaults or ~/.Xresources files.</strong>
<p>
Before you extensively use the options, create an application defaults
file <code>/usr/lib/X11/app-defaults/XWatch</code>. You can do so by copying the
file <code>XWatch.ap</code>, extracted from the archive, to
<code>/usr/lib/X11/app-defaults/XWatch</code>. The comments in the distributed
application defaults file explain what you can configure and show
examples.
<p>
Some systems do not have the directory <code>/usr/lib/X11/app-defaults</code>. In
that case, you should create the following links:
<p>
<ul>
<p>
<li> <code>/usr/X11</code> should point to your X11 distribution; e.g. to
<code>/usr/X11R6</code>. That way, you always have e.g. <code>/usr/X11/bin</code>, even
after upgrading your X11 distribution. All that is needed is one new
link.
<p>
<li> <code>/usr/lib/X11</code> should point to <code>/usr/X11/lib/X11</code>.
<p>
</ul>
<p>
Then edit the file <code>XWatch</code> in the application defaults directory, and
follow the instructions therein to define your favorite settings. If you
need to start <code>xwatch</code> incidentally with another setting, use a flag.
<p>
<a name="l4"></a>
<h2>2.2: File arguments</h2>
<p>
The filename arguments can optionally be followed by a color
specification that applies only to that particular file. E.g., say you
want to see all the files in <code>/var/adm</code> normally in blue text; but you
want to see <code>/var/adm/critical</code> (critical messages from applications) in
yellow and <code>/var/adm/auth</code> (authentification messages) in red. In that
case, the course to follow would be:
<p>
<ul>
<p>
<li> The default foreground color would be blue. You could set this
with the flags <code>-fg blue</code>, or in the application
defaults file.
<p>
<li> The color for <code>/var/adm/critical</code> should be yellow. Hence, the
first file argument would be <code>/var/adm/critical:yellow</code>.
<p>
<li> The color for file <code>/var/adm/auth</code> should be red, hence the
second file argument would be <code>/var/adm/auth:red</code>.
<p>
<li> The following arguments would be the files, using the standard
foreground (blue): <code>/var/adm/*</code>, without any extra color
specifications.
<p>
</ul>
<p>
Such a commandline would cause <code>xwatch</code> to complain about the multiple
presence of <code>/var/adm/critical</code> (once from the separate argument, and
once from the wildcard argument) and similarly about <code>/var/adm/auth</code>. If
this bothers you, turn off the initial warnings (e.g., using
<code>-firstwarnings 0</code> or in the application defaults file).
<p>
Note that besides the color specifications for filenames, you can
also specify coloring for lines that match a given string in all files.
See the above description of the switch <code>-colorstring</code> for more
information.
<p>
<hr>
<ul>
<li> <a href="xwatch.html">Table of Contents</a>
<li> <a href="xwatch01.html">Previous Chapter</a>
<li> <a href="xwatch03.html">Next Chapter</a>
</ul>
<hr>
</body>
</html>
|