Ad Widget

Collapse

Custom script not working for 3.2 gmail notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bisana
    Member
    • Jul 2005
    • 87

    #1

    Custom script not working for 3.2 gmail notification

    Hi All,

    I have been trying out Zabbix 3.2.4 installed on Ubuntu 16.04, my intention is to make the email notification work, by using custom script to send email using gmail.
    I have referred the instruction at


    the notification script ( in /usr/lib/zabbix/alertscripts/notification.sh ) which I have made is working fine, when running from command line with parameters given.

    I have given media information for the user. Created action, in actions for operation field , I have given the correct user and media type .

    I have done 8 times the setup on fresh installation today, I am referred the docs and exactly the same I have done, but I am not able to get the email notification using the custom script , and in the Reports=> Notification also I do not see any entry for the users

    Since I have done the same steps today repeatedly, as per the document and not getting the results, like to know whether any one else also faced the same issues for using custom scripts for gmail notification.

    Like to hear from the testing department, on this issue.
    Thanks
    Joseph John
  • zabbixfk
    Senior Member
    • Jun 2013
    • 256

    #2
    Correct me if i am wrong.
    You do not want to use zabbix sending email feature, instead a custom script to send email from gmail which is located at /usr/lib/zabbix/alertscripts/notification.sh?

    If that is the case, i would try to do following things.
    - Place the script in required location.
    - Give sufficient permissions required.
    - Under Actions, Create Operation as Run a command/script. Tie required trigger to this action
    - Give full path of the script with required command line parameters ( unless you want to hardcode details in side the script) - such as for which trigger you are sending this.

    This should work straight away whenever there's the change in trigger state. You will be able to get better info from logs when debug enabled.

    - I had several scripts written for sending out stuffs to diff systems in case of trigger ( eg: whenever i see ping failed to a router, i would trigger an action by executing scripts in zabbix server which would see if router is reachable via diff location and thus send alerts - just an example BTW) - and this works flawlessly ( I am still in 2.2 BTW).

    There's other way as mentioned in this article, but i have not tried it.


    See if this helps.

    Thanks.

    Comment

    • bisana
      Member
      • Jul 2005
      • 87

      #3
      Thanks for the reply
      Yes as said I do not want to use zabbix sending email feature, instead a custom script to send email from gmail
      and in my post I have mentioned the I have done and the url which I refereed which is same as what you advised to do.
      So many instance I tried doing the same, but nothing working, may be there is a real issue with this version, not sure I will check again


      Give full path of the script with required command line parameters ( unless you want to hardcode details in side the script) - such as for which trigger you are sending this.
      Like to clarify whether, you was mentioning the script name in media type definition,

      Thanks
      Joseph
      Last edited by bisana; 06-03-2017, 20:04.

      Comment

      • bisana
        Member
        • Jul 2005
        • 87

        #4
        Adding media definition screen shots
        Last edited by bisana; 07-03-2017, 00:21.

        Comment

        • bisana
          Member
          • Jul 2005
          • 87

          #5
          In reports action logs, I can see the messages that mails are send

          Hi, I have created some hosts and then some trigger, I could see in
          Reports -- Action Log
          entries coming and the messages shows that email has been send through custom scrip to so and so email id , but when checked in the email there is no email.
          I have created the custom script as said in

          made it executable, checked it function by running on command line, and it sends the message when I gave the To, Subject,Body parameter on the command line, so the script which I have made is correct

          In the Recports-action log , it is shown that messages are send, but not received in my inbox, what could have gone wrong

          Comment

          • bisana
            Member
            • Jul 2005
            • 87

            #6
            THANKS A LOT, it is working now

            THANKS
            I have done a fresh installation again and tried out, it is working now
            thanks
            Now again going to do it and see where I have gone wrong
            thanks
            Joseph John

            Comment

            Working...