Skip to content

zbxsend.py sends a non-integer timestamp #12

@asaveljevs

Description

@asaveljevs

There is a bug in how the clock element of JSON is formed:

for m in metrics:
    clock = m.clock or time.time()
    metrics_data.append(('\t\t{\n'
                         '\t\t\t"host":%s,\n'
                         '\t\t\t"key":%s,\n'
                         '\t\t\t"value":%s,\n'
                         '\t\t\t"clock":%s}') % (j(m.host), j(m.key), j(m.value), clock))

If a timestamp is not provided with the metric, it uses time.time(), which returns a floating-point value and that floating-point value is then inserted into the JSON. However, according to the protocol, Zabbix expects to have an integer Unix timestamp there.

Please see https://support.zabbix.com/browse/ZBX-10234 for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions