Jump to content
  • 0

Question regarding pflogsumm


Question

I read this article and I think this is a great tool. https://linuxhint.com/analyze_postfix_logs_pflogsumm/

I was wondering if there is a way to use pflogsumm remotely? i.e. I have a server that I want to use to connect and run pflogsumm on 15 other servers, grab the information and send it all together in one report.

Is this possible?

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
21 hours ago, notslayer said:

I read this article and I think this is a great tool. https://linuxhint.com/analyze_postfix_logs_pflogsumm/

I was wondering if there is a way to use pflogsumm remotely? i.e. I have a server that I want to use to connect and run pflogsumm on 15 other servers, grab the information and send it all together in one report.

Is this possible?

Hi notslayer,
You can download the logs from all 15 servers to the server where you want to run pflogsumm and generate a report from there.

You can write a shell script to automate everything. This should save you a lot of work and time. 

 

For example, the shell script may look as follows:

#!/bin/bash
ssh root@s1.example.com 'cat /var/log/maillog' > ~/maillog
ssh root@s2.example.com 'cat /var/log/maillog' >> ~/maillog
ssh root@s3.example.com 'cat /var/log/maillog' >> ~/maillog
ssh root@s4.example.com 'cat /var/log/maillog' >> ~/maillog
ssh root@s5.example.com 'cat /var/log/maillog' >> ~/maillog
ssh root@s6.example.com 'cat /var/log/maillog' >> ~/maillog

cat ~/maillog | pflogsumm | more

 

Once you run this shell script in the server where you want to generate the report, it should SSH into all the other servers, read the /var/log/maillog file and append the contents of that file to the ~/maillog file of your server (where you want to generate the report from). Then, you can generate reports using pflogsumm program using the combined log file ~/maillog.

 

I would also advise you to setup passwordless SSH login for the other servers to avoid typing passwords for each of these servers every time you run the script. To know how to setup passwordless SSH login, check the article Setup Passwordless Login to Servers via SSH

 

I hope this helps. Wishing you all the best.

Shovon

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...