Ad Widget

Collapse

Configuring Zabbix to send emails via Exim

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gshankar
    Junior Member
    • Apr 2010
    • 4

    #1

    Configuring Zabbix to send emails via Exim

    I've been working through the installation and configuration of Zabbix over the past couple of days and I think I've finally got everything working... except the sending of notifications / alerts.

    I'm running on a Ubuntu server which is using Exim to send emails. I'd previously used this Exim setup to send notifications for Nagios so I know that Exim itself works.

    However, I can't seem to get Zabbix to send out notifications.

    Here's what I've done so far:

    - Set up a "test trigger" like so:
    Trigger severity >= "Information" Send message to User "Admin"

    - The Admin user has a email contact (and I've sent command line emails from Exim on the server using "sendmail" to this email address successfully)
    - The media type for email is set. (I've used 127.0.0.1 as the smtp server address)
    - I've checked the user permissions and it is read/write for all host groups
    - The triggers are definitely getting set but no actions are being called... I think my problem is within Zabbix as it's not actually executing the actions

    And idea how to configure this correctly?
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    Have checked if Zabbix actually tried to send something ?
    If you go to Administration/Audit page and select Actions in dropdown menu, you should see a line for each mail sent by Zabbix.
    If your mails appear there, Error field may give some information.
    If nothing appears, you may have a problem with the rules defined in your "Action" setup.

    Hope this helps
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • gshankar
      Junior Member
      • Apr 2010
      • 4

      #3
      There's nothing in the Audit section. Exim's logs are clean too... This further confirms my hunch that Zabbix is not actually executing the actions I've prescribed (most probably due to something I've set up incorrectly).

      But I'm not sure what I'm doing wrong...

      Comment

      • gshankar
        Junior Member
        • Apr 2010
        • 4

        #4
        I figured it out! My setup was correct afterall. Here's what was happening:

        Triggers are only set when a state changes, therefore all my triggers were either false OR true and were not changing state as the items I was monitoring were not changing state either.

        To successfully test my triggers, I had to do this:

        1- Make an item to ping a server every 5 sec (you can just use a default template item but I wanted results fast...)
        2- Make an action for my server which gets executed if:

        Trigger severity >= "Warning" AND Host = "My Server"

        3- I then created a trigger which gets set if ping = 1 (which it always does...) and volia! I received an email

        The problem I was having was that by creating my "test trigger" before my "test alert" the trigger was already getting set before my alert was saved. And so... i had no idea why I wasn't seeing any notifications.

        Comment

        • ashrocks
          Junior Member
          • Oct 2010
          • 6

          #5
          Only certain emails are sent out of zabbix

          Hi Shankar,
          I'm sure you've figured out on how to get emails now.
          I have the same problem of yours. But its slightly different.
          I am getting emails. I have no problem with that. But not for the actions i have defined. I have tried setting up emails for every alert zabbix creates so that i don't miss on any of the messages set by any trigger on any server.

          So my conditions contains.
          Trigger severity ("Information",or "Warning", or "high" or etc)or (Host A or Host B or Host C or etc).

          Can you tell me how can i configure to get emails on every alert. If you've tried. Or anyone else reading this might have a thought about it.

          I'd really appreciate it.

          Thank you.

          Comment

          • gshankar
            Junior Member
            • Apr 2010
            • 4

            #6
            Hi there,

            Yes in fact I did manage to figure it out

            I'm not sure if this is exactly what you're looking for but you can see my action setup in the picture below:



            Hope that helps. I get emails everytime my server hits a "problem" status and again when the server is back to "ok".

            I think what you're trying to do with severity is correct. But you might want to try setting the condition to "Trigger Severity >= Info" and see if that simplifies things a bit.

            Cheers,
            Ganesh

            Comment

            • ashrocks
              Junior Member
              • Oct 2010
              • 6

              #7
              Emails for all severity

              Hi Ganesh,

              Thank you. That helped. But isn't that to a specific server on a specific severity level.

              What would be the configuration for any kind of events occurring due to triggers and with any severity levels on any host.

              To be specific, any event generate should be sent as an email. How can i do that.

              One way i did which didn't work out was that i didn't use any conditions and sent all the trigger : status to zabbix admin.

              But it didnot send any alerts though

              Comment

              • forAKhaliq
                Junior Member
                • Jan 2012
                • 1

                #8
                Need media configuration to setup zabbix with gmail

                Hello gshankar
                I'v setup exim and zabbix, configured triggers and actions, actions, setup admin email address as well, I'v used gmail smtp configuration to use one of my gmail account to send email from exim. I'm able to send emails from command line using exim - i <recipient address>.

                I checked to send emails on yahoo and gmail as well, it working fine!

                I dont know the what will be the smtp server smtp hello and smtp email I have to provide in zabbix/admistionation/media types/email

                I have used following but its not using exim to send email

                smtp sever: 127.0.0.1
                smtp hello: 127.0.0.1
                smtp email: my email I have configured in exim as sender address

                Infect I dont know exactly how to configure exim with zabbix so that zabbix can use exim to send emails.

                However events are being triggered, also it tries to send email as well but failed with following error

                cannot connect to SMTP server [127.0.0.1]: cannot connect to [[127.0.0.1]:25]: [111] Connection refused

                What are the changes I have to made in media configurations!

                Comment

                Working...