In this article I will describe how to install the new Nagios interface "V-Shell" in Ubuntu.
[Prerequisites]
This article requires you to have intermediate knowledge of Ubuntu.
It also assumes that you have a working install of Nagios 3. If you don't please see my previous article "Installing Nagios 3 on Ubuntu" for help.
These instructions has been tested on Ubuntu server 11.04 x64.
[General]
In a previous article I described how to install Nagios 3 on Ubuntu. While that install was fully working, Nagios has (fairly) recently released an optional improved interface which I highly suggest that you take a look at.
The new interface, dubbed V-Shell, looks a lot nicer and extends the functionality of the basic interface that comes with Nagios. I would also seem that V-Shell receives updates and improvements whereas the basic interface is pretty much where it's at.
There are a few things one should know about V-Shell. For one it doesn't actually replace the basic interface, but rather piggybacks on it, parsing it and changing the look. Some features actually link right back into the basic interface.
However, V-Shell is simple and works pretty well and I think that we will see some improvement in the future.
That said, V-Shell is probably not the best interface for Nagios there is and i encourage you to have a look around. I thought Centreon looked very nice but I just couldn't make the damn thing install.
On the subject of installation. I suggest that you go over to nagios.org, find the pdf with the installation instructions for V-Shell and print it out, then use it as toilet paper. Yes, it is in fact that bad.
Not only is it written very specifically for distributions that folder-wise look nothing like Ubuntu, but they also seem to omit about half the instructions needed to make it work.
That is why I wrote this article.
[Installing V-Shell]
Okay, so I will assume that you have a working Nagios 3 setup and are able to access the basic web interface by appending /nagios3/ to the server address.
To install V-Shell follow these simple instructions
- Download V-Shell to your home folder. I use wget so the full command is as follows. Please note that the url to the latest version might change. wget http://assets.nagios.com/downloads/exchange/nagiosvshell/vshell.tar.gz
- Unpack vshell.tar.gz by issuing the following command tar -xf vshell.tar.gz
- My default install of Nagios uses Apache and the root folder is /var/www/. I want V-Shell to be accessible directly from the website root so I simply cleared out all files from /var/www/ and copied the entire V-Shell folder contents to it by issuing the command sudo cp -r /home/eadmin/vshell/* /var/www/
- There are a few files in there that we don't need to be on the website so go ahead and delete the following files using sudo rm; CHANGELOG, gpl.txt, install.sh, README.txt and TODO.txt
- Enter the config folder using cd /var/www/config/
- Somewhere around here is where the V-Shell installation document goes wrong, because it simply tells you to modify the config file and a few things it assumes about Apache. Fortunately I know what to do.
Open vshell.conf with a text editor, I use nano so my command is sudo nano vshell.conf - Since we use the root for vshell, comment out the BASEURL line with a ;
- Set COREURL to "nagios3"
- Set STATUSFILE to "/var/cache/nagios3/status.dat"
- Set OBJECTSFILE to "/var/cache/nagios3/objects.cache"
- Set CGICFG to "/etc/nagios3/cgi.cfg"
- Exit and save, then move the file to /etc/
- Remove the entire config-folder by first going out of it using cd .. and then issuing the command sudo rm -r config
- Go to /etc/apache2/sites-available using cd /etc/apache2/sites-enabled/
- Open the symlinked site file, in my case it was called 000-default so I issued the command sudo nano 000-default
- Find the line that says <Directory /var/www/>
- Below it, change everything so that only text between it and the next </Directory> is the following:
Options None
AllowOverride None
Order allow,deny
allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios3/htpasswd.users
Require valid-user - Exit and save.
- Finally, restart Apache by issuing the following command: sudo /etc/init.d/apache2 restart
And that's it. Fire up your favorite browser and go to http://[server address]/ and login. V-Shell should load nicely.
[A note on folder structure]
This example used the root folder for V-Shell, if you prefer to have V-Shell in a subfolder, for example /vshell/, you can put the files in /var/www/vshell/, change the value of BASEURL above to "vshell" and modify vshell_apache.conf in the config folder to match your paths, copy it to /etc/apache2/conf.d/ and then restart Apache.
Feel free to ask any questions or add comments regarding this post in the comments. I'll try and answer best I can, promise.
Cheers