Skip to content

Commit

Permalink
Merge pull request #7 from i-ky/missing-itemid
Browse files Browse the repository at this point in the history
skip writing values of items missing in DB instead of exiting
  • Loading branch information
LMacPhail authored Feb 1, 2019
2 parents 34cec31 + b7834e1 commit f66967d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/history_influxdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ char *itemid_to_influx_data(zbx_uint64_t itemid)
ret_string = zbx_strdup(NULL, row[0]);
}
else {
zabbix_log(LOG_LEVEL_ERR, "[%s] query result returned null", MODULE_NAME);
exit(EXIT_FAILURE);
zabbix_log(LOG_LEVEL_ERR, "[%s] missing information for itemid " ZBX_FS_UI64, MODULE_NAME, itemid);
ret_string = NULL;
}
DBfree_result(result);
return ret_string;
Expand Down Expand Up @@ -377,6 +377,9 @@ static void history_general_cb(const int item_type, const void *history, int his

influx_data = itemid_to_influx_data(itemid);

if (NULL == influx_data)
continue;

char entry[METRIC_LEN + ITEM_VALUE_LEN + 20];
zbx_snprintf(timestamp, sizeof(timestamp), "%09d%09d", cl, ns);

Expand Down

0 comments on commit f66967d

Please sign in to comment.