重慶分公司,新征程啟航
為企業提供網站建設、域名注冊、服務器等服務
為企業提供網站建設、域名注冊、服務器等服務
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服務,工作正常。
另外有需要云服務器可以了解下創新互聯scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。