Adding Nagvis to Adagios

Hellow,
I’ve been recently experimenting with Nagios/Adagios trying to have it do something more than simple monitoring, but i’ve come to realize i’m spending time doing the same thing every time a new server is set up to add Nagvis, which i think whoever uses nagios would find interesting at least !

Is there any chance nagvis could be added to software center and get installed automagically whenever the Monitoring and inventorying package is installed? Or is there any way someone could point me to the right direction to automate these steps?

This is what works for me, but i do believe some steps could be taken differently, if you have any hints, please share :smiley: (especially on the httpd conf file edit to bind login to ldap)

yum install php-gd php-mbstring php-pdo graphviz graphviz-graphs graphviz-doc rsync -y

download latest nagvis from http://www.nagvis.org/downloads, 1.8.5 is the latest as of today

cd /opt/
wget http://www.nagvis.org/share/nagvis-1.8.5.tar.gz
tar -xvzf nagvis-1.8.5.tar.gz
cd nagvis-1.8.5/
chmod +x install.sh
./install.sh

When the prompt appears, enter

| Please enter the path to the nagios base directory /usr/share/nagios/

| Please enter the path to NagVis base /usr/share/nagvis/

| Do you want to use backend mklivestatus? [y]: y | Do you want to use backend ndo2db? [n]: n | Do you want to use backend ido2db? [n]: n

| Please enter your MKLivestatus socket: unix:/var/spool/nagios/cmd/livestatus

| Please enter the web path to NagVis [/nagvis]: /nagvis

| Please enter the name of the web-server user [apache]: nagios | Please enter the name of the web-server group [apache]: nagios | create Apache config file [y]: y

Edit nagvis config file
vi /usr/share/nagvis/etc/nagvis.ini.php

In the “backend” section, after “[backend_live_1]”, there should be:

backendtype="mklivestatus" socket="unix:/var/spool/nagios/cmd/livestatus" htmlcgi="/nagios/cgi-bin" <-- ADD THIS

vi /etc/httpd/conf.d/nagvis.conf

Add this at the end to bind authentication to NS LDAP (not sure if this is how you properly do it, maybe i should use e-smith templates?)

<Directory "/usr/share/nagvis/share"> SSLRequireSSL AuthType Basic AuthName "NethServer LDAP" AuthBasicProvider ldap AuthLDAPBindDN cn=adagios,dc=directory,dc=nh AuthLDAPBindPassword xxxxxxxxxxxxxxxxxxxxx AuthLDAPURL "ldap://localhost/ou=People,dc=directory,dc=nh?uid?sub?(objectClass=posixAccount)" Require user admin Satisfy all </Directory>

service httpd restart

To add a little more “integration” between Adagios and Nagvis, i usually do:

Login with admin user to https://FQDN/nagvis

Options-> Object Defaults
Tick: hosturl, hostgroupurl, serviceurl and servicegroupurl, and change their values to the url of Adagios’, ie.

Replace
[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]

to
https://FQDN/adagios/status.cgi?hostgroup=[hostgroup_name]

So that icons in nagvis, when clicked, open up Adagios page of that icon

On Adagios, it’s possible to create a “Nagvis” button in the top bar that links to Nagvis’ page

mkdir /etc/adagios/ssi
cp /usr/lib/python2.6/site-packages/adagios/etc/adagios/ssi/common-footer.ssi /etc/adagios/ssi

Edit the copied file
vi /etc/adagios/ssi/common-footer.ssi

Add:
`



  • Nagvis
  • `

    The final result would be something similar to these pictures

    Link to Nagvis on topbar in Adagios:

    Example Nagvis Map with custom background and Adagios host added on top of it

    Clicking on the host icon in Nagvis, opens up the host page in Adagios:

    Hope someone finds this useful!

    3 Likes

    Just to be sure, this is on a 6.8 right?

    Yes, 6.8

    Nice shot @edi! :+1:
    I’ll check this out ASAP! :wink:

    A tip: changing your custom footer (or header?? :smiley:) in this way:

    <a href="/adagios/misc/iframe?url=/nagvis"><i class="glyph-list glyph-grey"></i> Nagvis</a>

    you should be able to keep Adagios top bar even in Nagvis page.

    1 Like

    Thank you Nicola, it works and the result is really pretty :smiley:

    2 Likes