Ad Widget

Collapse

Configuring Jabber (XMPP) notifications?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • moshen
    replied
    Thanks balu!

    Leave a comment:


  • balu
    replied
    Originally posted by moshen View Post
    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 4
    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 23
    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 23
    The problem is that the script uses $_SERVER[argv], but should use $_SERVER['argv']. The one without the quotes is supposed to be a constant called argv, but it has to be a string - hence the notice from PHP.

    Balu

    Leave a comment:


  • BenP
    replied
    Originally posted by Tenzer View Post
    That will however not work if people have specified a custom port or set up encryption which the build-in Jabber client doesn't seem to handle. But otherwise good tip.
    I agree with you for encryption, but server port can be easily managed with iptables.

    I know that's only workaround and not acceptable long term solutions, but help to keep minimum changes to installation packages, and make easier update.

    Any information about those points against 1.6 svn?

    Regards

    --
    Benjamin PREISS

    Leave a comment:


  • Tenzer
    replied
    Originally posted by BenP View Post
    Anyway there is a useful workaround I use: on openfire, create a custom property with the key xmpp.client.idle and value -1

    Zabbix will not have anymore connection problem with it's own jabber client!
    That will however not work if people have specified a custom port or set up encryption which the build-in Jabber client doesn't seem to handle. But otherwise good tip.

    Leave a comment:


  • BenP
    replied
    Originally posted by moshen View Post
    PHP 5.1.6, I updated to 5.2.6 anyway. Tweaked my JID and all seems to work great!

    This begs the question.... why isn't a solution like this included in the base zabbix installation instead of the current jabber solution?

    Thank you very much for your help Tenzer.

    edit:
    Is there a way to suppress the NOTICE messages?

    edit2:
    figured it out. change: error_reporting = E_ALL & ~E_NOTICE
    in php.ini
    Anyway there is a useful workaround I use: on openfire, create a custom property with the key xmpp.client.idle and value -1

    Zabbix will not have anymore connection problem with it's own jabber client!

    Try this and ... enjoy!

    sources: openfire properties

    Regards

    --
    Benjamin PREISS
    Last edited by BenP; 01-09-2008, 13:23.

    Leave a comment:


  • moshen
    replied
    PHP 5.1.6, I updated to 5.2.6 anyway. Tweaked my JID and all seems to work great!

    This begs the question.... why isn't a solution like this included in the base zabbix installation instead of the current jabber solution?

    Thank you very much for your help Tenzer.

    edit:
    Is there a way to suppress the NOTICE messages?

    edit2:
    figured it out. change: error_reporting = E_ALL & ~E_NOTICE
    in php.ini
    Last edited by moshen; 21-08-2008, 19:45.

    Leave a comment:


  • Tenzer
    replied
    Which PHP version are you running this on? (php -v)

    I am running it on PHP 5.2.3 which works without issues.

    Btw. Those messages you are seeing are only notices and not warnings or errors.

    Leave a comment:


  • moshen
    replied
    Gave it a shot (inserting my own credentials as needed) and here's the result:

    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 4
    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 23
    PHP Notice: Use of undefined constant argv - assumed 'argv' in jabberSend.php on line 23

    Please forgive me, I am not very fluent in PHP. I have attempted to cobble together a working perl script to do this, but there are problems with SSL there as well.

    Leave a comment:


  • moshen
    replied
    Thank you very much Tenzer! We are enforcing SSL on our jabber server as well. This could explain our results. I will try out your php script and post the result.

    Leave a comment:


  • Tenzer
    replied
    We are using a PHP jabber solution were I work, because we are using encryption to our jabber server, which doesn't work well with the internal Zabbix configuration.

    I am using this Jabber class acompanied by the following script, which is configured in Zabbix as an external alert script:

    PHP Code:
    #!/usr/bin/php
    <?php
            
    // Check if we have the required parameters
            
    if(!$_SERVER[argv][3])
            {
                    echo 
    "Syntax: ".$_SERVER[argv][0]." <reciepient> <(not used)> <message>\n";
                    exit();
            }

            
    // Require our jabber PHP class
            
    require('class.jabber2.php');

            
    // Create a new jabber object. Parameters: username, password, encryption, port, host
            
    $jabber = new Jabber('[email protected]''uber-secure-password'SECURITY_SSL5223'192.168.0.2');

            
    // Login with the above information
            
    $jabber->login();

            
    // Set ourself as unavailable, so we won't display a "notifier has logged on" message to all people
            
    $jabber->presence(""""TRUE);

            
    // Send the message to the reciepient. Parameters: reciepient, message
            
    $jabber->send_message($_SERVER[argv][1], $_SERVER[argv][3]);

            
    // Disconnect from the jabber server
            
    $jabber->disconnect();
    ?>

    Leave a comment:


  • graeme
    replied
    We're also using OpenFire and have, so far, been unable to get Jabber notifications working. I second the call for a little more info on how to configure it.

    Leave a comment:


  • moshen
    started a topic Configuring Jabber (XMPP) notifications?

    Configuring Jabber (XMPP) notifications?

    I have been unable to find a clear explanation on the configuration of Jabber media types. After configuring my media type as:

    Jabber Identifier: [email protected]

    I'm not sure what I'm supposed to put in this field as the jabber username is [email protected], yet the servername is openfire.domainname.com.

    When I look at the action monitor page I see "receiving error [6][4]" for every send attempt and no entry in the logfiles (that I can identify).

    While searching I have seen this question asked a few times without any real response and unfortunately the extent of the documentation in the Zabbix manual under "Jabber" is "Notifications using Jabber messaging."

    Your help would be greatly appreciated.

    edit:
    system information: Centos 5.2 , Zabbix 1.4.5
    Last edited by moshen; 20-08-2008, 15:43.

Announcement

Collapse
No announcement yet.
Working...
X