Summary: Sendmail log:scripts for reports

From: Virendra Vishnu (vishnu@avlinsun.avlin.stpn.soft.net)
Date: Wed Sep 16 1998 - 07:08:06 CDT


Sorry mailing late summary, i was waiting for best solution, any way
thanks a lot for all who replied to my problem. My original question
was:

sendmail on my system generates a syslog in /var/log.
could you tell me where can i get perl scripts or similar solution to
get reports on syslog and get information from it that how many mails
one id has sent and how many bytes one has sent ?

Here are the replies:
1.-------------
Hi vishnu, The attached program will give you a summary of yr syslog
file.

Lee Boon Heong
Unix Support Department
Computer Systems Advisers(M)Berhad
lbheong@penang.csam.com.my
2. -------------
Try
http://www.harker.com/sendmail/sendmail-ref-body.html#Sendmail_Logging

Terry Gorby
EMC Corporation
Terry Gorby <tgorby@emc.com>

3. -------------
look at www.sendmail.org.

from:
Jeff Wasilko <jeffw@smoe.org>

4. ------------
Here's one called 'syslog-stat.pl' that's been around for several years,

but it still works. You may want to hack on it to customize it for your

own needs.

HTH,

RGF
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Robert G. Ferrell, UNIX Systems Administrator |
| Computer Incident Response Team |
| US Geological Survey Reston, VA |
=-=-=-=-=-=-=-= rferrell@usgs.gov =-=-=-=-=-=-=-=

5. --------------
start sendmail with S [ file ] option (see manpage for details) then use

mailstats to compile the output. this should be pretty much what you
need.

------------------
David Blaine (blained@gdls.com)
Computer Systems Engineer
CSC for GDLS
Phone: 810-825-7650

 6. ----------------------
Here's what we use. Our mail logs to /var/adm/log/syslog.mail but
that's an easily changable parameter in the file. We rotate our logs
every night around 3am.

--
  Chris_Marble@hmc.edu - HMC UNIX & Information Systems Manager
  My opinions are my own and probably don't represent anything anyway.

7. ---------------- You should already have such tools as they came with sendmail. The 'mailstats' program parses the sendmail.st file (I won't go into details

on this as the information on how to create it, etc are readily available if needed) and gives that sort of info.

As far as the syslog part of it goes, you didn't say if the file in /var/log was generated by the "OS/var/log/<filename>" directive in sendmail.cf or whether you were talking about the actual syslog messages. If it's the prior, that file is exactly the same as sendmail.st and so you can run mailstats on it (NOTE: don't confuse this with the procmail "mailstat" program - there is an "s" on the end of the filename) - see 'mailstats -- -' for usage information.

If, however you are referring to the actual syslogd mail.info messages, you can use sed, awk, perl whathaveyou to grok some info...

Say you wanted to see how much mail traffic occurred during the period covered by the file /var/log/syslog.4, try something like:

perl -e 'while(<>){if(/\bsize=\d+/){($s)=/\bsize=(\d+)/;$sum+=$s}}\ print "Bytes transferred: $sum\n";' /var/log/syslog.4

For more detailed parsing, check out the "scripts/mailstuff" directory in the CPAN as there are some perl scripts such as 'syslog-stat.pl' and Tom Christiansen has an old one called ssl (which stands for "summarize sendmail syslog" and is not related to secure socket layer <G>) that is available at ftp.convex.com (/pub/perl/scripts I think.. I just lost the info) but is very very old and not likely to be the optimal soltuon for a sendmailv8 machine.

Hope this helps...

--ScottVR ------------------------ end of replies

That is all, if you need source code attachment let know i would mail you asap. Thanks a lot once again. --------------- Virendra Vishnu e-mail vishnu@avlin.stpn.soft.net ---------------------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:49 CDT