您好,登录后才能下订单哦!
nagios工作正常,各个监控页面也可以正常显示,唯独maps无法显示,提示The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server。进到/nagios/cgi-bin/文件夹中发现果然没有statusmap.cgi。
上网查了一下,说是可能缺下面的安装包,
gd
gd-devel
libpng
libpng-devel
libjpeg
libjpeg-devel
zlib
zlib-devel
虽然不知道这些安装包到底有什么用,还是查查看到底哪个没装。
用rpm -qa | grep 命令挨个安装包查一遍,原来gd-devel没装
用yum install -y gd-devel命令安装,装好后回到nagios解压的目录执行以下命令:
#make devclean
# ./configure --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
#./configure --with-command-group=nagcmd
#make all; make install; makeinstall-init; make install-config; make install-commandmode; makeinstall-webconf
完事之后重启nagios服务,ok,maps可以正常显示了!
不过突然发现监控主机少了一台,只剩下localhost了,另外一台远程主机看不到了!
是不是重新编译nagios把旧的配置文件覆盖了呢?查看nagios.cfg配置文件,
#vi /usr/local/nagios/etc/nagios.cfg
果然远程监控主机的信息没有了,添加
cfg_file=/usr/local/nagios/etc/objects/mylinux.cfg
重启nagios服务之后居然报错了,类似于这种错误
Error: Service check command 'check_nrpe!check_load' specified in service 'CPU Load' for host 'lucas_nj' not defined anywhere!
Error: Service check command 'check_nrpe!check_users' specified in service 'Current Users' for host 'lucas_nj' not defined anywhere!
Error: Service check command 'check_nrpe!check_total_procs' specified in service 'Total Processes' for host 'lucas_nj' not defined anywhere!
Error: Service check command 'check_nrpe!check_zombie_procs' specified in service 'Zombie Processes' for host 'lucas_nj' not defined anywhere!
意思说服务没定义, 难不成commands.cfg也被覆盖了?查看commands.cfg文件
#vi /usr/local/nagios/etc/objects/commands.cfg
乖乖,果然也覆盖掉了,在commands.cfg文件重新添加
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe-H $HOSTADDRESS$ -c $ARG1$
}
重启nagios服务,工作正常。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。