ZABBIX BUGS AND ISSUES

DM : Error in md5() call during checksum of host

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.3
  • Fix Version/s: 1.8.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    1.8.3 from debian sid packages.
  • Zabbix ID:
    NA

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.

Issue Links

Activity

Hide
Maxence Dunnewind added a comment -

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

Show
Maxence Dunnewind added a comment - 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
Hide
Alexei Vladishev added a comment -

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

Show
Alexei Vladishev added a comment - Fixed in version pre1.8.5, r17036 with ZBX-416 issue.
Hide
Brad Clarke added a comment -

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?

Show
Brad Clarke added a comment - 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?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: