Ad Widget

Collapse

Enable Jabber Messaging alerts - PHP Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fast.ryder
    Member
    • Apr 2008
    • 46

    #1

    Enable Jabber Messaging alerts - PHP Script

    Hello, everyone.

    Having tried for a long time to activate the native Zabbix Jabber messaging support, I have searched the net for some solution regarding this problem.

    And recently I found the XMPPHP framework at http://code.google.com/p/xmpphp/, tried it out, works just great..

    However, the sample script that is provided at the page doesn´t work at the first time and needs some changing.

    This is the version I used, tried and true, with our Jabber server.

    Code:
    #!/usr/bin/php
    <?php
    
    // Load the necessary class
    include("xmpphp/XMPPHP/XMPP.php");
    
    // Invoke the connect function, give it arguments 
    // Use a static JabberID here, it is the Sender ID from the server
    
    $conn = new XMPPHP_XMPP('jabber.org, 5222, 'dummy', 'dummypass', 'xmpphp', 'domain.tld', $printlog=False);
    $conn->connect();
    $conn->processUntil('session_start');
    $conn->message($_SERVER['argv'][1], $_SERVER['argv'][2]);
    $conn->disconnect();
    ?>
    Please try this out and tell me if it works for you. Note that you must replace stuff like dummy, dummypass,server and domain etc with your authentication credencials.

    Thanks in advance,

    Ivo Pereira
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    You could also take a look at the solution I wrote here: http://www.zabbix.com/forum/showpost...49&postcount=3

    It uses another jabber library, but I don't know if there is any other difference.

    Comment

    • fast.ryder
      Member
      • Apr 2008
      • 46

      #3
      Jabber Messaging

      Hello!


      Indeed, I did see your post first, and tried to use the library, but with no luck.

      I think it has something to do with my Jabber server using some TLS strange option... No luck in sniffing traffic or anything..

      Anyway, I used this library and changed the sample script to accept arguments and voila!! Problem solved in 3 minutes

      In the future, I have to enable "chat room" support so that I can send messages to our chat rooms.

      Have you tried that yet?

      Cheers,

      Ivo Pereira
      IT Consultant
      Portugal

      Comment

      • Tenzer
        Senior Member
        • Nov 2007
        • 316

        #4
        Originally posted by fast.ryder
        I think it has something to do with my Jabber server using some TLS strange option... No luck in sniffing traffic or anything..
        Did you try to change SECURITY_SSL to SECURITY_TLS in the line where the class was created? That may have done it, but I understand if you don't want to change now.

        Originally posted by fast.ryder
        In the future, I have to enable "chat room" support so that I can send messages to our chat rooms.

        Have you tried that yet?
        No, I haven't tried that. Btw, you could just get Zabbix to send a message to several people if you want to, by adding them to the group which should receive the message.

        Comment

        Working...