Multi Line Comments

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cstuart
Posts: 37
Joined: Thu May 02, 2019 8:18 am

Multi Line Comments

Post by cstuart »

I'm attempting to add comments using the ADD_SVC_COMMENT functionality of nagios.cmd. My comments have multiple lines, but only one line is displayed if I use a /n. I'm trying to include a portion of a log file as a comment to assist in troubleshooting. Are multi line comments possible? Is using nagios.cmd the best way to do this?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Multi Line Comments

Post by lmiltchev »

I tried using the ADD_SVC_COMMENT external command in order to add "multi-line" comments but I was not able to. We will have to check with our developers on Monday to see if this is even possible. Having said that, there is another option. You could try using the "Object Notes" component. You can download the component from the Nagios Exchange:

https://exchange.nagios.org/directory/A ... nt/details

and install it as you would any other component.

Admin > Manage Components > Browse > objectnotes.zip > Upload & Install

You will see a new tab, called "Notes" under the "Service Status Detail". Go to "Notes", type your multi-line comment, and click on "Save Changes".

Let us know if this helped. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
cstuart
Posts: 37
Joined: Thu May 02, 2019 8:18 am

Re: Multi Line Comments

Post by cstuart »

Thanks. I'm looking to add these multi line entries via an event handler, so I would need to be able to enter notes via the API or /usr/local/nagios/var/rw/nagios.cmd
cstuart
Posts: 37
Joined: Thu May 02, 2019 8:18 am

Re: Multi Line Comments

Post by cstuart »

I've looked through the documentation for the API & external commands, but I didn't see anything about being able to read/write from/to this new notes field. I'm hoping that I'm just missing it.

My event handler is grabbing the last snippet of logs associated with the most recent failure. Having this information available through Nagios would save a bit of time for my staff as they won't have to manually go through the logs.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Multi Line Comments

Post by lmiltchev »

I spoke to our developers, and I was told that multi-line comments cannot be passed to the pipe. You can file a feature request on github if you wish, for adding this functionality in the future.

https://github.com/NagiosEnterprises/nagioscore/issues

It may be possible to come up with a mysql query for feeding a "multi-line" text to the xi_options table in the nagiosxi db, and view the comments via the "Object Notes" component. However, this is out of scope of nagios support.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked