Ad Widget

Collapse

Action with CONDITIONAL operations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbrussich
    Junior Member
    • Feb 2017
    • 8

    #1

    Action with CONDITIONAL operations

    Hi Zabbix

    I have several printers of the same brand, so I created a template for those. That template has some default triggers (like: toner black empty or paper tray empty).

    Some printers are in offices and some are on more remote locations. I would want to send an email to the closest person to that remote location if something needs to be replaced.

    I tried to create one big Action to accomplish that and then differentiate in the operation conditions but that does not seem to work...
    Code:
    ACTION: send mail when toner is empty
    Operation:
    - if hostname = ABC - send mail to person A
    - if hostname = XYZ - send mail to person B
    So if I understand Zabbix correctly, I will have to create an action for each printer and each trigger individually?

    Code:
    ACTION: send mail when toner for printer ABC is empty
    Operation: send mail to person A
    Code:
    ACTION: send mail when paper for printer ABC is empty
    Operation: send mail to person A
    Code:
    ACTION: send mail when toner for printer XYZ is empty
    Operation: send mail to person B
    Code:
    ACTION: send mail when paper for printer XYZ is empty
    Operation: send mail to person B
    Or is there a way to create one big trigger to rule them all?
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    Originally posted by jbrussich
    Hi Zabbix

    I have several printers of the same brand, so I created a template for those. That template has some default triggers (like: toner black empty or paper tray empty).

    Some printers are in offices and some are on more remote locations. I would want to send an email to the closest person to that remote location if something needs to be replaced.

    I tried to create one big Action to accomplish that and then differentiate in the operation conditions but that does not seem to work...
    Code:
    ACTION: send mail when toner is empty
    Operation:
    - if hostname = ABC - send mail to person A
    - if hostname = XYZ - send mail to person B
    So if I understand Zabbix correctly, I will have to create an action for each printer and each trigger individually?

    Code:
    ACTION: send mail when toner for printer ABC is empty
    Operation: send mail to person A
    Code:
    ACTION: send mail when paper for printer ABC is empty
    Operation: send mail to person A
    Code:
    ACTION: send mail when toner for printer XYZ is empty
    Operation: send mail to person B
    Code:
    ACTION: send mail when paper for printer XYZ is empty
    Operation: send mail to person B
    Or is there a way to create one big trigger to rule them all?
    first, why doesn't it work ? you see an error ? you can look at Reports-Action log

    Second, you can dived the printers by host group like
    remote printers A B C sent to X
    local printers Group D E F sent to Y

    you can make 1 action but with many rules in it - but it will be not so organized.

    Comment

    • jbrussich
      Junior Member
      • Feb 2017
      • 8

      #3
      Originally posted by batchenr
      first, why doesn't it work ? you see an error ? you can look at Reports-Action log
      It does work, that was not my question...
      I wanted to know if I could send more granular mails to different people based on the hostname of a printer

      Originally posted by batchenr
      Second, you can dived the printers by host group like
      remote printers A B C sent to X
      local printers Group D E F sent to Y
      This would be true if there was 1 person responsible for all the remote printers and (s)he had to go around for maintenance.

      I would want the nearest person to be responsible for the remote printer.
      And because we have 10+ of those printers, I would have to create 10+ actions (one for each printer, because of the location) because I can't use Operation conditions for this..



      right?

      Comment

      • batchenr
        Senior Member
        • Sep 2016
        • 440

        #4
        if what your saying is :
        printer 1 = person A
        printer 2 = person B
        printer 3 = person C
        printer 4 = person D
        printer 5 = person E
        printer 6 = person F

        etc etc.....

        then to make 1 action
        you can do something like use this :
        change in every printer the Trigger severity
        this item for printer 1 will be disaster and for printer 2 information and 3 high
        and then you add all the persons to the EMAIL notification but-

        in the user media type you choose them to get only info\high\disaster triggers
        and maybe it can reduce your actions to two

        other then that - i done have any idea

        Comment

        Working...