我通过Debian软件包安装了Nagios和Nagvis,但是当我运行Nagvis并尝试进入“常规configuration”菜单时,出现此错误
Error: (0) Array to string conversion (/usr/share/nagvis/share/server/core/classes/WuiViewEditMainCfg.php:126) #0 /usr/share/nagvis/share/server/core/classes/WuiViewEditMainCfg.php(126): nagvisExceptionErrorHandler(8, 'Array to string...', '/usr/share/nagv...', 126, Array) #1 /usr/share/nagvis/share/server/core/classes/WuiViewEditMainCfg.php(44): WuiViewEditMainCfg->getFields() #2 /usr/share/nagvis/share/server/core/classes/CoreModMainCfg.php(56): WuiViewEditMainCfg->parse() #3 /usr/share/nagvis/share/server/core/functions/index.php(120): CoreModMainCfg->handleAction() #4 /usr/share/nagvis/share/server/core/ajax_handler.php(63): require('/usr/share/nagv...') #5 {main}
在Nagvis我也遇到后端问题。 check-mk-livestatus被安装,但是当鼠标hover在项目上时出现这个错误:
Problem (backend: live_1): Unable to connect to the /var/lib/nagios3/rw/live in backend live_1: Connection refused
或者当试图添加东西时:
Unable to fetch data from backend - falling back to input field.
/ var / lib / nagios3 / rw /存在,但没有“活”文件。 我真的不知道发生了什么,特别是因为这些都是Debian软件包…这是nagvis.ini.php最相关的部分:
; ---------------------------- ; Backend definitions ; ---------------------------- ; Example definition of a livestatus backend. ; In this case the backend_id is live_1 ; The path /usr/local/nagios/var/rw has to exist [backend_live_1] backendtype="mklivestatus" ; The status host can be used to prevent annoying timeouts when a backend is not ; reachable. This is only useful in multi backend setups. ; ; It works as follows: The assumption is that there is a "local" backend which ; monitors the host of the "remote" backend. When the remote backend host is ; reported as UP the backend is queried as normal. ; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't ; try to connect to the backend anymore until the backend host gets available again. ; ; The statushost needs to be given in the following format: ; "<backend_id>:<hostname>" -> eg "live_2:nagios" ;statushost="" socket="unix:/var/lib/nagios3/rw/live"
在/var/log/nagios3/nagios.log中没有与“后端”或“mklivestatus”有关的任何帮助,我们将非常感激
Nagvis的问题是一个已知的bug ,显然已经被固定在上游。
rw目录中的套接字问题可能是/usr/share/doc/nagios3/README.Debian中详细logging的权限问题。
我知道这也许有点晚,我也有同样的问题。 修复它像这样:
cd ~/source wget wget http://mathias-kettner.com/download/mk-livestatus-1.2.4p2.tar.gz tar zxvf mk-livestatus-1.2.4p2.tar.gz cd mk-livestatus-1.2.4p2/ ./configure --with-nagios4 (Or nagios3) make install vi /usr/local/nagios/etc/nagios.cfg
加:
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /usr/local/nagios/var/rw/live event_broker_options=-1
下:
#broker_module=/somewhere/module1.o #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0 chown -R nagios:nagcmd /usr/local/nagios/var/rw service nagios restart