Ad Widget

Collapse

Emailing alerts to multiple users

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #1

    Emailing alerts to multiple users

    Hi,
    Would it be possible to extend the email media configuration for a user to allow the specification of lists of zabbix usernames as targets? The idea of this is that the media would resolve to the email medias of the listed users. I wanted to set up an unprivileged dummy account in this way intending to email a group of users when a certain action fired. Oddly, zabbix let me do it but the action didn't fire.

    Of course, I could point the action to a user group. But these users are spread across different zabbix groups. If I create a new group just for them I'll hit permissions problems given the different underlying access levels of the users in different groups. By that i mean that if a user is a member of a privileged group and is then added to a non-privilged group their permissions will drop to the level of the least privileged group...


    Regards,
    David
  • justinc
    Junior Member
    • Aug 2011
    • 20

    #2
    Can you not achieve this with mail distribution list?
    Create a Mail Only user group with read access to all host groups in Zabbix. Then add all distribution list as users and put them in this group.

    Maybe I am misunderstanding but this would seem to be the easiest way to work around permission levels per user with overlapping groups.

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #3
      if you add those users to a new group and don't assign any permissions to that group at all, it should not affect their existing permissions.

      additionally, 2.0 will add an ability to add arbitrary combinations of users/usergroups for operation targets
      Zabbix 3.0 Network Monitoring book

      Comment

      • opera443399
        Junior Member
        • Aug 2013
        • 6

        #4
        1) mailing list!! That is the solution!

        2) my question
        as I quoted:

        ---

        If you are not satisfied with existing media types for sending alerts there is an alternative way to do that. You can create a script that will handle the notification your way. These scripts are located in the directory defined in the Zabbix server configuration file AlertScriptsPath variable. When alert script is executed it gets 3 command-line variables (as $1, $2 and $3 respectively):

        To
        Subject
        Message
        The recipient (“To”) is specified in user media properties. Here is an example alert script:

        #!/bin/bash

        to=$1
        subject=$2
        body=$3

        cat <<EOF | mail -s "$subject" "$to"
        $body
        EOF
        ---

        In my opinion:
        to = '[email protected]'
        but not:
        to = '[email protected],[email protected],[email protected]'

        what I want is a mailing list.
        if I define the action and sending mail to 6 people in a group.
        when triggered, the script will send 6 emails, but not 1.

        the problem is:
        something happened, triggered, but our of my expectation, the script sent 1000 times x 6 = 6000 emails

        as a result:
        the mailing system might block our sender's email address for this excessively frequently action.

        ---
        additionlly, change the zabbix config is much easier than the email config. (I am the email admin in this company? No!)
        what I do expected is the mailing list controlled by zabbix, not my own mailing system's mailing list function.

        ---
        Last edited by opera443399; 07-11-2014, 08:56.

        Comment

        • opera443399
          Junior Member
          • Aug 2013
          • 6

          #5
          my alert script:

          ,,,I can't use CODE tag here.

          as attachment.

          The following errors occurred with your submission:
          Too many live links/images found in your post content. Please edit your post or contact the administrator.
          Attached Files
          Last edited by opera443399; 07-11-2014, 09:27.

          Comment

          Working...