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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lukesullivan
Posts: 34
Joined: Tue Jan 24, 2017 11:12 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
kyang

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

Post 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.
lukesullivan
Posts: 34
Joined: Tue Jan 24, 2017 11:12 am

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

Post 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?
kyang

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

Post 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"
lukesullivan
Posts: 34
Joined: Tue Jan 24, 2017 11:12 am

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

Post 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
kyang

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

Post 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.
[email protected]
Posts: 68
Joined: Wed Dec 27, 2017 2:20 pm
Location: Nieuwegein, The Netherlands
Contact:

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

Post by [email protected] »

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.
You do not have the required permissions to view the files attached to this post.
Last edited by [email protected] on Wed May 16, 2018 5:16 pm, edited 1 time in total.
[email protected]
Posts: 68
Joined: Wed Dec 27, 2017 2:20 pm
Location: Nieuwegein, The Netherlands
Contact:

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

Post by [email protected] »

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;
}
You do not have the required permissions to view the files attached to this post.
Last edited by [email protected] on Thu May 17, 2018 3:36 pm, edited 1 time in total.
kyang

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

Post by kyang »

Thanks for the help [user][email protected][/user]

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