Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailcow dockerized postfix #448

Open
adendrag opened this issue Dec 17, 2022 · 4 comments
Open

Mailcow dockerized postfix #448

adendrag opened this issue Dec 17, 2022 · 4 comments

Comments

@adendrag
Copy link

adendrag commented Dec 17, 2022

Hi,

I am having an issue with the mailcow-dockerized postfix extension. Application status gets changed to OK on polling, however graphs are not created and never appear. Pflogsumm is installed. When running poller.php, the following is seen:

#### Load poller module applications ####
Application: mailcow-postfix, app_id=6
mailcow-postfix:-3:Invalid JSON

Also, when looking into the graphs file missing: /opt/librenms/rrd/my.example.net/app-mailcow-postfix-6.rrd

Any ideas?

@calvinthefreak
Copy link
Contributor

I've the Same Problem. It seems to be an issue where the SNMP Daemon gets trash served. Debugged the snmp/mailcow-dockerized-postfix file and did run the command directly thats run by the Script: docker logs d3fa551bd928 | pflogsumm --smtpd-stats There is a lot of junk thats written in front, because pflogsumm messes something up:

image

I'll let you know, when I find a solution.

@calvinthefreak
Copy link
Contributor

First of, I made sure, that my pflogsumm is up to date (Downloaded the Beta: https://jimsun.linxnet.com/postfix_contrib.html) and then I modified the snmp extend script a bit, so that it doesn't spit out errors:
I added on Line 50 in snmp/mailcow-dockerized-postfix:
+ "| pflogsumm --smtpd-stats 2>&1 | grep -v 'Use of uninitialized value'"

So that suppresses the Perl/Bash errors. Then I made sure, that the snmp-user had the right to execute Docker Commands, since that was the error seen when I snmpwalked my Mailserver.

librenms@ubuntu:~$ snmpwalk -v 2c -c private mailserver.local iso.3.6.1.4.1.8072.1.3
iso.3.6.1.4.1.8072.1.3.2.4.1.2.15.109.97.105.108.99.111.119.45.112.111.115.116.102.105.120.1 = STRING: "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?filters=%7B%22name%22%3A%7B%22postfix-mailcow%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied"

Now it seems to be working... at least the Graphs are painted, and a Mail Send from my self to another account displayed as email send and received.

@calvinthefreak
Copy link
Contributor

I guess the Problem will be solved with this.
@librenms maybe add this step to your documentation on https://docs.librenms.org/Extensions/Applications/#mailcow-dockerized-postfix that the user should verify that the user snmp (or what ever it is on your distro, mine was Debian-snmp) is added to the docker group so that snmp can run the command on snmp walk request.

and for you @adendrag please to remember, to restart the snmp daemon after you added it to the docker group.

@calvinthefreak
Copy link
Contributor

Did a PR on this. Please Merge: #494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants