Perl Audit Reports

K

Kingmaker

I am new to perl . I need to write a perl script to generate an audit
report of a root directory and all subsequent sub-directories and
files under it, the report should be able to
1. list any directories/files changes in size and content, addition,
deletion of any of them.
2. It could be run for different location passing parameters.

the live example is:
we have all our pkgs installed on unix machine in some location ..
Here for eg., in /tmp if someone attempts to Insert/Update/Delete any
file(s) in any of the pkg/directory from this location we should get
an alert audit report.


Please help.
 
M

Martijn Lievaart

I am new to perl . I need to write a perl script to generate an audit
report of a root directory and all subsequent sub-directories and files
under it, the report should be able to 1. list any directories/files
changes in size and content, addition, deletion of any of them.
2. It could be run for different location passing parameters.

the live example is:
we have all our pkgs installed on unix machine in some location .. Here
for eg., in /tmp if someone attempts to Insert/Update/Delete any file(s)
in any of the pkg/directory from this location we should get an alert
audit report.

I use tripwire for this, there probably are others, but if you must do it
in Perl, simpel matter of programming.

Think how you want store the state. CSV seems to me a good format, but
you can also use a database like GDBM for instance. A DB is probably
easier.

Use File::Find to iterate over the directory structure and on first run
store the information, on subsequent runs report differences and possibly
store the new situation.

Use Getopt::Long to parse the command line.

Audi reports should probably be just printed to stdout, run your script
drom cron and let cron take care of mailing the result. But mailing from
Perl is also trivial, several modules can do this for you.

Start writing and when you get stuck, read the posting guidelines (yes
really, do that first!) and then ask for specific help with what you're
stuck with at that moment.

HTH,
M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top