[ZBX-11012] Macro {DISCOVERY.RULE.NAME} might expand to wrong discovery rule name Created: 2016 Jul 19  Updated: 2017 May 30  Resolved: 2016 Aug 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.13
Fix Version/s: 2.2.15rc1, 3.0.5rc1, 3.2.0alpha1

Type: Incident report Priority: Minor
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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:



 Comments   
Comment by Viktors Tjarve [ 2016 Jul 20 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-11012

Comment by Andris Zeila [ 2016 Jul 27 ]

Successfully tested

Comment by Viktors Tjarve [ 2016 Jul 27 ]

Released in:

  • 2.2.15rc1 r61236
  • 3.0.4rc1 r61237
  • 3.1.0 r61238
Generated at Sat Apr 20 13:15:01 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.