Ad Widget

Collapse

How to send notifications via Twitter?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris_____
    Junior Member
    • Jun 2014
    • 6

    #1

    How to send notifications via Twitter?

    Hi,

    I'm fairly new to Zabbix and am in the process of setting it up within a test environment. One thing I'd like to be able to do is set up alert notifications via twitter for more severe events.

    Looking around, it seems that people have managed to do this, but I've not been able to put together a working example.

    Has anyone managed to implement this successfully, and if so, would you be willing to share the steps that you took and/or the script that you used?


    Thanks,

    Chris
  • coreychristian
    Senior Member
    Zabbix Certified Specialist
    • Jun 2012
    • 159

    #2
    You would need to create an action that uses an external source/script instead of e-mail.

    Essentially the steps are as follows.

    1. Create a media type (Script, send the variables to the script)
    2. Assign a user that specific media type that has at least read access to the servers/triggers you want to send.
    3. Create an action that will forward triggers to a specific user for the triggers you want.



    With a quick search, here is a link to a bash script for sending a tweet you might be able to steal, mind you I haven't tested the twitter script. (someone else might be able to provide a script, though if the link below works it should be pretty easy to setup)

    http://supertweetnews.140plus.com/p/...-updates/ZeRfz

    Comment

    • Chris_____
      Junior Member
      • Jun 2014
      • 6

      #3
      Thanks, I'm about 75% of the way there now!

      I've used Tweepy along with the instructions at the following site that I found a link to elsewhere on the forum (it's in Spanish):



      I've set up the media type as:

      Name: Tweet
      Type: Script
      Script name: Twitter.py

      and added the media to my user profile and configured the Actions in the same way as I have done for email alerts (except using the option to send only to 'Tweet' rather than 'Email').

      I can run the script successfully from the Zabbix server using
      Code:
      python twitter.py
      However the script isn't running through Zabbix. I am receiving email alerts and if I go into Administration -> Notifications it is reporting that it has run the 'Tweet' action x amount of times, but I'm not receiving any messages.

      Any suggestions as to why this might not be working?

      Comment

      • coreychristian
        Senior Member
        Zabbix Certified Specialist
        • Jun 2012
        • 159

        #4
        I might check step 2 that I mentioned above, make sure the user has access to the see the triggers as I mentioned above.

        Otherwise without looking at the system, if you could provide screen shots for the zabbix portions of the config I might be able to help more.

        Comment

        • Chris_____
          Junior Member
          • Jun 2014
          • 6

          #5
          Thanks for your time coreychristian. I've checked the permissions, which seem fine, and double checked that I can run the script independently of Zabbix (with a successful result). Here are the screen shots of the Zabbix configuration (Media, User and Action config).

          If there's anything that's unclear or you'd like more information please let me know, I appreciate the help.











          (Two more screen shots to follow).
          Last edited by Chris_____; 15-07-2014, 16:36.

          Comment

          • Chris_____
            Junior Member
            • Jun 2014
            • 6

            #6
            [ATTACH]7236[/ATTACH]

            [ATTACH]7237[/ATTACH]

            Comment

            • coreychristian
              Senior Member
              Zabbix Certified Specialist
              • Jun 2012
              • 159

              #7
              I sent you a PM, the first set of attachments are invalid. The second post looks good, only would need to see the first set again, I gave you my e-mail in the PM, might be easier then the forum.

              Comment

              Working...