Ad Widget

Collapse

Problem with sending jabber messages via script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • watto
    Member
    • Jun 2008
    • 47

    #1

    Problem with sending jabber messages via script

    Hi.
    I'm use this script to send jabber messages:

    cat xmpp.sh
    #!/usr/local/bin/bash
    echo "$3" | sendxmpp -j jabber.ru -u user -p pass "$1"

    Zabbix tell me, that message successfully send, but really nothing happened. I'm modify the script for testing:

    cat xmpp.sh
    #!/usr/local/bin/bash
    touch /tmp/123
    echo "$3" | sendxmpp -j jabber.ru -u user -pass "$1"

    The /tmp/123 is created, so i think is no problem to call this script by zabbix.
    If i run the script manually, messages are recieving ok.
    FreeBSD 7.0, ZABBIX 1.6.
    Whats the problem?
    Thanks.
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    It could be a path issue. Try to write the full path to sendxmpp in the script instead.

    Comment

    • watto
      Member
      • Jun 2008
      • 47

      #3
      Thanks! I'm a idiot

      Comment

      • marcoslack
        Junior Member
        • Dec 2008
        • 5

        #4
        Hi guys

        my problem:

        spike@strider:~$ echo test | sendxmpp -u zabbix -j jabber.myserver -p lanza -v marcos@myserver
        sendxmpp: Connect: 1
        Error 'AuthSend': error: not-authorized[?]
        sendxmpp: Disconnect

        somebody help?

        ps: in my other machine with same perl modules settings:
        athena@Security:~$ echo test | sendxmpp -u zabbix -j jabber.myserver -p lanza -v marcos@myserver
        sendxmpp: Connect: 1
        sendxmpp: AuthSend: ok
        sendxmpp: MessageSend
        sendxmpp: Disconnect

        I received message in my jabber client
        Last edited by marcoslack; 16-12-2008, 17:49.

        Comment

        • Tenzer
          Senior Member
          • Nov 2007
          • 316

          #5
          You could try to use the "-d" switch in order to get debugging output. The error message doesn't make much sense to me.

          A search for the error message however lists this page, which discusses the same issue: http://www.igniterealtime.org/community/thread/20551

          Comment

          • marcoslack
            Junior Member
            • Dec 2008
            • 5

            #6
            Tenzer:

            this is my error:

            root@strider:~$ echo test | sendxmpp -d -u zabbix -j myserver -p lanza -v marcos.santiago@myserver
            XML::Stream: new: hostname = (strider)
            XML::Stream: SetCallBacks: tag(node) func(CODE(0x87763ac))
            XMPP::Conn: SetCallBacks: tag(message) func(CODE(0x814f408))
            XMPP::Conn: SetCallBacks: tag(presence) func(CODE(0x877661c))
            XMPP::Conn: SetCallBacks: tag(iq) func(CODE(0x87763c4))
            XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietfarams:xml:ns:xmpp-tls"]) func(CODE(0x877df1c))
            XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietfarams:xml:ns:xmpp-sasl"]) func(CODE(0x877e1c8))
            XMPP::Conn: Connect: host(myserver:5222) namespace(jabber:client)
            XMPP::Conn: Connect: timeout(10)
            XML::Stream: Connect: type(tcpip)
            XML::Stream: Connect: Got a connection
            XML::Stream: Send: (<?xml version='1.0'?><stream:stream version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='myserver' from='strider' xml:lang='en' >)
            XML::Stream: Read: buff(<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="myserver" id="18b651c4" xml:lang="en" version="1.0">)
            XML::Stream: _handle_root: sid(newconnection) sax(XML::Stream::Parser=HASH(0x877e828)) tag(stream:stream) att( xmlns jabber:client xmlns:stream http://etherx.jabber.org/streams version 1.0 from myserver id 18b651c4 xml:lang en )
            XML::Stream: Read: buff(<stream:features><starttls xmlns="urn:ietfarams:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietfarams:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>)
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(stream:features) att( )
            sax(XML::Stream::Parser=HASH(0x877e828)) tag(starttls) att( xmlns urn:ietfarams:xml:ns:xmpp-tls )
            XML::Stream: Node: _handle_element: check( 0 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(starttls)
            XML::Stream: Node: _handle_close: check( 1 )
            XML::Stream: Node: _handle_close: check2( 0 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanisms) att( xmlns urn:ietfarams:xml:ns:xmpp-sasl )
            XML::Stream: Node: _handle_element: check( 0 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism) att( )
            XML::Stream: Node: _handle_element: check( 1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(PLAIN)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(PLAIN)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism)
            XML::Stream: Node: _handle_close: check( 2 )
            XML::Stream: Node: _handle_close: check2( 1 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism) att( )
            XML::Stream: Node: _handle_element: check( 1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(CRAM-MD5)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(CRAM-MD5)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism)
            XML::Stream: Node: _handle_close: check( 2 )
            XML::Stream: Node: _handle_close: check2( 1 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism) att( )
            XML::Stream: Node: _handle_element: check( 1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(ANONYMOUS)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(ANONYMOUS)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism)
            XML::Stream: Node: _handle_close: check( 2 )
            XML::Stream: Node: _handle_close: check2( 1 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism) att( )
            XML::Stream: Node: _handle_element: check( 1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(DIGEST-MD5)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(DIGEST-MD5)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanism)
            XML::Stream: Node: _handle_close: check( 2 )
            XML::Stream: Node: _handle_close: check2( 1 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(mechanisms)
            XML::Stream: Node: _handle_close: check( 1 )
            XML::Stream: Node: _handle_close: check2( 0 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(compression) att( xmlns http://jabber.org/features/compress )
            XML::Stream: Node: _handle_element: check( 0 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(method) att( )
            XML::Stream: Node: _handle_element: check( 1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(zlib)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(zlib)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(method)
            XML::Stream: Node: _handle_close: check( 2 )
            XML::Stream: Node: _handle_close: check2( 1 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(compression)
            XML::Stream: Node: _handle_close: check( 1 )
            XML::Stream: Node: _handle_close: check2( 0 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(auth) att( xmlns http://jabber.org/features/iq-auth )
            XML::Stream: Node: _handle_element: check( 0 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(auth)
            XML::Stream: Node: _handle_close: check( 1 )
            XML::Stream: Node: _handle_close: check2( 0 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(stream:features)
            XML::Stream: Node: _handle_close: check( 0 )
            XML::Stream: Node: _handle_close: check2( -1 )
            XML::Stream: Process: block(0)
            XMPP::Conn: Connect: connection made
            XML::Stream: SetCallBacks: tag(node) func(CODE(0x877e30c))
            sendxmpp: Connect: 1
            XMPP::Conn: AuthSASL: shiney new auth
            XML::Stream: Send: (<auth xmlns='urn:ietfarams:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'></auth>)
            XMPP::Conn: AuthSASL: haven't authed yet... let's wait.
            XMPP::Conn: Process: timeout(1)
            XML::Stream: Read: buff(<challenge xmlns="urn:ietfarams:xml:ns:xmpp-sasl">cmVhbG09ImphYmJlci5ncnVwb3RjaS5jb20uYnIiLG5v bmNlPSJPTHJncms2bUJBVnNGcS9LVE1UVVRLRzVTdFFqT0Z2T3 ZOUHU4NzB4Iixxb3A9ImF1dGgiLGNoYXJzZXQ9InV0Zi04Iixh bGdvcml0aG09Im1kNS1zZXNzIg==</challenge>)
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(challenge) att( xmlns urn:ietfarams:xml:ns:xmpp-sasl )
            XML::Stream: Node: _handle_element: check( -1 )
            XML::Stream: Node: _handle_cdata: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) cdata(cmVhbG09ImphYmJlci5ncnVwb3RjaS5jb20uYnIiLG5v bmNlPSJPTHJncms2bUJBVnNGcS9LVE1UVVRLRzVTdFFqT0Z2T3 ZOUHU4NzB4Iixxb3A9ImF1dGgiLGNoYXJzZXQ9InV0Zi04Iixh bGdvcml0aG09Im1kNS1zZXNzIg==)
            XML::Stream: Node: _handle_cdata: sax(XML::Stream::Parser=HASH(0x877e828)) cdata(cmVhbG09ImphYmJlci5ncnVwb3RjaS5jb20uYnIiLG5v bmNlPSJPTHJncms2bUJBVnNGcS9LVE1UVVRLRzVTdFFqT0Z2T3 ZOUHU4NzB4Iixxb3A9ImF1dGgiLGNoYXJzZXQ9InV0Zi04Iixh bGdvcml0aG09Im1kNS1zZXNzIg==)
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(challenge)
            XML::Stream: Node: _handle_close: check( 0 )
            XML::Stream: Node: _handle_close: check2( -1 )
            XML::Stream: Send: (<response xmlns='urn:ietfarams:xml:ns:xmpp-sasl'>YXV0aHppZD0iemFiYml4QGphYmJlci5ncnVwb3RjaS5j b20uYnIiLGNoYXJzZXQ9dXRmLTgsY25vbmNlPSI5MjhhMTJkNG UxNDBlZjVlYTdlNTZmYzk2NmY3ZjE5ZSIsZGlnZXN0LXVyaT0i LyIsbmM9MDAwMDAwMDEsbm9uY2U9Ik9McmdyazZtQkFWc0ZxL0 tUTVRVVEtHNVN0UWpPRnZPdk5QdTg3MHgiLHFvcD1hdXRoLHJl YWxtPSJqYWJiZXIuZ3J1cG90Y2kuY29tLmJyIixyZXNwb25zZT 04ZjdhNTE0Y2M2OTU3ZWZiYjVjYjZiNzBlNjc2NTM5Yix1c2Vy bmFtZT0iemFiYml4Ig==</response>)
            XML::Stream: Process: block(0)
            XMPP::Conn: AuthSASL: haven't authed yet... let's wait.
            XMPP::Conn: Process: timeout(1)
            XML::Stream: Read: buff(<failure xmlns="urn:ietfarams:xml:ns:xmpp-sasl"><not-authorized/></failure>)
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(failure) att( xmlns urn:ietfarams:xml:ns:xmpp-sasl )
            XML::Stream: Node: _handle_element: check( -1 )
            XML::Stream: Node: _handle_element: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(not-authorized) att( )
            XML::Stream: Node: _handle_element: check( 0 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(not-authorized)
            XML::Stream: Node: _handle_close: check( 1 )
            XML::Stream: Node: _handle_close: check2( 0 )
            XML::Stream: Node: _handle_close: sid(18b651c4) sax(XML::Stream::Parser=HASH(0x877e828)) tag(failure)
            XML::Stream: Node: _handle_close: check( 0 )
            XML::Stream: Node: _handle_close: check2( -1 )
            XML::Stream: Process: block(0)
            XMPP::Conn: AuthSASL: Authentication failed.
            Error 'AuthSend': error: not-authorized[?]
            XML::Stream: Send: (</stream:stream>)
            XML::Stream: SetCallBacks: tag(node) func(CODE(0x877e6a8))
            XMPP::Conn: Disconnect: bye bye
            sendxmpp: Disconnect
            root@strider:~$

            PS: I commented the line return $self->AuthSASL(%args); but doesn't work


            thankz for help-me!

            Comment

            Working...