Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-20732

Ineffecient action condition evaluation if many conditions with Host group exist

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Critical Critical
    • None
    • 5.0.20, 6.0.1
    • Server (S)
    • None

      Create multiple actions with host group condition, or multiple such conditions in one action.

      The example host had only one host enabled with one trapper item.
      When trapper item receives value that creates event, a query is executed for each of the host groups mentioned. Here is an output of increased log for this problem:

       20221:20220310:193512.232 In process_actions() events_num:1
       20221:20220310:193512.232 In zbx_dc_get_actions_eval()
       20221:20220310:193512.232 End of zbx_dc_get_actions_eval() actions:7
       20221:20220310:193512.232 In check_events_condition() actionid:7 conditionid:25 cond.value:'14' cond.value2:''
       20221:20220310:193512.232 In check_trigger_condition()
       20221:20220310:193512.232 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=14]
       20221:20220310:193512.240 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.240 End of check_events_condition()
       20221:20220310:193512.240 In check_events_condition() actionid:10 conditionid:22 cond.value:'26' cond.value2:''
       20221:20220310:193512.240 In check_trigger_condition()
       20221:20220310:193512.240 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=26]
       20221:20220310:193512.241 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.241 End of check_events_condition()
       20221:20220310:193512.241 In check_events_condition() actionid:10 conditionid:26 cond.value:'2' cond.value2:''
       20221:20220310:193512.241 In check_trigger_condition()
       20221:20220310:193512.241 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=2]
       20221:20220310:193512.241 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.241 End of check_events_condition()
       20221:20220310:193512.241 In check_events_condition() actionid:10 conditionid:27 cond.value:'7' cond.value2:''
       20221:20220310:193512.241 In check_trigger_condition()
       20221:20220310:193512.241 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=7]
       20221:20220310:193512.241 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.241 End of check_events_condition()
       20221:20220310:193512.241 In check_events_condition() actionid:15 conditionid:23 cond.value:'4' cond.value2:''
       20221:20220310:193512.241 In check_trigger_condition()
       20221:20220310:193512.241 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=4]
       20221:20220310:193512.241 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.241 End of check_events_condition()
       20221:20220310:193512.241 In check_events_condition() actionid:10 conditionid:28 cond.value:'28' cond.value2:''
       20221:20220310:193512.241 In check_trigger_condition()
       20221:20220310:193512.241 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=28]
       20221:20220310:193512.241 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.241 End of check_events_condition()
       20221:20220310:193512.241 In check_events_condition() actionid:8 conditionid:24 cond.value:'6' cond.value2:''
       20221:20220310:193512.241 In check_trigger_condition()
       20221:20220310:193512.241 query [txnlev:1] [select distinct f.triggerid from hosts_groups hg,hosts h,items i,functions f where hg.hostid=h.hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=17287 and hg.groupid=6]
       20221:20220310:193512.242 End of check_trigger_condition():SUCCEED
       20221:20220310:193512.242 End of check_events_condition()
       20221:20220310:193512.242 In check_action_conditions() actionid:8 eventsource:0
       20221:20220310:193512.242  conditionid:24 conditiontype:0 cond.value:'6' cond.value2:'' result:FAIL
       20221:20220310:193512.242 End of check_action_conditions():FAIL
       20221:20220310:193512.242 In check_action_conditions() actionid:7 eventsource:0
       20221:20220310:193512.242  conditionid:25 conditiontype:0 cond.value:'14' cond.value2:'' result:FAIL
       20221:20220310:193512.242 End of check_action_conditions():FAIL
       20221:20220310:193512.242 In check_action_conditions() actionid:15 eventsource:0
       20221:20220310:193512.242  conditionid:23 conditiontype:0 cond.value:'4' cond.value2:'' result:FAIL
       20221:20220310:193512.242 End of check_action_conditions():FAIL
       20221:20220310:193512.242 In check_action_conditions() actionid:10 eventsource:0
       20221:20220310:193512.242  conditionid:22 conditiontype:0 cond.value:'26' cond.value2:'' result:FAIL
       20221:20220310:193512.242  conditionid:26 conditiontype:0 cond.value:'2' cond.value2:'' result:FAIL
       20221:20220310:193512.242  conditionid:27 conditiontype:0 cond.value:'7' cond.value2:'' result:FAIL
       20221:20220310:193512.242  conditionid:28 conditiontype:0 cond.value:'28' cond.value2:'' result:FAIL
      

      It would be much more effective to group at least one action conditions in one query.

      Best solution - find all host groups for this problem in one query, then compare if any actions match internally?

            zabbix.dev Zabbix Development Team
            zux Edgars Melveris
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: