WinPopUps Continued

I knew there was a way to do it.
I just updated my WinPopUp script to the following, following the recipe here

#!/bin/bash
#winpopup.sh
# Send a zabbix message via winpopup to a given host
# Use as an alertscript within zabbix
# Syntax: winpopup $receiptant $subject $message
# Note: zabbix passes $1=receiptiant, $2=subject, $3=message to any script
echo -e "Subject:$2\\n$3" | smbclient -M $1

Excellent. Now I don’t need a script for each PC that I want to message. I can just pass the argument from the Media link of each user.

Strange thing is that I had tried to put $1 on my old script’s destination but it didn’t work for some reason.

Where’s my SMS I hear you shout?

If you liked what you just read, take a chair, grab an  RSS feed and leave a comment. Thanks!


4 Comments
Comments are closed | comments rss [?] | trackback uri [?]
  1. wagzy 18.04.08 / 2pm
    4

    thanks once again.
    I forgot to mention that after zabbix has updated the text file, when I run
    ./winpopup.sh
    I get the popup with the contents of the textfile
    I just do not know why when zabbix executes the script the xmessage popup does not appear.
    Thanks for your support so far. I am really grateful

  2. Db0 17.04.08 / 6pm
    3

    wagzy, I am not certain what you are trying to do. have you tried copying my script and sending the message to a windows machine? This is only for Windows machines (and I also tested in Win2000 so I’m not sure if WinXP or Vista will allow it through their firewall)

    In the code you put in the second post, you seem to be missing a slash
    Try something simple
    echo -e "Recipient = $1 - Subject = $2 Message = $3" > /etc/zabbix/msg.txt
    Does your txt file have inside then the appropriate text?

    if it has the correct fields, then you are passing the wrong format to xmessage (which I do not know how it works)

  3. wagzy 17.04.08 / 5pm
    2

    I tried to edit the popup script to look like this:

    echo -e "$2\n$1 "$3 > /etc/zabbix/msg.txt
    xmessage -buttons OK,CANCEL -file /etc/zabbix/msg.txt

    when I check the contents of /etc/zabbix/msg.txt, zabbix has posted the message there alright, but without the $1-(send to field).
    More importantly, I dont get my

    xmessage -buttons OK,CANCEL -file /etc/zabbix/msg.txt

    to execute.
    I have disabled access control for x-server with
    root@PC#xhost +
    zabbix@PC# export DISPLAY=:0.0

  4. wagzy 17.04.08 / 11am
    1

    Thanks for the very post.
    However I tried sending a popup to localhost(localhost, 127.0.0.1,my IP) but they dont work. i get error message:
    Message start: ERRSRV – ERRmsgoff (Not receiving messages.)
    does samba need some configurations?
    How can I popup a message on the same zabbix server and also to another linux Computer?
    Thank you.



SEO Powered by Platinum SEO from Techblissonline