fileopens.cifs.server - A Perl script utility that reads through a CIFS
Server debug output file, reporting information about files opened and
closed during the timespan the debug file covers.
fileopens.cifs.server [-h] [-c] <cifs server log file>
This tool is part of the CIFS WTEC Support Tools suite.
fileopens.cifs.server is a Perl script that runs through the user pro‐
vided CIFS Server debug file looking at lines associated with the open‐
ing and closing of files. It reports information in the following for‐
fnum=12940 fname=us_dc/mcupdate.btr write=No opened=[2007/12/07
10:34:41, 5] at 542 closed=[2007/12/07 10:34:41, 5] at 1524 open
for 0 seconds
The script was designed to be short, but still readable, with the aim
that it will be easy to cut and paste onto a customer's system. Be‐
cause of this, it takes only two command line arguments. (See Options
Note that the script attempts to report the amount of time a file re‐
mains open. If a file is opened and closed in the same second, this
will be reported as zero seconds. If a file close is not included in
the timespan the debug file covers, this script will report a negative
number for the time open. If finer granularity in amount of time open
is required, fileopens.cifs.server will work with debug files taken
fileopens.cifs.server will get confused by traces that run over mid‐
night, since it assumes that the time open and time closed occurs on
the same date..
fileopens.cifs.server may also misreport open times for files that have
no closes associated with them during the timespan the debug file cov‐
ers. In these cases, it will report a negative number, indicating that
the file was still open at the time the debug file terminates.
OPTIONS-h Print a summary of command line options.
-c output CSV (Comma Separated Values) suitable for importing into
spreadsheets, databases, etc.
fileopens.cifs.server prints out the following information:
fnum: file number assigned by the HP CIFS Server code at open time.
fname: relative path to the file from the root of the share.
write: Yes indicates file was opened for Write access.
opened: Date/Timestamp of when file was opened from debug file.
closed: Date/Timestamp of when file was closed from debug file.
at: line number in debug file where the open/close took place.
open for: time (in seconds) file remained open.
fileopens.cifs.client works best with a debug file input that was cap‐
tured with a log level = 10 in the /etc/opt/samba/smb.conf file. If you
want to track file opens durations less than 1 second, you will also
need to set 'debug hires timestamp=yes as well.
This script was developed and tested under perl(1) version 5.005_02
built for PA-RISC1.1 . While it may run under previous versions it is
recommended that you install 5.005_02 or higher for best results. You
may need to modify the first line to point to whatever location YOUR
environment has perl installed.
Don McCall, HP WTEC NOS Support Team