Page 1 of 2

Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 8:23 am
by jsingleton71
Hello All,

Is there an easy way to add links to the sidebar in Nagiox XI?

Basically I want to integrate NfSen/NfDump into my Nagios XI view without forcing it to be the homepage.

I watched the video on how to use NfSen within Nagios, but that is merely editing the homepage and using a custom URL, which is not really integrating it.

Is there a plugin or addon that allows me to add to the sidebar?

Thanks,
Jeff

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 10:32 am
by mcapra
You could do that with a component. @box293 gave a talk at a past conference on the topic:
https://www.youtube.com/watch?v=wcULFg2dHLc

We also have some documentation:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Your other option would be to use Javascript via the "Custom Includes" component to append a menu item. This Javascript does that, though you won't be able to collapse the custom section:
https://pastebin.com/k5KJAu14

You could change the target to maincontentframe if you wanted the link to load into the iframe and preserve the Nagios XI GUI.

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 10:57 am
by jsingleton71
Hey great! Thank-you for the response.

I will take a look at the pastebin option and see if I can't make that work.

Again, Thanks!

Jeff

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 11:39 am
by cdienger
Thanks for the update Jeff. Keep us posted on your progress or if you need anything else.

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:31 pm
by jsingleton71
Thanks,

So the javascript method doesn't seem to work in XI 5.4.0. I left the example intact just to see if it would work, and I do not see the Custom header anywhere.

Ultimately, I just want an easy way to monitor some Netflow data on my network and Nfsen/Nfdump provides the data I need. Integrating that tool into Nagios in the same way the other things like NagVis is what I was looking for, but without having to code a lot. The option of adding a tool also seems to work for this, which may satisfy my needs, but having it on the main sidebar would be ideal.

As with everything, I will keep hacking away until I get something to work.

Jeff

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:36 pm
by mcapra
Did you do a hard refresh (crtl+f5) when adding the Javascript? I had to do that to get it to render correctly.

The end result in case there's confusion:
2017_04_17_12_36_32_Nagios_XI.png

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:42 pm
by jsingleton71
Ok so, just to be sure I understand.

I save the js snippet from pastebin into a .js file.
Then upload it to the Custom Includes component.
Then hard refresh.

Is there anything else I need to do to get the menu to show?

Jeff

Edit:

And check the box :)

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:43 pm
by mcapra
You might need to reload the parent frame. I did this by clicking the big "Nagios XI" link at the top-left.

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:50 pm
by jsingleton71
Yep it works now that I checked the box next to the js file I uploaded.

Excellent work. Thank-you!

Re: Adding Custom Links to Sidebar

Posted: Mon Apr 17, 2017 12:54 pm
by cdienger
Thanks for the update. Can we lock the thread or did you have any more questions?