当前位置: 首页 > 工具软件 > NagVis > 使用案例 >

安装Nagvis

袁赞
2023-12-01
安装Nagvis



# tar zxvf nagvis-1.8.4.tar.gz
# cd nagvis-1.8.4


# sh install.sh
+——————————————————————————+
| Welcome to NagVis Installer 0.2.16                                           |
+——————————————————————————+
| This script is built to facilitate the NagVis installation and update        |
| procedure for you. The installer has been tested on the following systems:   |
| – Debian Etch, Hardy (4.0, 5.0)                                              |
| – Ubuntu Hardy, Intrepid, Jaunty, Karmic, Lucid (8.04 to 10.04)              |
| – SuSE Linux Enterprise Server 10 and 11                                     |
|                                                                              |
| Similar distributions to the ones mentioned above should work as well.       |
| That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE                   |
|                                                                              |
| If you experience any problems using these or other distributions, please    |
| report that to the NagVis team.                                              |
+——————————————————————————+
| Do you want to proceed? [y]: 直接回车
+——————————————————————————+
| Starting installation of NagVis 1.5.1                                        |
+——————————————————————————+
| OS  : CentOS release 5.5 (Final)                                             |
| Perl: 5.008008                                                               |
|                                                                              |
+— Checking for tools ——————————————————-+
| Using packet manager /bin/rpm                                          found |
|                                                                              |
+— Checking paths ———————————————————–+
| Please enter the path to the nagios base directory [/usr/local/nagios]: 直接回车
|   nagios path /usr/local/nagios                                        found |
| Please enter the path to NagVis base [/usr/local/nagvis]: 直接回车
|                                                                              |
+— Checking prerequisites —————————————————+
| Nagios 3.1.2                                                           found |
| PHP 5.2                                                                found |
|   PHP Module: gd compiled_in                                           found |
|   PHP Module: mbstring compiled_in                                     found |
|   PHP Module: gettext compiled_in                                      found |
|   PHP Module: session compiled_in                                      found |
|   PHP Module: xml php                                                  found |
|   Apache mod_php                                                       found |
| Checking Backends. (Available: mklivestatus,ndo2db,ido2db,merlinmy)          |
| Do you want to use backend mklivestatus? [y]:n
| Do you want to use backend ndo2db? [n]: y                       //用ndo2db数据库方式
| Do you want to use backend ido2db? [n]: 直接回车
| Do you want to use backend merlinmy? [n]: 直接回车
|   /usr/local/nagios/bin/ndo2db-3x (ndo2db)                             found |
|   PHP Module: mysql php                                                found |
| Graphviz 2.26                                                          found |
|   Graphviz Module dot 2.26.3                                           found |
|   Graphviz Module neato 2.26.3                                         found |
|   Graphviz Module twopi 2.26.3                                         found |
|   Graphviz Module circo 2.26.3                                         found |
|   Graphviz Module fdp 2.26.3                                           found |
|                                                                              |
+— Trying to detect Apache settings —————————————–+
| Please enter the web path to NagVis [/nagvis]: /nagios/nagvis
| Please enter the name of the web-server user [apache]: 直接回车         //web用户,在httpd.conf中User后面的用户
| Please enter the name of the web-server group [apache]: 直接回车    //web用户组,在httpd.conf中Group后面的用户
| create Apache config file [y]:  直接回车                               //是否创建Apache的配置文件来支持nagvis
|                                                                              |
+— Checking for existing NagVis ———————————————+
| NagVis 1.5.1                                                           found |
| Do you want the installer to update your config files when possible? [y]: 直接回车
|                                                                              |


+— Checking for existing NagVis ———————————————+
|                                                                              |
+——————————————————————————+
| Summary                                                                      |
+——————————————————————————+
| NagVis home will be:           /usr/local/nagios/share/nagvis                |
| Owner of NagVis files will be: apache                                        |
| Group of NagVis files will be: apache                                        |
| Path to Apache config dir is:  /etc/httpd/conf.d                             |
| Apache config will be created: YES                                            |
|                                                                              |
| Installation mode:             install                                       |
|                                                                              |
| Do you really want to continue? [y]: 直接回车
+——————————————————————————+
| Starting installation                                                        |
+——————————————————————————+
| Creating directory /usr/local/nagios/share/nagvis…                   done  |
| Creating directory /usr/local/nagios/share/nagvis/var…               done  |
| Creating directory /usr/local/nagios/share/nagvis/var/tmpl/cache…    done  |
| Creating directory /usr/local/nagios/share/nagvis/var/tmpl/compile…   done  |
| Creating directory /usr/local/nagios/share/nagvis/share/var…         done  |
| Copying files to /usr/local/nagios/share/nagvis…                     done  |
| *** /usr/local/nagios/share/nagvis/etc/nagvis.ini.php will NOT be overwritte |
| *** creating /usr/local/nagios/share/nagvis/etc/nagvis.ini.php.inst instead  |
| Creating main configuration file…                                    done  |
| adding sesscookie=/nagios/nagvis                                       done  |
| adding base=”/usr/local/nagios/share/nagvis”                           done  |
| adding htmlbase=”/nagios/nagvis”                                       done  |
| setting backend to ndomy_1                                             done  |
| *** creation of /etc/httpd/conf.d/nagvis.conf will be SKIPPED !              |
|                                                                              |
+— Setting permissions… —————————————————+
| /usr/local/nagios/share/nagvis/etc/nagvis.ini.php-sample               done  |
| /usr/local/nagios/share/nagvis/etc                                     done  |
| /usr/local/nagios/share/nagvis/etc/maps                                done  |
| /usr/local/nagios/share/nagvis/etc/maps/*                              done  |
| /usr/local/nagios/share/nagvis/etc/automaps                            done  |
| /usr/local/nagios/share/nagvis/etc/automaps/*                          done  |
| /usr/local/nagios/share/nagvis/share/userfiles/images/maps             done  |
| /usr/local/nagios/share/nagvis/share/userfiles/images/maps/*           done  |
| /usr/local/nagios/share/nagvis/share/userfiles/images/shapes           done  |
| /usr/local/nagios/share/nagvis/share/userfiles/images/shapes/*         done  |
| /usr/local/nagios/share/nagvis/var                                     done  |




重启apache
service httpd restart






登录
URL:http:///nagvis




需要修改文件  nagvis.conf
[root@nagios ~]# cd /etc/httpd/conf.d/
[root@nagios conf.d]# ll
total 40
-rw-r--r-- 1 root   root     239 Jun  2 18:51 centreon.conf
-rw-r--r-- 1 root   root     239 Jun  2 18:51 centreon.conf-bak
-rw-r--r-- 1 root   mailman  641 Nov 21  2012 mailman.conf
-rw-r--r-- 1 root   root     982 Jun  2 19:07 nagios.conf
-rw-r--r-- 1 apache apache  2438 Jun  3 16:35 nagvis.conf
-rw-r--r-- 1 apache apache  2612 Jun  3 16:12 nagvis.conf.2015-06-03_16:11:50
-rw-r--r-- 1 root   root    1796 Apr 22  2005 perl.conf
-rw-r--r-- 1 root   root     674 Feb 22  2013 php.conf
-rw-r--r-- 1 root   root     392 Feb 22  2013 README
-rw-r--r-- 1 root   root     299 Dec  5  2012 welcome.conf




[root@nagios conf.d]# vi nagvis.conf
# NagVis Apache2 sample configuration file
#
# #############################################################################


Alias /nagvis "/usr/local/nagvis/share"



  Options FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all


  # To enable Nagios basic auth on NagVis use the following options
  # Just uncomment it. Maybe you need to adjust the path to the
  # Auth user file.
  #
  # If you use the NagVis internal auth mechanism based on the web
  # for you won't need this.
  #
  #AuthName "NagVis Access"
  #AuthType Basic
  #AuthUserFile /usr/local/nagios/etc/htpasswd.users
  #Require valid-user


  # With installed and enabled mod_rewrite there are several redirections
  # available to fix deprecated and/or wrong urls. None of those rules is
  # mandatory to get NagVis working.
 
    RewriteEngine On
    RewriteBase /usr/local/nagvis/www


    # Use mod_rewrite for old url redirection even if there are php files which
    # redirect the queries itselfs. In some cases the mod_rewrite redirect
    # is better than the php redirect.
    #
    # Using the php redirect seems to be better in some cases where https/http servers
    # are mixed. For example in OMD setups where using apache own mode and https in the
    # frontend and http in the backend apache servers.
    #
    # Disabling this redirect by default in the hope that the php direct works better.
    #RewriteCond %{REQUEST_URI} ^/usr/local/nagvis/www(/config\.php|/index\.php|/|)(\?.*|)$
    #RewriteRule ^(.*)$ /usr/local/nagvis/www/frontend/nagvis-js/%1%2 [R=301,L]


    # Redirect old regular map links
    RewriteCond %{REQUEST_URI} ^/usr/local/nagvis/www/frontend/(wui|nagvis-js)
    RewriteCond %{QUERY_STRING} map=(.*)
    RewriteRule ^(.*)$ /usr/local/nagvis/www/frontend/nagvis-js/index.php?mod=Map&act=view&show=%1 [R=301,L]


    # Without map= param
    RewriteCond %{REQUEST_URI} ^/usr/local/nagvis/www/frontend(/wui)?/?(index.php)?$
    RewriteRule ^(.*)$ /usr/local/nagvis/www/frontend/nagvis-js/index.php [R=301,L]


    # Redirect old rotation calls
    RewriteCond %{REQUEST_URI} ^/usr/local/nagvis/www/frontend/nagvis-js
    RewriteCond %{QUERY_STRING} !mod
    RewriteCond %{QUERY_STRING} rotation=(.*)
    RewriteRule ^(.*)$ /usr/local/nagvis/www/frontend/nagvis-js/index.php?mod=Rotation&act=view&show=%1 [R=301,L]
 



主要是这句
Alias /nagvis "/usr/local/nagvis/share"


这样修改重启httpd后就可以直接访问了,http:///nagvis

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29500582/viewspace-1684345/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29500582/viewspace-1684345/

 类似资料: