• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to change the frontend of Nagios with VShell in Ubuntu and Debian

June 21, 2013 by Sharad Chhetri Leave a Comment

How to change the frontend of Nagios with VShell in Ubuntu and Debian

Here in this tutorial we will learn How to install Nagios V Shell to change the frontend.
This is continue of my last post on Installing Nagios in Ubuntu. Kindly read the post.

To install Nagios V Shell follow these steps :

Step 1 : Install php-apc

sudo su -

apt-get install php-apc

Step 2 : Download the latest Nagios V Shell

wget http://assets.nagios.com/downloads/exchange/nagiosvshell/vshell.tar.gz

Step 3: Extract the vshell.tar.gz

tar -xvzf vshell.tar.gz

Step 4: Change to extracted directory vshell and edit 2 lines in the install.php file .

In TARGETDIR give the path where you want to install vshell,Here I have written /usr/local/vshell . This /usr/local/vshell directory will be created by install.php script itself

In APACHECONF give the apache configuration path where you want to save the file (vshell.conf ).
In Ubuntu and debian default path is /etc/apache2/conf.d hence it is given as it is.

cd vshell

vi install.php

define('TARGETDIR',"/usr/local/vshell");

define('APACHECONF',"/etc/apache2/conf.d");

Step 5: Now run the script install.php and it will give the output something similar like this.

root@ip1019621483:~/vshell# ./install.php
Copying apache configuration file...
Copying vshell configuration file...
Creating web directory...
Copying files...
Cleaning up...
Restarting apache...
* Restarting web server apache2
... waiting ...done.
Checking for file locations...
NOTICE: Objects file found at: /var/cache/nagios3/objects.cache
***Update this location in your /etc/vshell.conf file***
NOTICE: Status file found at: /var/cache/nagios3/status.dat
***Update this location in your /etc/vshell.conf file***
NOTICE: cgi.cfg file found at: /etc/nagios3/cgi.cfg
***Update this location in your /etc/vshell.conf file***
NOTICE: Nagios cmd file found at: /var/lib/nagios3/rw/nagios.cmd
***Update this location in your /etc/vshell.conf file***
Script Complete!

Step 6: If you have noticed in output vhsell is guiding us to change the file path in apache conf file. The file path may be different in your server as per your nagios installation.
I recommend you to carefully read the output or save this output in some notepad in your Desktop.

Step 7 : Take a backup of original vshell.conf file.

cp -p /etc/vshell.conf  /etc/vshell.conf.`date +%F`.orig

Step 8: Now we will edit the vshell.conf file as per our nagios settings.

BASEURL = “vshell” (Give the baseurl name means when you open the vshell in web browser it will use this baseurl eg. http://nagios-server/vshell)

COREURL = “nagios3” (This is URL path of Nagios dashboard, in my case I am using http://nagios-server/nagios3/ hence I used the nagios3, if in your case it is different http://nagios-server/nagios/ then use nagios insted of nagios3)

STATUSFILE = “/var/cache/nagios3/status.dat” (Give status.dat file path check as per your system,if you have not find in this path,use find command to search for nagios status.dat file path )

OBJECTSFILE = “/var/cache/nagios3/objects.cache” (Give objects.cache file path check as per your system,if you have not find file in this path,use find command to search for nagios objects.cache file path )

CGICFG = “/etc/nagios3/cgi.cfg” (Give nagios cgi.cfg file path name here)
NAGCMD = “/var/lib/nagios3/rw/nagios.cmd” (Give nagios.cmd file path, check the file does it exist or not, if not then use find command and get the correct path)

NAGLOCK = “/usr/local/nagios/var/nagios.lock” (In this case might be the Directory /usr/local/nagios/var/ does not exist in your system so create a directory by using command mkdir -p /usr/local/nagios/var/ )

BASEURL = "vshell"
COREURL = "nagios3"
STATUSFILE = "/var/cache/nagios3/status.dat"
OBJECTSFILE = "/var/cache/nagios3/objects.cache"
CGICFG = "/etc/nagios3/cgi.cfg"
NAGCMD = "/var/lib/nagios3/rw/nagios.cmd"
NAGLOCK = "/usr/local/nagios/var/nagios.lock"
RESULTLIMIT= 100
LANG = "en_GB"
TTL = 90

Step 9: If you remember in install.php we gave apache conf file path.
Now we will see how it looks. The vshell.conf file was created by install.php itself.

root@ip-10-196-214-83:~# cat /etc/apache2/conf.d/vshell.conf 
#modify this file to fit your apache configuration 

Alias /vshell "/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

root@ip-10-196-214-83:~# 

Step 10: See line no. 24 ( AuthUserFile /usr/local/nagios/etc/htpasswd.users)
Either you can change this file path if you want to use your already created htpasswd file. (Your nagios htpasswd file can be used here) OR we will create a new htpasswd file for vshell through which user/passwd authentication for Vshell will take place.

Now creating new htpasswd file for user nagiosadmin (for vshell)


mkdir -p /usr/local/nagios/etc

htpasswd -m -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Step 11 : Now restart the apache

/etc/init.d/apache2 restart

Step 12 : Now open the web browser(eg. firefox,chrome) and type the URL of vshell

http://Nagios-Server-ip-or-domain.name/vshell

It must ask the User Name and password.
Give Username nagiosadmin and password which you have set.

Now you will see the vshell dashboard (Do’nt worry your bydefault nagios dashboard is also safe ๐Ÿ™‚ i.e http://nagios-server/nagios or http://nagios-server/nagios3 )

nagios vshell
nagios vshell

NOTE: Why we use user nagiosadmin ? Why we have not use any other name ?
Answer: Because in nagios cgi.cfg file nagiosadmin has privileges.
Hence we use the same username nagiosadmin.

This is for reference.

# grep nagiosadmin /etc/nagios3/cgi.cfg
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Install vshell frontend on Nagios Core 4 Ubuntu 12.04 LTS
  2. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  3. Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!
  4. How to install nagios server in Ubuntu 12.04 LTS
  5. How to install and configure nagios nrpe client in Ubuntu with apt-get command
  6. Install and configure nagios core 4 on Ubuntu 12.04 LTS
  7. How to install Nagios 4 from source on Ubuntu 14.04 LTS
  8. How to change hostname in Ubuntu 12.04 and 12.10 without system restart
  9. How to change mysql default data directory in Ubuntu
  10. how to change path of tmpdir in MySQL Server On Ubuntu

Filed Under: Linux, Monitoring Server Tagged With: Nagios, vshell

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

master admin password openerp 7.x

How to increase Password Expire date without resetting the password

fatal error: error writing to /tmp/ccwAjc9Z.s: No space left on device

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

How to protect from port scanning and smurf attack in Linux Server by iptables

Install and optimize the png file by using optipng

30 useful Linux terminal keyboard shortcuts

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy