Ad Widget

Collapse

Zabbix, Jabber and Gtalk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alfiere
    Member
    • May 2008
    • 51

    #1

    Zabbix, Jabber and Gtalk

    As far as I know Zabbix doesn't support Gtalk.

    I'm able to interact with different Jabber servers, but "talk.google.com" is not one of them.

    Googling around I found this useful link:


    With this script

    is possible to send messages thought gtalk, I suppose should not be so hard to integrate everything inside the Zabbix core.

    my 2 cents.

    Thanks and Cheers,
    Alf
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    Since nothing in Zabbix is build on Perl, it would be odd (imo) to include this into the core package. Instead I would recommend you to use it as an external alert script, it is very easy to set up.

    Comment

    • alfiere
      Member
      • May 2008
      • 51

      #3
      UPDATE

      After a quite long investigation, I can say:

      Google Gtalk is completely inter operable with the Jabber network.



      1. I registered a free account with jabberes.org (jabber.org seems not working with gtalk)

      2. From gtalk client or from gmail page u need to add the new account [email protected]. In this way the jabberes.org server will automatically provide to authorize the gtalk invitation.

      3. In the Zabbix GUI:
      Administration->Media types->Create Media types->
      Type: Jabber
      Jabber Identifier: follow the schema user@server. In our case [email protected]
      password: of course the [email protected] password

      4. Now, in Administration->Users->"select your user" and insert the jabber media created.
      "send to" will be your [email protected] account.


      During my test I encountered two different problems:
      1. Some jabber servers (jabber.org for example) don't accept the gtalk invite... the request remain always pending
      2. Not all the interactions with the Zabbix GUI are well understood from the zabbix server. I mean, to be sure to commit a change (made by the GUI) I strongly suggest to restart zabbix_server


      Cheers,
      Alf

      Comment

      • ipguy
        Junior Member
        • Nov 2010
        • 12

        #4
        Originally posted by alfiere
        UPDATE

        After a quite long investigation, I can say:

        Google Gtalk is completely inter operable with the Jabber network.



        1. I registered a free account with jabberes.org (jabber.org seems not working with gtalk)

        2. From gtalk client or from gmail page u need to add the new account [email protected]. In this way the jabberes.org server will automatically provide to authorize the gtalk invitation.

        3. In the Zabbix GUI:
        Administration->Media types->Create Media types->
        Type: Jabber
        Jabber Identifier: follow the schema user@server. In our case [email protected]
        password: of course the [email protected] password

        4. Now, in Administration->Users->"select your user" and insert the jabber media created.
        "send to" will be your [email protected] account.


        During my test I encountered two different problems:
        1. Some jabber servers (jabber.org for example) don't accept the gtalk invite... the request remain always pending
        2. Not all the interactions with the Zabbix GUI are well understood from the zabbix server. I mean, to be sure to commit a change (made by the GUI) I strongly suggest to restart zabbix_server


        Cheers,
        Alf
        so how does this work if the jabber.org don't accept the gtalk invite ?

        Comment

        • vins
          Member
          • Feb 2009
          • 31

          #5
          this is the script i use for gtalk alerts: (it needs some cpan modules!)

          #!/usr/bin/perl

          use strict;
          use warnings;

          use Net::Jabber;
          use POSIX qw(strftime);

          my $recip = shift @ARGV;
          my $mensaje = join ("\n",@ARGV);
          my $room = "";

          if ($recip=~m/\@conference/)
          {
          ($room)=$recip=~m/(.*)\@conference/;
          }

          my $jserver="talk.google.com";
          my $jport="5222";
          my $domain="gmail.com.";

          my $user="zabbix-alerts"; # gtalk user authentication
          my $pass="zabbix-alerts";
          my $nick="Zabbix Alert";

          my $con = new Net::Jabber::Client();

          sub Msg($) {
          chomp($_[0]);
          if ($room)
          {
          $con->MessageSend(to=>$recip, type=>"groupchat", body=>$_[0]);
          } else {
          $con->MessageSend(to=>$recip, type=>"chat", body=>$_[0]);
          }
          }

          my $status = $con->Connect(hostname=>$jserver,port=>$jport,connectio ntype=>'tcpip', tls=>'1',componentname=>'gmail.com');

          defined $status or die "can't connect ($!)";

          my @result = $con->AuthSend(username=>$user, password=>$pass, domain=>$domain, resource=>"$0-$$");

          $result[0] eq "ok" or Stop("$result[0] $result[1]");

          $con->RosterGet(); # tell server to send presence info
          $con->PresenceSend(); # tell world that we are logged in

          if ($room)
          {
          $con->MUCJoin(room=>$room, server=>"conference.$jserver", nick=>($nick||$user));
          }

          Msg($mensaje);
          sleep 1;

          $con->Disconnect();



          zabbix@hostname:/home/zabbix/bin# ./jabber.pl [email protected] "sample message"

          Comment

          Working...