Page 1 of 1

serverstatus_id autoincrement int

Posted: Tue Jun 27, 2017 1:43 pm
by kendallchenoweth
We had a problem where only one service was showing up when we looked at the service status page in nagios.

This table is emptied of data when ndo2db is started and is updated using upserts (insert ... if conflict on id update).

There is a servicestatus_id in the nagios_servicestatus table that is an autoincrement field.

It's current value is: 2136938346 and it is declared as an int(11).

Once we hit 2^31 -1 we only keep updating the max value of that service id field. And only see one service from then on....

Is this something that's fixed in the latest version of Nagios?

We thought of the following solutions:

1) we can cause the autoincrement to go back to 1 and start counting up again.
2) we can convert the autoincrement field to a bigint and worry about it some time after the heat death of the universe.

From your work with nagios, do either of you have an opinion on which is the better option? Do you have another suggestion?

Re: serverstatus_id autoincrement int

Posted: Tue Jun 27, 2017 3:47 pm
by cdienger
You can reset the auto incremental for now by truncating the table and running:

Code: Select all

echo 'truncate table nagios_servicestatus;' | mysql -uroot -pnagiosxi -D nagios

The status screen will briefly show no services but will quickly repopulate.

How frequently have you run into this problem? Using bigint may be something we need to look at but I haven't been able to test quite yet.