在Ubuntu12.04 LTS上为Nagios Core 4安装vshell前端

时间:2019-08-20 17:58:25  来源:igfitidea点击:

nagios vshell是Nagios的基于php的web接口核心。

为Nagios Core 4安装vshell前端

以超级用户身份登录,安装php-apc

sudo su -

apt-get update

apt-get install php-apc

下载vshell软件包

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

解压vshell.tar.gz文件

tar -xvzf vshell.tar.gz

在运行install.php之前,先修改一下

将第13行注释, //define('APACHECONF',"/etc/httpd/conf.d");
然后取消第15行的注释 define('APACHECONF',"/etc/apache2/conf.d");

cd vshell

vi install.php

//define('APACHECONF',"/etc/httpd/conf.d"); 
//default for ubuntu/debian installs 
define('APACHECONF',"/etc/apache2/conf.d");

运行install.php进行安装

./install.php

安装的vshell配置文件

安装时创建了两个文件:

/etc/vshell这是vshell配置文件。
/etc/apache2/conf.d/vshell.conf它是vshell的apache配置文件。更改apache vshell.conf文件中的htpasswd文件,以防您的htpasswd文件路径不同。

配置参考:

root@ubuntu:~# 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
root@ubuntu:~#
root@ubuntu:~# 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>
root@ubuntu:~#

htpasswd文件路径参考:

root@ubuntu:~# 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
root@ubuntu:~#

重启apache

/etc/init.d/apache2

在浏览器中打开vshell

http://192.168.1.101/vshell