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

Macro {DISCOVERY.RULE.NAME} might expand to wrong discovery rule name

XMLWordPrintable

      In src/libs/zbxserver/expression.c:DBget_drule_value_by_event() function the SQL select to get the rule name is wrong - it will simply return first discovery rule name:

      Index: src/libs/zbxserver/expression.c
      ===================================================================
      --- src/libs/zbxserver/expression.c     (revision 61108)
      +++ src/libs/zbxserver/expression.c     (working copy)
      @@ -1191,7 +1191,7 @@
              {
                      case EVENT_OBJECT_DHOST:
                              result = DBselect("select r.%s from drules r,dhosts h"
      -                                       " where r.druleid=r.druleid and h.dhostid=" ZBX_FS_UI64,
      +                                       " where r.druleid=h.druleid and h.dhostid=" ZBX_FS_UI64,
                                              fieldname, event->objectid);
                              break;
                      case EVENT_OBJECT_DSERVICE:
      
      

            Unassigned Unassigned
            wiper Andris Zeila
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: