Comments and Acknologements

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
antorres
Posts: 20
Joined: Thu Aug 22, 2013 12:11 pm

Comments and Acknologements

Post by antorres »

Hi.

I've got a situation going on with a Client. They want to export, control and see all the comments and Acknowledgments on all monitored services.

I Found already the location of a file (var/lib/mysql/nagios/nagios_acknowledgements.MYD) where i see the user that has made acknowledgements, and in other location (/usr/local/nagios/var/status.dat) found all the comments, but no time stamps attached.

Where I can find all this informations regarding this subject, such as, user, message, time stamp. etc.

It`s there a location in the DB where i can make a "select * from" to see and exports those data?


Thank you very much in advance.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Comments and Acknologements

Post by scottwilkerson »

antorres wrote: I Found already the location of a file (var/lib/mysql/nagios/nagios_acknowledgements.MYD) where i see the user that has made acknowledgements
This would not have the comments, only ACK
antorres wrote:and in other location (/usr/local/nagios/var/status.dat) found all the comments, but no time stamps attached.
This is actually where current comments live, and you can get the timestamp as entry_time field

BUT, the proper place to get these would be through the API under the Help menu in Nagios XI you will

Help -> REST API Docs -> Objects Reference -> objects/comment

Here you can get them all in JSON format
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bheden
Product Development Manager
Posts: 179
Joined: Thu Feb 13, 2014 9:50 am
Location: Nagios Enterprises

Re: Comments and Acknologements

Post by bheden »

Absolutely!

Using the 'nagios' database, you can issue the following commands to see comments and comment history (this is very basic):

Code: Select all

SELECT author_name, comment_time, is_persistent, comment_data FROM nagios_comments;
SELECT author_name, comment_time, is_persistent, comment_data FROM nagios_commenthistory;
And to see the acknowledgements (also very basic):

Code: Select all

SELECT author_name, entry_time, is_sticky, persisent_comment, comment_data FROM nagios_acknowledgements;
For something a little bit more advanced (I'm only going to show you the one for commenthistory, but I think you'll be able to figure out with this example for the others):

Code: Select all

SELECT t2.name1 AS host_name, t2.name2 AS service_description, t1.author_name AS user, t1.comment_time AS time, t1.comment_data AS comment FROM nagios_commenthistory t1 LEFT JOIN nagios_objects t2 ON t1.object_id = t2.object_id ORDER BY host_name, service_description DESC;
Hope this helps!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Nagios Enterprises
Senior Developer
antorres
Posts: 20
Joined: Thu Aug 22, 2013 12:11 pm

Re: Comments and Acknologements

Post by antorres »

Thank you very much guys! IT works just fine.

I really appreciate your help.

Best Regards
bolson

Re: Comments and Acknologements

Post by bolson »

Closing this topic as resolved.

Thank you for visiting the Nagios Support Forum!
Locked