Jump to content

Recommended Posts

Posted

**Linux newbie**

 

Having a mess about with Nagios and it says to get notifications working I need to:

 

sudo apt-get install mailx

 

sudo apt-get install postfix

 

Problem is I'm not entirely sure which package from mailx to choose. I've chosen bsd-mailx but on Ubuntu it comes up with a blue screen asking me to choose a Postfix configuration option but I cannot work out how to proceed past this.

 

Anyone able to advise on how to install mailx and postfix on Ubuntu desktop?

Posted

Sounds like it's trying to configure postfix for you.

 

Do you need to send mail via a smarthost? (ie, at home I send my mail via smtp.ntlworld.com but at work I'd send it via our corporate mail gateway). If so set that or you can use Internet Site by itself if your box can mail directly.

 

All it's doing is writing the main config file for postfix.

Posted

At risk of sounding an idiot, I'm not sure! Basically I'm just trying to get Nagios to send email alerts. I assume it uses itself to send mail as:

 

"You'll have to edit the Nagios email notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live."

 

I also cannot seem to work out how to tell it what configuration option to use... it's just a blue screen with written at the bottom.

Posted

Should be a list of configurations?

 

Looking like http://library.linode.com/email/postfix/images/postfix-courier-mysql-02-mail-server-type-2.png

 

The mail configuration isn't really relevant to nagios specifically it's how you want the mail originating from your box to be handled, ie, do you want your box itself contacting the recipient mail server (eg hotmail.com) to deliver messages or do you want to 'relay' all of your messages through your ISP mailserver or such like? - If you're doing this in a school I would imagine your LEA would provide you with a SMTP/Relay as they tend to block outbound connections to SMTP servers not on their list.

Posted
This is away from school, just something I am playing about with. I have Ubuntu as a VM. I'd prefer to have the box send the mail itself.
Posted

Ah. Moving on, nothing to see here. ;-) (Thank you!! Didn't realise you had to use tab)

 

Is there a quick way to test that it's working?

Posted

From the command line do:

 

mail [email protected]

it will ask for a subject, type one in

you can then freely type away until your heart is content,

put a single . (full stop) on a line by itself

 

And it will send a mail.

 

See if you get the mail, check your spam bin incase your ISP is dynamic/marked as spam.

 

If not, have a nose in /var/log/mail.(could be info, warn, log, etc).

Posted

Jan 8 22:23:01 ubuntu postfix/master[2906]: daemon started -- version 2.7.1, configuration /etc/postfix

Jan 8 22:45:53 ubuntu postfix/pickup[2908]: D1E10C238B: uid=1000 from=

Jan 8 22:45:53 ubuntu postfix/cleanup[3375]: D1E10C238B: message-id=<20110108224553.D1E10C238B@ubuntu>

Jan 8 22:45:53 ubuntu postfix/qmgr[2909]: D1E10C238B: from=, size=427, nrcpt=1 (queue active)

Jan 8 22:46:15 ubuntu postfix/smtp[3378]: D1E10C238B: host aspmx.l.google.com[209.85.227.27] refused to talk to me: 421 Cannot connect to SMTP server 209.85.227.27 (209.85.227.27:587), connect error 10060

Jan 8 22:46:36 ubuntu postfix/smtp[3378]: D1E10C238B: host alt1.aspmx.l.google.com[74.125.43.27] refused to talk to me: 421 Cannot connect to SMTP server 74.125.43.27 (74.125.43.27:587), connect error 10060

Jan 8 22:46:57 ubuntu postfix/smtp[3378]: D1E10C238B: host alt2.aspmx.l.google.com[74.125.127.27] refused to talk to me: 421 Cannot connect to SMTP server 74.125.127.27 (74.125.127.27:587), connect error 10060

 

I suspect it's because I am not using a proper address? (ubuntuvm@ubuntu)

Posted

I can't talk to those IP's on port 587 either, only port 25.

 

Try an email address that isn't google to see if it's only google that doesn't work for you or everything.

 

Also, try telneting to 74.125.127.27 on port 25 from your ubuntu to see if you get a response (to confirm outbound SMTP connections work).

 

Not having a valid mail address is a bad thing too but I can't imagine it's causing this. (fix it by editing /etc/postfix/main.cf and then /etc/init.d/postfix restart)

 

(I'm going to bed now, will pick this up in the morn if nobody else does.)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...