serverstatus_id autoincrement int

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

serverstatus_id autoincrement int

Post 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?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: serverstatus_id autoincrement int

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked