• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
sharadchhetri.com

sharadchhetri.com

Linux,Cloud Computing And DevOps

  • Home
  • Linux
  • CloudComputing
    • Introduction Cloud Computing
    • Amazon AWS
  • Free E-Books
  • About Me

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

Do'nt be greedy, share the knowledge!

  • Click to share on Facebook (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)

Related

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

Follow Us

  • Facebook
  • Twitter
  • GitHub
  • YouTube

Recent Posts

  • How to install Java (OpenJDK) on Ubuntu Linux
  • How to install Groovy on Ubuntu 20.04 LTS
  • How to Disable selinux in Red Hat or CentOS
  • How to remove date from WordPress Post URL
  • How to install Mariadb 10.4 server on CentOS 8 / RHEL 8

Top Posts & Pages

  • How to delete mail queue in Postfix
  • How to fix read only USB pen drive in Ubuntu
  • How to set hostname and FQDN on CentOS 7 and RHEL 7
  • How to start / stop / restart / reload iptables on CentOS 7 / RHEL 7
  • 4 different commands to check the load average in linux
  • How to install MySQL Server 5.6 on CentOS 7 / RHEL 7
  • How to setup Jenkins Credentials for Git repo access
  • How to print particular line number by using sed command
  • How to create Jenkins user by command line and GUI
  • How to find absolute path of command on Linux / Unix : which command

DevOps Posts

  • vagrant cloud flow

    Install Vagrant on Ubuntu and create first VM

  • git jenkins credential github

    How to setup Jenkins Credentials for Git repo access

  • terraform

    how to install terraform in Linux : CentOS-Ubuntu

  • docker image

    How to create Ubuntu docker base image

  • Install Ansible on Ubuntu / CentOS / RHEL

Footer

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Sharad Chhetri is an experienced Linux - Cloud Engineer & freelancer. Working on Open Source Technology since RHEL 4.0 (Red Hat Enterprise Linux). He loves sharing the knowledge which earned from real scenarios. Don't be surprised if you find him in technology seminars and meetup groups. You can contact him on email for freelance projects at admin@sharadchhetri.com. Read More…

Tags

Amazon AWS apache automation awk bash script CentOS centos 7 debian devops docker freebsd ftp ghost git grep hostname jenkins kvm linux linux command linux commands MariaDB Server mysql Nagios nginx Octopress owncloud Owncloud 6 php postfix postgres python Red Hat rpm sed selinux ssh swap ubuntu user management vagrant varnish virtualbox vsftp wordpress

Recent Comments

  • Ali on How to delete mail queue in Postfix
  • Mehar on How to install Java (OpenJDK) on Ubuntu Linux
  • Ramone Burrell on How to fix read only USB pen drive in Ubuntu
  • Pera on How to fix read only USB pen drive in Ubuntu
  • Ubuntu on How to fix read only USB pen drive in Ubuntu
  • Nitin Sharma on Install and configure rsyslog Centralized logging server in CentOS 6.5
  • Sharad Chhetri on Install and configure rsyslog Centralized logging server in CentOS 6.5
  • nitin on Install and configure rsyslog Centralized logging server in CentOS 6.5

Copyright © 2009 - 2021 · All Rights Reserved sharadchhetri.com · · Privacy Policy ·
· sitemap.xml · ·The content is copyrighted to sharadchhetri.com and may not be reproduced on other websites without our permission. ·

Copyright © 2021 · Genesis Sample on Genesis Framework · WordPress · Log in