Ad Widget

Collapse

Needing help with email notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lallhands
    Junior Member
    • Apr 2017
    • 1

    #1

    Needing help with email notification

    Using Zabbix 3.0 on Ubuntu

    So I wrote an email notification script called zabbix-sendmail and placed the script in the /usr/local/share/zabbix/alertscripts/ dir. It works perfectly from command line. No problems there.

    I added the script to Media types and named it Send-Email-Script.

    I added a user named Alert, added Alert to a group that has RW permissions on the host groups & hosts being monitored.

    I added media to the user selecting Send-Email-Script and left it 24/7 NIWAHD, pointing it to the email address I tested via cli.

    I went into Actions and enabled several internal and Discovery.

    The Action Log shows that the correct script is trying to email me at the correct address but it now says "In progress: 3 retries left".

    Any idea what I'm missing here?

    Thank you in advance for any help!
  • joshuamcdo
    Member
    • Nov 2013
    • 76

    #2
    Soo.. The notification section of zabbix is pretty robust.. What is it that your script buys you that Zabbix cannot? That's my first question..

    The second thing is to turn debugging all the way up and see what the server tells you in the logs..

    Thanks,
    J
    Last edited by joshuamcdo; 24-04-2017, 07:35.

    Comment

    • GPegel
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2015
      • 113

      #3
      The first question is not relevant because I can think off about 10 reasons why you want your own e-mail script. In my case, I'm also using an home-made-script because I want to send some extra data and graphs in the mail.

      Anyway... I totally agree with increasing the debug level in the Zabbix Server configuration.

      My 2 cents, are you sure you are using the correct name of the script in your media type? I once created a scipt called "send_mail_scripts.sh" and at the media type "script name" field I typed "send_mail_script.sh" You see what I missed?

      And are you sure the e-mail script is executable by Zabbix?

      Comment

      • joshuamcdo
        Member
        • Nov 2013
        • 76

        #4
        Sending emails w/ graphs seems to be way outside what email notifications were designed for.. Not to mention that viewing graphs on say your phone usually wouldn't have much value and more often than not that's where these things end up.. But different folks different strokes I suppose. I would personally stick with using email notifications for what they intended to be for. To notify you that there is a problem so you have read the text inputs it has sent to you and then decide what to do from there.

        The question is very relevant as he may be trying to do something besides sending graphs, something that Zabbix already does out of the box. The devil is always in the details.

        So please elaborate at least a little on why you need to go outside the box to send alerts. If it includes things like attaching graphs or other items that Zabbix doesn't support out of the box then by all means. I am also curious because you never know. He may be doing something that I want to do but haven't realized it yet.


        J

        Comment

        • GPegel
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2015
          • 113

          #5
          I know that it is outside of the standard Zabbix e-mail notifications but sometimes you have to think out of the box. In my case I send those graphs to technicians so they are able to determine if they need to take action or not. And one picture often says more than 1000 words.

          And as you, I'm also curious about the goal lallhands wants to reach.

          Comment

          Working...