Page 1 of 5
Problem with enabling notifications with postfix
Posted: Tue Jul 07, 2015 2:23 pm
by Jessuzz94
I configured postfix to send notifications via a gmail account, when i shutdown a server to test the notification, in the log of mail shows me this:
Code: Select all
Jul 7 11:55:27 ubuntu postfix/smtpd[13810]: connect from unknown[unknown]
Jul 7 11:55:27 ubuntu postfix/smtpd[13810]: lost connection after CONNECT from unknown[unknown]
Jul 7 11:55:27 ubuntu postfix/smtpd[13810]: disconnect from unknown[unknown]
Jul 7 11:58:48 ubuntu postfix/anvil[13813]: statistics: max connection rate 1/60s for (smtp:unknown) at Jul 7 11:55:27
Jul 7 11:58:48 ubuntu postfix/anvil[13813]: statistics: max connection count 1 for (smtp:unknown) at Jul 7 11:55:27
Jul 7 11:58:48 ubuntu postfix/anvil[13813]: statistics: max cache size 1 at Jul 7 11:55:27
What means?, i did the same configuration in other nagios server and the notifications worked fine.
Re: Problem with enabling notifications with postfix
Posted: Tue Jul 07, 2015 4:45 pm
by jdalrymple
This is a postfix local to the Nagios server?
While running `tail -f /var/log/maillog` try running the command:
Put in a valid E-mail address... See if there are any errors.
Post any relevant messages from the tail output and also at the command line from which you're sending the mail. Also see if you get any mail returned to your local user account with useful content by just issuing the mail command and looking for new messages.
Re: Problem with enabling notifications with postfix
Posted: Tue Jul 07, 2015 4:53 pm
by Jessuzz94
The command "tail -f /var/log/maillog" doesnt work, says no such file in directory, i use ubuntu server i think is that.
The invalid address shows me this in the mail.log, i can send mails to everybody, but the notifications of nagios doesnt work, i configured contacts , commands , host and services to enable notifications and short intervals test if works.
Code: Select all
Jul 7 14:50:18 ubuntu postfix/pickup[1073]: 4793315FCB2: uid=1001 from=<nagios>
Jul 7 14:50:18 ubuntu postfix/cleanup[2155]: 4793315FCB2: message-id=<20150707215018.4793315FCB2@ubuntu>
Jul 7 14:50:18 ubuntu postfix/qmgr[1074]: 4793315FCB2: from=<nagios@ubuntu>, size=422, nrcpt=1 (queue active)
Jul 7 14:50:18 ubuntu postfix/smtp[2157]: warning: database /etc/postfix/sasl_passwd.db is older than source file /etc/postfix/sasl_passwd
Jul 7 14:50:21 ubuntu postfix/smtp[2157]: 4793315FCB2: to=<[email protected]>, relay=smtp.gmail.com[173.194.64.109]:587, delay=2.8, delays=0.03/0.02/1.7/1, dsn=2$
Jul 7 14:50:21 ubuntu postfix/qmgr[1074]: 4793315FCB2: removed
Re: Problem with enabling notifications with postfix
Posted: Tue Jul 07, 2015 4:59 pm
by Jessuzz94
snmpd can block the notifications?, because when i installed snmpd it shows me this :
Code: Select all
invoke-rc.d: initscript snmpd, action "start" failed.
dpkg: error processing package snmpd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
snmpd
E: Sub-process /usr/bin/dpkg returned an error code (1)
and the tutorial that i follow needed snmp working fine.
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 8:44 am
by tgriep
I think the problems sending notifications is that the system may not have a valid from address setup for email.
In Nagios XI, go to Admin > Manage Email Settings and put in a valid entry in the Send Mail From field and save it.
Then try and send a test email and see if it gets sent.
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 11:05 am
by Jessuzz94
And in Nagios Core how can i do that :c
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 12:01 pm
by tgriep
Sorry about that. Wrong forum.
In Core, add this to the end of your notify commands to set the from address.
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 12:02 pm
by Jessuzz94
You mean in commands.cfg in notify-by-email?
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 1:54 pm
by tgriep
Yes, the commands.cfg file has the commands for notify-by-email. Those would have to be edited.
Re: Problem with enabling notifications with postfix
Posted: Wed Jul 08, 2015 2:07 pm
by Jessuzz94
But, in what part of the line i need to put the email?