NagiosEnterprises/ndoutils

Data too long for column

Opened this issue · 1 comments

We experience from time to time messages like the following in our logs:

ndo2db[538624]: mysql_error: 'Data too long for column 'xxx' at row 1'

Are there plans to implement some logic that is capable to truncate data in text based columns? Because otherwise data gets not inserted in the database, because the query fails.

Hi @gahujipo,

First, to resolve your issue, there are two options:

  1. You can modify the schema to fit your individual data better. The schema that we provide in ndoutils is usually a sensible default for most users, but in some cases (long identifiers for hosts/services, very long check output, etc) some queries will fail. So if you want the correct data to always show up in the database, you can just widen the columns which give this error. Widening all columns in this manner may impact performance.

  2. Your other option is to disable STRICT_TRANS_TABLES in /etc/my.cnf or wherever you keep your main MySQL configuration. This will implement the truncation logic you mentioned, without any changes to this project.

As a side note, this project is no longer being maintained. For Nagios XI customers, we've rewritten this project as NDO 3.x, which is currently closed-source.