[ZBX-3132] DM : Error in md5() call during checksum of host Created: 2010 Oct 22  Updated: 2017 May 30  Resolved: 2011 Jan 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 1.8.3
Fix Version/s: 1.8.5

Type: Incident report Priority: Major
Reporter: Maxence Dunnewind Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1.8.3 from debian sid packages.


Issue Links:
Duplicate
duplicates ZBX-416 Proposal patch: Fix problem of implic... Closed

 Description   

I install 2 nodes with 1.8.3 zabbix-server-pgsql and frontend.
I followed http://www.zabbix.com/documentation/1.8/manual/distributed_monitoring to setup DM .
Master node correctly "see" slave node in the "node list" at top right of web interface.

I then enable the zabbix agent on the slave node. data are sent and a few seconds after, related events appear on the master node (when I select "slave"), but I can't see the agent in the configuration section, neither their graphs.
In the zabbix-agent log on slave node, I can see :

11102:20101022:151408.810 [Z3005] Query failed: [0] PGRES_FATAL_ERROR:ERREUR: la fonction md5(numeric) n'existe pas
LINE 1: ...||status||','||md5(macros)||','||md5(agent)||','||md5(time)|...
^
HINT: Aucune fonction ne correspond au nom donné et aux types d'arguments.
Vous devez ajouter des conversions explicites de type.
[insert into node_cksum (nodeid,tablename,recordid,cksumtype,cksum) select 2,'httptest',httptestid,1,md5(name)||','||applicationid||','||lastcheck||','||nextcheck||','||curstate||','||curstep||','||lastfailedstep||','||delay||','||status||','||md5(macros)||','||md5(agent)||','||md5(time)||','||md5(error)||','||authentication||','||md5(http_user)||','||md5(http_password) from httptest where 1=1 and httptestid between 200000000000000 and 299999999999999]

It seems the md5 is not made on a string but on an integer.



 Comments   
Comment by Maxence Dunnewind [ 2010 Oct 27 ]

Here is a small patch to solve the issue. 2 explicits casts are missing.

— zabbix-1.8.3.orig/src/zabbix_server/nodewatcher/nodesender.c
+++ zabbix-1.8.3/src/zabbix_server/nodewatcher/nodesender.c
@@ -111,7 +111,7 @@ int calculate_checksums(int nodeid, cons
tables[t].fields[f].name);
break;
default :

  • zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, ZBX_FIELDNAME_LEN + 6, "md5(%s)",
    + zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, ZBX_FIELDNAME_LEN + 6, "md5(CAST(%s AS text))",
    tables[t].fields[f].name);
    break;
    }
    @@ -292,7 +292,7 @@ char *get_config_data(int nodeid, int de

if (r[0] == NULL || r[1] == NULL || (dest_nodetype == ZBX_NODE_SLAVE && *s != c[0]) ||
(dest_nodetype == ZBX_NODE_MASTER && *(s+1) != c[0]) || strcmp(r[0], r[1]) != 0)

{ - zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128, "%s,length(%s),", + zbx_snprintf_alloc(&sql, &sql_allocated, &sql_offset, 128, "%s,length(CAST(%s AS text)),", table->fields[f].name, table->fields[f].name); }

Cheers,

Maxence

Comment by Alexei Vladishev [ 2011 Jan 19 ]

Fixed in version pre1.8.5, r17036 with ZBX-416 issue.

Comment by Brad Clarke [ 2011 Nov 08 ]

I've installed 1.8.5 from the Ubuntu packages and am getting this error in the logs. Is the fix really in 1.8.5?

Generated at Thu Apr 25 20:02:42 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.