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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
PeterDK2
Posts: 13
Joined: Wed Sep 11, 2024 5:45 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
PeterDK2
Posts: 13
Joined: Wed Sep 11, 2024 5:45 am

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

Post 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.
DoubleDoubleA
Posts: 273
Joined: Thu Feb 09, 2017 5:07 pm

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

Post by DoubleDoubleA »

Hi @PeterDK2,

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

Aaron
User avatar
lgute
Posts: 411
Joined: Mon Apr 06, 2020 2:49 pm

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

Post 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.
Please let us know if you have any other questions or concerns.

-Laura
Post Reply