失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 开源监控解决方案Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(九)NagVis安装

开源监控解决方案Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(九)NagVis安装

时间:2023-04-17 15:13:58

相关推荐

开源监控解决方案Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(九)NagVis安装

NagVis是Nagios的一个插件,它在用户选择一个背景图片上显示主机和服务状态。

背景图片必须是PNG格式,但可以自己选择背景图片,可以是图、系统文档图片、机房照片,或者系统环境的示意图等。

通过Web接口,可以任意地将对象放在背景的任何位置。NagVis会根据对象的状态显示不同的图标:红色表示危急状态(CRITICAL),***表示告警状态(WARNING),

绿色表示正常状态(OK),以及一个灰色背景的问号表示未知状态(UNKNOWN)。如果设置了欢迎信息,它会由一个绿色按钮及其上面的一个角***片表示。

NagVis 使用了NDOUtils并使用PHP实现。因此,NagVis除了需要运行NDO数据库,还需要量一个支持PHP 4.2或以上的Web服务器,以及访问NDO数据库所需要的库php-mysql和支持划线的库php-gd。

1.安装NDOutils

NDOutils软件主要是用于将数据存数据库,然后又可读取出来.

参考http://s8576./9510968/1745544

2.安装NagVis

#yum install php-mysql php-xml php-mbstring

#tar -zxvf nagvis-1.3.2.tar.gz

#cp -R nagvis-1.3.2 /usr/local/nagios/share/nagvis

#cp -a /usr/local/nagios/share/nagvis/etc/nagvis.ini.php-sample /usr/local/nagios/share/nagvis/etc/nagvis.ini.php

#chown apache.apache -R /usr/local/nagios/share/nagvis

#chmod 664 /usr/local/nagios/share/nagvis/etc/nagvis.ini.php

#chmod 775 /usr/local/nagios/share/nagvis/nagvis/p_w_picpaths/maps

#chmod 664 /usr/local/nagios/share/nagvis/nagvis/p_w_picpaths/maps/*

#chmod 775 /usr/local/nagios/share/nagvis/etc/maps

#chmod 664 /usr/local/nagios/share/nagvis/etc/maps/*

#chmod 775 /usr/local/nagios/share/nagvis/var

#chmod 664 /usr/local/nagios/share/nagvis/var/*

3.安装nagvis的Automap功能

#wget -O /etc/yum.repos.d/graphviz-rhel.repo /graphviz-rhel.repo

#yum install graphviz graphviz-devel graphviz-doc graphviz-gd graphviz-graphs graphviz-guile graphviz-java graphviz-perl graphviz-python graphviz-ruby graphviz-tcl

4.配置NagVis

#vim /usr/local/nagios/share/nagvis/etc/nagvis.ini.php

打开如下配置的注释,根据实际情况配置

[paths]

; absolute physical NagVis path

base="/usr/local/nagios/share/nagvis/"

; absolute html NagVis path

htmlbase="/nagios/nagvis"

; absolute html NagVis cgi path

htmlcgi="/nagios/cgi-bin"

[backend_ndomy_1]

; type of backend - MUST be set

backendtype="ndomy"

; hostname for NDO-db

dbhost="localhost"

; portname for NDO-db

dbport=3306

; database-name for NDO-db

dbname="nagios"

; username for NDO-db

dbuser="nagios"

; password for NDO-db

dbpass="XXXX"

; prefix for tables in NDO-db

dbprefix="npc_"

; instace-name for tables in NDO-db

dbinstancename="default"

; maximum delay of the NDO Database in Seconds

maxtimewithoutupdate=180

; path to the cgi-bin of this backend

htmlcgi="/nagios/cgi-bin"

#/etc/init.d/ndo2db restart

#/etc/init.d/nagios restart

5.登录页面

http://172.18.1.113/nagios/nagvis/nagvis/index.php

6.主要配置说明

Nagvis的主配置文件为/usr/local/nagios/share/nagvis/etc/nagvis.ini.php,如果Map中没有设定单独的值,那么该字段的属性以默认配置文件的为主。默认配置如想启用,请将配置文件中该属性的‘;’去掉,重启apache服务

(1)全局变量global

[global]

#语言选择,默认英语和德语,germanandenglish

language="english"

#时间格式

dateformat="Y-m-d H:i:s"

#是否在Map中显示标题菜单,0不显示,1显示

displayheader=1

#Map页面刷新的时间

refreshtime=60

(2)默认配置

[defaults]

#后端ID,暂时未知该属性的作用

;backend="ndomy_1"

#默认图标级大小,std_medium(中等)、std_big(大)、std_small(小)

icons="std_medium"

#recognize service states in host/hostgroup objects,暂时未知该属性的作用

;recognizeservices=1

#recognize only hard states (not soft),暂时未知该属性的作用

;onlyhardstates=0

#Map默认背景色

backgroundcolor="#fff"

#标题栏模版,默认只有default模版,模版存储在/usr/local/nagios/share/nagvis/nagvis/templates/header下

headertemplate="default"

#是否显示hove-menu,暂时未找到该菜单

;hovermenu=1

; hover template

; Timeout of hover menu ajax request (seconds)

;hovertimeout=5

;hovertemplate="default"

; hover menu open delay (seconds)

;hoverdelay=0

; show childs in hover menus

;hoverchildsshow=1

; order method of childs (desc: descending, asc: ascending)

;hoverchildsorder="asc"

; sort method of childs (s: state, a: alphabetical)

;hoverchildssort="s"

; limit shown child objects to n

;hoverchildslimit="10"

; show map in lists (dropdowns, index page, ...)

;showinlists=1

; use gdlibs (if set to 0 lines will not work, all other types should work fine)

;usegdlibs=1

; target for the icon links

;urltarget="_self"

如果觉得《开源监控解决方案Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(九)NagVis安装》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。