Can't see service comments in Nagios XI, but it is in mysql.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eycklin
Posts: 30
Joined: Wed Apr 10, 2019 8:40 pm

Can't see service comments in Nagios XI, but it is in mysql.

Post by eycklin »

Hi,

In the Nagios XI web interface, we only see comments "test", can not see the comments "2019/03/18 ****"
(as below case)

But we can use mysql command to select them out as below:

[root@JB-NAGIOS01 ~]# mysql -u root -p -e "use nagios;SELECT t2.name1 AS host_name, t2.name2 AS service_description, t2.is_active AS is_active ,t1.author_name AS user, t1.comment_time AS time, t1.comment_data, t1.is_persistent AS is_persistent, t1.deletion_time_usec AS deletion_time_usec FROM nagios_commenthistory t1 LEFT JOIN nagios_objects t2 ON t1.object_id = t2.object_id where is_persistent=1 and deletion_time_usec = '0' and comment_data not like '%避免**********' and t2.name1 = 'vmjsrmsass01.jsidc.com' ORDER BY host_name, service_description DESC;"

Enter password:

+------------------------+-----------------------+-----------+---------+---------------------+------------------------------------------------------------------------+---------------+--------------------+

| host_name | service_description | is_active | user | time | comment_data | is_persistent | deletion_time_usec |

+------------------------+-----------------------+-----------+---------+---------------------+------------------------------------------------------------------------+---------------+--------------------+

| vmjsrmsass01.jsidc.com | Physical Memory Usage | 1 | buckhsu | 2019-08-14 13:28:43 | test | 1 | 0 |

| vmjsrmsass01.jsidc.com | Physical Memory Usage | 1 | buckhsu | 2019-03-29 10:18:17 | 2019/03/18********Warning:99%、Critical:100% | 1 | 0 |

+-


Any way to show all of them in Nagios XI web interface?

Is there a age-period for showing comments?

Thanks,
Eyck Lin
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't see service comments in Nagios XI, but it is in my

Post by scottwilkerson »

The comments displayed are directly from Nagios Core and not out of the database.

If the comment didn't have the "Persistent" checked it will not last through Nagios restarts. Additionally they will not be displayed if someone chooses to delete them.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eycklin
Posts: 30
Joined: Wed Apr 10, 2019 8:40 pm

Re: Can't see service comments in Nagios XI, but it is in my

Post by eycklin »

Hi,

In previos post, you can see the mysql select results:
Both of them are "Persistent", and they are not deleted.
(if it is deleted, you can not see it in the mysql select result, right?).

So, it's really strange.
Because it is normal (can see both comments) as before, but
it(the comment begin with"2019/03/18") can not been seen recently.

In Nagios Core(behind Nagios XI), I can see the comment attibures.
There is a colume named "Expires", is it relative?

or any suggestions to troubleshooting this "unseen comments" problem?

Thanks,
Eyck Lin
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't see service comments in Nagios XI, but it is in my

Post by scottwilkerson »

eycklin wrote:(if it is deleted, you can not see it in the mysql select result, right?).
Incorrect
scottwilkerson wrote:The comments displayed are directly from Nagios Core and not out of the database.
What is displayed in the UI comes directly out of the status.dat file from Nagios.

While NDO2DB does send the comment data to the DB (which is why you can see it in the DB), this DB table is not utilized by Nagios XI for display.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eycklin
Posts: 30
Joined: Wed Apr 10, 2019 8:40 pm

Re: Can't see service comments in Nagios XI, but it is in my

Post by eycklin »

Hi,
What is displayed in the UI comes directly out of the status.dat file from Nagios.
OK, I would like to know why it can be seen in UI about 1 month ago(the the comment begin with"2019/03/18"
which dated 2019-03-29 in mysql), but it dispeared from UI service comments now?

Will the service comments do dispear from NagiosXI UI after some months?
(Do the service comments have a age-period? How long is it?)

The old servcie comments are important for system manager,
is there any way to add it back to status.dat, then displayed in NagiosXI UI?

Thanks,
Eyck Lin
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't see service comments in Nagios XI, but it is in my

Post by scottwilkerson »

The only way persistent comments that do not have an expiration date would disappear from the UI would be if someone accidentally deleted them, or if someone purposely removed the retention.dat while restarting nagios.
eycklin wrote:is there any way to add it back to status.dat, then displayed in NagiosXI UI?
The only way to add the comments back in would be to create them the normal way, or you can do it programmatically using external commands like the following:

Services
https://assets.nagios.com/downloads/nag ... mmand_id=2

Hosts
https://assets.nagios.com/downloads/nag ... mmand_id=1
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked