[icinga-devel] clearing & updating icinga_acknowledgements table

Bruce Pennypacker bruce.pennypacker at tufts.edu
Mon Feb 1 16:47:04 CET 2010

Michael Friedrich wrote:
> Hi,
> Bruce Pennypacker wrote:
>> I've been digging a bit into how the icinga_acknowledgements table is 
>> used since we want to be able to use it for tracking acknowledgments.  
>> It appears (after applying the fix for bug #261 is applied) that data is 
>> inserted into this table yet it's never cleared even when ido2db is 
>> restarted.  At the very least it appears that a call to 
>> ndo2db_db_clear_table should be made for this table in 
>> ndo2db_handle_processdata where all the other tables are cleared.
> I don't really understand why this table should be cleared at ido2db 
> restart. Imho this table is related to historical data, not 
> config/status which will get deleted at startup. The reason why no 
> updates are issued is pretty clear - if you do an acknowledgement, you 
> cannot undo that so it will go straight into the neb module and 
> therefore into the rdbm.

Thanks for the information.  Is there a document somewhere that 
describes in detail what each table is meant for, what data they're 
meant to hold, etc?

My confusion stems from the fact that there is both a comments and a 
commenthistory table, but just an acknowledgements table that you 
indicate is for historical data as well.  If, as you're suggesting, the 
acknowledgements table is meant for historical data only then I'd argue 
that it should be renamed to something like acknowledgementhistory so 
that it's clear what's in it.

I guess I'm just not clear as to why comments and acknowledgments are 
being handled so differently in idodb.  When you acknowledge a service 
problem in Icinga it creates a servicecomment object in status.dat, so 
that implies that it's just a special type of comment.  In idodb it adds 
an entry to the acknowlegedments table but I don't see anything show up 
in either the comments or commenthistory tables.  From what I now 
understand I believe this is expected behavior.

If I manually add either a service or host comment then I see entries 
for them appear in both the comments and commenthistory table.

In both cases all the comments (both the service outage acknowledgement 
and the manually entered ones) are displayed in Icinga on the Comments 
page.  The type is set to either Acknowledgment or User as expected.

If I then delete the user service/host comments they are deleted from 
the comments table but the historical data remains in the commenthistory 

Acknowledgments are removed from status.dat and from the Comments page 
either when the problem clears or when the user deletes the associated 
comment just like they can with other comments.  So aside from the fact 
that an acknowledgment is a special type of comment it behaves virtually 
identically within Icinga itself.  For that reason I'd argue that they 
should be cleared from the acknowlegements table as well.  The comments 
table displays a current snapshot of comments.  The commenthistory table 
stores a history of all comments.  It seems to me that the 
acknowledgments table should behave like the comments table, and a new 
acknowledgementhistory table should be added that maintains a history so 
that all the processing of both comments and acknowledgments is handled 

Hopefully I'm making myself clear here....



More information about the icinga-devel mailing list