In this tutorial we will learn about, how to install vshell frontend on Nagios Core 4 Ubuntu 12.04 LTS.
Nagios vshell is php based web interface for Nagios Core.It is lightweight and easy to customize.
To get the details of Nagios Vshell , here is the link.
To install vshell frontend on Nagios Core 4 Ubuntu 12.04 LTS
Follow the given below steps to install Nagios Vshell in Ubuntu 12.04 LTS. We expect you have already installed the Nagios Core 4 in Ubuntu. We have already written a post on, install and configure the Nagios Core 4 on Ubuntu 12.04 LTS .
Step 1: Login as superuser and install php-apc
sudo su - apt-get update apt-get install php-apc
Step 2: Download vshell.Here we are downloading with
Step 3: Untar the vshell.tar.gz file
tar -xvzf vshell.tar.gz
Step 4: Change to extracted directory called vshell. Before running ./install.php command. Edit the file install.php in extracted vshell directory .
Comment the line no. 13 define(‘APACHECONF’,”/etc/httpd/conf.d”); by writing // in front of the line
Uncomment the line no. 15 define(‘APACHECONF’,”/etc/apache2/conf.d”); by removing // from the front of the line.
cd vshell vi install.php //define('APACHECONF',"/etc/httpd/conf.d"); //default for ubuntu/debian installs define('APACHECONF',"/etc/apache2/conf.d");
See below given screenshot for reference
Step 5: Install vshell by running command ./install.php inside extracted out vshell directory
Below is the reference from our Server
[email protected]:~/vshell# ./install.php Copying apache configuration file... Copying vshell configuration file... Creating web directory... Copying files... Cleaning up... Restarting apache... * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting ...done. Checking for file locations... Script Complete! [email protected]:~/vshell#
Step 6: After installation it will create two important files in location
(a) /etc/vshell = It is vshell configuration file. You can change the values as per your nagios configuration files in your system.We are not editing in this tutorial because it is okay in our setup
(b) /etc/apache2/conf.d/vshell.conf = It is apache configuration file for vshell.Change the htpasswd file in apache’s vshell.conf file,in case the your htpasswd file path is different. We are not editing because in out setup ,it is correct .
Have a look in both files and do the changes if require as per your system setup
Below given are the reference from our system
[email protected]:~# egrep -v '^;|^$' /etc/vshell.conf BASEURL = "vshell" COREURL = "nagios" STATUSFILE = "/usr/local/nagios/var/status.dat" OBJECTSFILE = "/usr/local/nagios/var/objects.cache" CGICFG = "/usr/local/nagios/etc/cgi.cfg" NAGCMD = "/usr/local/nagios/var/rw/nagios.cmd" NAGLOCK = "/usr/local/nagios/var/nagios.lock" RESULTLIMIT= 100 LANG = "en_GB" TTL = 90 [email protected]:~#
[email protected]:~# cat /etc/apache2/conf.d/vshell.conf #modify this file to fit your apache configuration Alias /vshell "/usr/local/vshell" <Directory "/usr/local/vshell"> # SSLRequireSSL Options None AllowOverride None Order allow,deny Allow from all # Allow from 127.0.0.1 #use the below lines for Nagios XI # AuthName "Nagios Monitor XI" # AuthType Basic # AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users #Use the below lines for a typical Nagios Core installation AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user </Directory> [email protected]:~#
Our htpasswd file path
[email protected]:~# ls -l /usr/local/nagios/etc/htpasswd.users -rw-r--r-- 1 root root 50 Feb 7 21:14 /usr/local/nagios/etc/htpasswd.users [email protected]:~#
Step 7: Restart the apache
Step 8 :Open the vshell URL in web browser. Append /vshell with IP Address of Server / Domain name in URL.
For eg. http://192.168.56.101/vshell
It will ask for apache authenticated user. Here we are giving username nagiosadmin from htpassd file . After login you can see the vshell dashboard