LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Nagios e-mailer (https://www.linuxquestions.org/questions/linux-software-2/nagios-e-mailer-811481/)

edwardcode 06-01-2010 09:38 AM

Nagios e-mailer
 
I have downloaded and configured nagios to moniter some services. I want nagios to notify me by my e-mail (blabla@yahoo.com) or what ever. There is a plugin that says it can do that but i do not know what to make of it. http://exchange.nagios.org/directory...mailer/details

I put the .pl file in the libexec dir and copied and pasted the command.cfg stuff in to the command.cfg file and did the same for contacts. At the bottom of his page it says ".... rest of contact details .... "

What does that mean

All i really want is an e-mail setting in my personal e-mail account notifing me of stuff.

EricTRA 06-01-2010 11:21 AM

Hello,

As indicated on the page you're referring to, this script is a replacement for the basic Nagios emailer. Nagios without any extra script already sends emails on alerts, warnings etc. Have you tried the basic Nagios emailer? I'm assuming you're just missing a MTA (Mail Transfer Agent) like Postfix or Sendmail. The simplest is Postfix in my opinion. You can easily configure it to relay all mails to your mail account.

But you'll have to be aware that if you're planning on sending to Yahoo or GMail, that you'll have to do some extra tweaking since they don't accept relaying from dynamic IP.

Kind regards,

Eric

edwardcode 06-01-2010 01:20 PM

do you happen to know how to install and/or configure a MTA or know of a howto so i can get this nagios server up and running the way it needs to be.

EricTRA 06-01-2010 01:29 PM

Hello,

I can try ;) Can you tell me what distro you're using so can I provide the correct commands? I imagine if you installed Nagios that you have root console access or sudo and that you're acquainted with working at console level. I usually install Postfix, so if you know how to install that for your distro then go ahead and do so.

Kind regards,

Eric

edwardcode 06-01-2010 01:36 PM

Yes I am running Red Hat Enterprize Linux (RHEL) 5.5. Yes I am very well acquainted with the root console level.

Thank for getting back to me so quickly.

EricTRA 06-01-2010 01:38 PM

Hello,

OK, do you have a RHN subscription or do you have external repositories set up? Do you think you can install Postfix? (I'm not so familiar with RedHat itself, mostly Debian, some CentOS).

Kind regards,

Eric

edwardcode 06-01-2010 01:45 PM

Yes I can install Postfix my self. I am more concerned about the configuration part of things

EricTRA 06-01-2010 01:48 PM

Hello,

If you're just going to relay mails to another mail server then it's not that difficult. Can I ask to what sort of server you want to relay too? Yahoo, GMail, your own mail.domain.com, other? If you're going to relay to the Yahoo,Gmail kind, is your server behind a fixed IP or a dynamic one? Does your ISP block ports to your knowledge?

Kind regards,

Eric

edwardcode 06-01-2010 01:50 PM

I would like to get it to send to a yahoo server and i do nto knwo if my ISP blcoks ports or not. How would I find that out

EricTRA 06-01-2010 02:02 PM

Hi,

No experience with Yahoo, but let's try. Do you know to what port you send you're outgoing mail? In other words what's the port of the smtp server of Yahoo? If you can find that out, then you can try telnetting to it and see if you get a response.
Code:

telnet server 25
if the SMTP port is 25.

Kind regards,

Eric

edwardcode 06-02-2010 06:08 AM

You know, if you think it will be easier you can just coppy and past you configuration files and there locations and I can make some ajustments so it can fit my needs.

EricTRA 06-02-2010 08:26 AM

Hello,

The only file you normally have to edit is /etc/postfix/main.cf (that's in Debian, your main.cf might be located in another place). What I had to put in was this:
Code:

myhostname = hostname.mydomain.es
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smtp.gmail.com, localhost, hostname.mydomain.es
relayhost =
mynetworks = 172.25.0.0/16,127.0.0.0/8,192.168.0.0/16,10.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost,172.25.192.35
canonical_maps = hash:/etc/postfix/canonical
relay_domains = hostname.mydomain.es

and all mail from this server gets redirected to our GMail for enterprises. I have similar setup on all our other servers (LAN and/or VPN) that need mail enabled but in those configs the mydestination parameter only holds the name hostname.mydomain.es. Worth mentioning is that we have fixed IP. I didn't even have to put in SASL authentication which might be necessary in other cases. Hope this helps you out.

Kind regards,

Eric

PS: Sorry for the delay but I had to teach class, followed by meeting and lunch.

edwardcode 06-02-2010 08:59 AM

Do you have the Nagios confiuration files? If so could i see the Commands.cfg and the contacts.cfg files?

EricTRA 06-02-2010 11:30 AM

Hi,

I'll post those tomorrow from work.

Kind regards,

Eric

edwardcode 06-02-2010 01:08 PM

Thank you


All times are GMT -5. The time now is 09:43 AM.