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.
Comments and Acknologements
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Comments and Acknologements
This would not have the comments, only ACKantorres 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 is actually where current comments live, and you can get the timestamp as entry_time fieldantorres wrote:and in other location (/usr/local/nagios/var/status.dat) found all the comments, but no time stamps attached.
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
-
bheden
- Product Development Manager
- Posts: 179
- Joined: Thu Feb 13, 2014 9:50 am
- Location: Nagios Enterprises
Re: Comments and Acknologements
Absolutely!
Using the 'nagios' database, you can issue the following commands to see comments and comment history (this is very basic):
And to see the acknowledgements (also very basic):
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):
Hope this helps!
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;Code: Select all
SELECT author_name, entry_time, is_sticky, persisent_comment, comment_data FROM nagios_acknowledgements;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;As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Nagios Enterprises
Senior Developer
Nagios Enterprises
Senior Developer
Re: Comments and Acknologements
Thank you very much guys! IT works just fine.
I really appreciate your help.
Best Regards
I really appreciate your help.
Best Regards
-
bolson
Re: Comments and Acknologements
Closing this topic as resolved.
Thank you for visiting the Nagios Support Forum!
Thank you for visiting the Nagios Support Forum!