Page 1 of 1

New History Tab in 2024R1.2.x contains all comments from other objects

Posted: Wed Sep 11, 2024 6:16 am
by PeterDK2
Since Nagios version 2024R1.2 the history tab is back for hosts and services.
When you acknowledge an alert the history tab shows 2 records of type "acknowledgement" and type "comment".
Both have the same data (the comment) but the acknowledgement has the state specified and the comment has "N/A" as state.
So far so good, although it's not really necessary to have the separate comment as an extra record.
History tab.png

However, that same comment is also shown on the history tab of other services and not only for that host.
The history tab just shows all comments ever made for any service.
History tab comment.png

This seems like a bug in the query to the comments table

Re: New History Tab in 2024R1.2.x contains all comments from other objects

Posted: Wed Sep 11, 2024 7:32 am
by PeterDK2
I found a possible solution by adding a where clause in the query for the comments
In file /usr/local/nagiosxi/html/includes/components/historytab/historytab_content.php
go to line 60 and add "WHERE NC.object_id = $object_id ". before the GROUP BY

This makes sure that only comments are shown for the object queried.

Re: New History Tab in 2024R1.2.x contains all comments from other objects

Posted: Wed Sep 11, 2024 1:25 pm
by DoubleDoubleA
Hi @PeterDK2,

Thanks for these notes, we will take a look it.

Aaron

Re: New History Tab in 2024R1.2.x contains all comments from other objects

Posted: Tue Oct 29, 2024 3:00 pm
by lgute
Hi @PeterDK2,

An Issue has been created to address the improvements requested.

To verify resolution, you can look for [GL:XI#1292] in future XI Changelog entries.