Ad Widget

Collapse

Why is my script not working?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RedNano
    Junior Member
    • Apr 2017
    • 7

    #1

    Why is my script not working?

    Since the jabber notifications are broken in Centos 7, I'm trying to work around them by using a script to send a notification instead.

    I installed sendxmpp and tested it: It works and I can send messages form the command line.

    However, when I implement the solution into zabbix, the notificaion is seen as sent, but there's nothing actually being sent (not receiving any message)

    My question is Is there a way to see what happens when the script is run? All I can do is restart the zabbix server and wait for it to send a restart notidfication (please, tell me there's a better way to trigger this)

    This is the script I'm using:

    I created /usr/lib/zabbix/alertscripts/sendxmpp.sh with permissions:

    Code:
    -rwxr-xr-x. 1 zabbix zabbix
    The contents of the script are:


    Code:
    #!/bin/sh
    echo "$3" | /usr/bin/sendxmpp -u <username> -j dismail.de -p <password> -s "$2" "$1" -t

    "username" and "password" are substituted fot their respective value without any symbols around


    When I try to run from the command line, I get this:


    Code:
    [root@monitor alertscripts]# ./sendxmpp.sh <someotheruser>@dismail.de Zabbix "This is a test"
    Use of uninitialized value $args{"file"} in lc at /usr/share/perl5/vendor_perl/Net/XMPP/Debug.pm line 154.
    Use of uninitialized value within @_ in lc at /usr/share/perl5/vendor_perl/XML/Stream/Parser.pm line 71.
    Use of uninitialized value within @_ in lc at /usr/share/perl5/vendor_perl/XML/Stream/Parser.pm line 71.
    Use of uninitialized value within @_ in lc at /usr/share/perl5/vendor_perl/XML/Stream/Parser.pm line 71.
    [root@monitor alertscripts]#
    I receive the text. But when zabbix has to run it, there's no message received.




    Also: With the embeded integration of jabber, I get a "tls handshake error" message. I've been lurking the web for days and couldn't find a solution.

    I even downloaded the appliance from the official zabbix page and imported it to my esxi server and the same issue still emerges!

    Any help to ither try to fix the script or to get around that tls error would be really appreciated.


    Thanks!
Working...