Sending a "Winpopup" as a notification

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

    Sending a "Winpopup" as a notification

    When doing tests that trigger/action work as expected, or if someone wants to get a an instant notification that an event happened i found it useful to use a simple winpopup. Can be send to windows boxes given that the windows messenger service is running, or on linux platforms if configured properly.

    It is quite easy to setup:

    -Install smbclient on the zabbix-server.
    -Create the following simple script that will later be used to send the message. Store it in the directory that zabbix server uses for scripts.
    Default ist /home/zabbix/bin but this can be changed in the zabbix_server-conf.
    Code:
    #!/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
    -Test the script as user zabbix.

    Note: This part just explains how to create and assign a custom media type

    -Create a new media, type=script, Name it for example "WinPopup" and assign the previously created script.
    -Go to the user configuration of the user that you use for alerting, and create a new media for each box, that should receive later the WinPopups.
    (Note: This should also work for groups, but i had a problem using groups in triggers in beta6)
    -Select the Media (in this example WinPopup) and put the netbios name of the box that should receive the message in the "send to" field.
    -Select activate, change "when active" if required and select the severtiy according to your needs.

    -Now setup a trigger, action and assign "send to" to the user that you assigned the media "Winpopup".
    Done ;-)
    http://www.intellitrend.de
    Specialised in monitoring large environments and Zabbix API programming.

    #2
    If require an IP address to make winpopup work

    If your server is behind a private network this should help. It specifies an IP address to go to so you do not have to have the receipiant does not have to be part of the same workgroup.

    #!/bin/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
    RECEIPIANT=$1
    SUBJECT=$2
    MESSAGE=$3
    HOST=${RECEIPIANT%|*}
    IP=${RECEIPIANT#*|}
    echo -e "Subject:$SUBJECT\\n$MESSAGE" | smbclient -M $HOST -I $IP

    Note: This part just explains how to create and assign a custom media type

    -Create a new media, type=script, Name it for example "WinPopup" and assign the previously created script.
    -Go to the user configuration of the user that you use for alerting, and create a new media for each box, that should receive later the WinPopups.
    (Note: This should also work for groups, but i had a problem using groups in triggers in beta6)
    -Select the Media (in this example WinPopup) and put the "netbiosname|ipaddress" of the box that should receive the message in the "send to" field. example: client1|192.168.0.0.1
    -Select activate, change "when active" if required and select the severtiy according to your needs.

    Comment


      #3
      Domain users send popup

      I do not know much English. I 'm sorry
      Hi, Windows 2003 domains, including a PC user, I want to send popup! How can we do?

      Comment


        #4
        You will need to enable the Messenger service on the PCs and make an exception for it in the Windows Firewall.

        For Linux PCs linpopup works well.

        Comment


          #5
          The problem was corrected. Thank you very much.

          Comment


            #6
            One question will be how Windows Vista can do this operation? Windows Xp message service works without any problems I had enough to open, but I do not have such a service in Vista ...

            Comment

            Announcement

            Collapse
            No announcement yet.
            Working...
            X