HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to get syslog statistics
Operating System - HP-UX
1832880
Members
2331
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2001 12:19 PM
03-29-2001 12:19 PM
How to get syslog statistics
I would like to make one command to get statistics of how many users sending mails within certain timing period.
the syslog looks like:
--------------
Mar 29 15:10:20 6C: sendmail[10960]: PAA10958: to=, delay=00:00:01, xdelay=00:00:01, mailer=forgnout, relay=mx.mail.rcn.net. stat=Sent (OK id=14iilq-0005sP-00@mx06.mrf.mail.rcn.net)
Mar 29 15:12:53 6C:IRIS sendmail[10962]: PAA10962: from=, size
=1297, class=0, pri=31297, nrcpts=1, msgid= ED98@iupuimbx04.uits.iupui.edu>, proto=ESMTP, relay=hermes.iupui.edu [134.68.220
-------------------
I can use 'grep -c username SYSLOG' to find out the total number, but don't know how to use the time periods, such within one day, last two hours, etc.
Your help is greatly appreciated.
Steven
the syslog looks like:
--------------
Mar 29 15:10:20 6C: sendmail[10960]: PAA10958: to=
Mar 29 15:12:53 6C:IRIS sendmail[10962]: PAA10962: from=
=1297, class=0, pri=31297, nrcpts=1, msgid=
-------------------
I can use 'grep -c username SYSLOG' to find out the total number, but don't know how to use the time periods, such within one day, last two hours, etc.
Your help is greatly appreciated.
Steven
Steve
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2001 03:40 PM
03-29-2001 03:40 PM
Re: How to get syslog statistics
Steven,
You can use both sed and awk for this pupose.
Eg. # grep username SYSLOG > /tmp/sendmail
# sed -n '/Mar 25/,/Mar 26/p' /tmp/sendmail | wc -l
I hope this will help.
You can use both sed and awk for this pupose.
Eg. # grep username SYSLOG > /tmp/sendmail
# sed -n '/Mar 25/,/Mar 26/p' /tmp/sendmail | wc -l
I hope this will help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2001 10:25 PM
03-29-2001 10:25 PM
Re: How to get syslog statistics
You may use a perl script called ssl againt mail.log
Kind regards
Felix
Kind regards
Felix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2001 07:33 AM
03-30-2001 07:33 AM
Re: How to get syslog statistics
If you don't need per user statistics (just in bound/outbound statistics for a given time period), mailstats is an effective command. mailstats gives a count of outbound messages (and bytes transferred) and a count of inbound messages (and bytes transferred) for each mailer you have defined:
# mailstats
Statistics from Tue Sep 29 19:27:05 1998
M msgsfr bytes_from msgsto bytes_to Mailer
0 0 0K 261684 1050037K prog
1 0 0K 5301 18066K *file*
3 4161328 364780298K 13385581 240319945K local
5 14058647 318345719K 5313552 156255770K esmtp
9 8 77K 3 37K uucp-old
========================================
T 18219983 683126094K 18966121 397643855K
mailstats maintains statistics from the time the
/etc/mail/sendmail.st
is created.
You can
1) periodically truncate this file to see what happens in a given time period.
or
2) use a program like mrtg to plot the statistics over time. mrtg might be used to plot the difference between two consecutive executions of mailstats.
You might check www.sendmail.org, The "Bat book" (sendmail), and a search of the web for mailstats to get some examples/source scripts for folks maintaining mail statisics.
# mailstats
Statistics from Tue Sep 29 19:27:05 1998
M msgsfr bytes_from msgsto bytes_to Mailer
0 0 0K 261684 1050037K prog
1 0 0K 5301 18066K *file*
3 4161328 364780298K 13385581 240319945K local
5 14058647 318345719K 5313552 156255770K esmtp
9 8 77K 3 37K uucp-old
========================================
T 18219983 683126094K 18966121 397643855K
mailstats maintains statistics from the time the
/etc/mail/sendmail.st
is created.
You can
1) periodically truncate this file to see what happens in a given time period.
or
2) use a program like mrtg to plot the statistics over time. mrtg might be used to plot the difference between two consecutive executions of mailstats.
You might check www.sendmail.org, The "Bat book" (sendmail), and a search of the web for mailstats to get some examples/source scripts for folks maintaining mail statisics.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP