Page 1 of 1

notes in service template -- appears in core view, but not i

Posted: Fri Apr 13, 2018 1:49 pm
by lukesullivan
I have a service template, where I've added "notes" to the misc tab of the template definition.

When I build a service with that template, the notes appear if I open the service and then open advanced, and view in nagios core.

Is there a way to present those notes directly in the XI interface?

In the attached screenshots, the "please call huit its devops on call for these alerts" is the note that I would like to present in the XI interface.

thanks,

-Luke

Re: notes in service template -- appears in core view, but n

Posted: Fri Apr 13, 2018 3:19 pm
by kyang
Hello,

You could try using the notes component. Which will display another tab where you can have notes.

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

Just download the .zip --> Go to XI Home Page --> Admin --> lower left, click Manage Components --> upload the .zip file --> Each host/service should have a notes tab.

Re: notes in service template -- appears in core view, but n

Posted: Thu Apr 26, 2018 10:08 am
by lukesullivan
thanks, I'll take a look at that.

do you know if I can programmatically add notes, or if I can define notes in the host or service template, such that when using the api to create an object using that template, the notes will automatically be populated?

Re: notes in service template -- appears in core view, but n

Posted: Thu Apr 26, 2018 11:28 am
by kyang
Yes,

If you were looking to add some notes using the API when creating an object.

Using this should do it.

Code: Select all

&notes=yourNotes
Something like this will add the word "test notes" found in the MISC tab for my new host testapihost1 if you look in the Core Config Manager.

Code: Select all

curl -XPOST "http://192.168.3.59/nagiosxi/api/v1/config/host?apikey=mOCi4C8NCZnKdr95Q7ZKunDDhHVdraDRfr9Cjglcf3cLtkQDKPkftW8NT3gltac2&pretty=1" -d "host_name=testapihost1&address=127.0.0.1&check_command=check_ping\!3000,80%\!5000,100%&max_check_attempts=2&check_period=24x7&contacts=nagiosadmin&notification_interval=5&notification_period=24x7&notes=test notes&applyconfig=1"

Re: notes in service template -- appears in core view, but n

Posted: Tue May 15, 2018 4:46 pm
by lukesullivan
any way to have the notes available without having to go into the CCM? Generally I'm not going to let the users use the CCM, but I want to provide notes to them on what to do when a service/host goes critical

thanks,

-Luke

Re: notes in service template -- appears in core view, but n

Posted: Wed May 16, 2018 9:47 am
by kyang
Hello,

Have you tried out the component mention above? It should have a separate notes tab for all hosts/services that only an administrator can edit.

We don't currently have a way of showing the template notes in Nagios XI.

Re: notes in service template -- appears in core view, but n

Posted: Wed May 16, 2018 5:05 pm
You could use the Action Component, we use it to jump to a specfic page with instruction for a given nagios service description.
Looking at your use case you could just display the notes field if someone clicks the "Show Notes" link under Quick Actions
2018-05-16 23_52-Clipboard.png
Although the notes field is not listed on the macro list @ https://assets.nagios.com/downloads/nag ... ios-XI.pdf you can reference it using %notes% and also %notesurl% and %actionurl% can be used.

Re: notes in service template -- appears in core view, but n

Posted: Wed May 16, 2018 5:10 pm
2018-05-17 00_04-Clipboard.png
This is what the simpliest possible code looks like. I uncommented the standard PHP code snippet and made sure a Quick Link is only visible for services with actual notes (either from templates or directly from the service itself)

Code: Select all

if ('%notes%' != "") {
    $showlink = true;
} else {
    $showlink = false;
}

Re: notes in service template -- appears in core view, but n

Posted: Thu May 17, 2018 9:06 am
by kyang
Thanks for the help [user][email protected][/user]

lukesullivan, let us know if you have any more questions.