nagios監控故障排除

一、安裝完nagios及nagios-plugins時,卡在這了,forbidden 禁止訪問
php

apache日誌顯示以下ios

Directory index forbidden by Options directive: /usr/local/nagios/share/web

一、apache的配置問題默認頁面是不是index.php,還有是否支持php模塊(ll /etc/httpd/conf.d/php.confapache

二、相應目錄的權限問題 是否可讀app

三、是否正確配置的帳戶驗證,ide

以下示例:ui

配置http驗證 【配置驗證時注意驗證用戶的名字,建議爲nagiosadmin,否則就記得修改cgi.cfg及contact.cfg保持帳號的一致,否則就會遇到下面的錯誤5.】this

兩種方式spa

第一種方式,在安裝nagios的時候,直接makeinstall –webconf日誌

這個會在/etc/httpd/conf.d/生成一個nagios.conf文件

htpasswd-c /etc/nagios/htpasswd.users  nagiosadmin

第二種方式

直接自行配置nagioshttp驗證,可直接在主配置文件nagios.conf中添加以下

ScriptAlias/nagios/cgi-bin /usr/local/nagios/sbin

<Directory "/usr/local/nagios/sbin">

Options ExecCGI

AllowOverride None

Order allow,deny

Allow from all

AuthName "Nagios Access"

AuthType Basic

AuthUserFile/etc/nagios/htpasswd

//用於此目錄訪問身份驗證的文件

Require valid-user

</Directory>


Alias /nagios/usr/local/nagios/share

<Directory"/usr/local/nagios/share">

Options None

AllowOverride None

Order allow,deny

Allow from all

AuthName "Nagios Access"

AuthType Basic

AuthUserFile/etc/nagios/htpasswd

#//用於此目錄訪問身份驗證的文件

Require valid-user

</Directory>

htpasswd-c /etc/nagios/htpasswdnagios

二、The requested URL/nagios/cgi-bin/statusmap.cgi was not found on this server.

沒有map圖形,

yuminstall gd-devel -y

從新編譯,

如果源碼安裝gd-devel,須要手動來指明gd-lib的存放,經過yum安裝的不須要,能夠自動加載到

./configure --with-gd-lib=/usr/lib  --with-gd-inc=/usr/include

make install; makeinstall-init; make install-config; make install-commandmode; make install-webconf

重啓nagios服務


3、錯誤:

Error: Service check command'check_nrpe' specified in service 'check_total_procs' for host '192.168.15.183'not defined anywhere!

沒有定義nagios的命令模板

編輯commands.cfg 添加便可

例:define command {
       command_name  check_nrpe
       command_line     $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


4、安裝nrpe,編譯的時候提示如下信息checkingfor SSL headers... configure: error: Cannot find ssl headers緣由是缺乏openssl-devel包,yum -yinstall openssl-devel 問題解決!


5It appears as thoughyou do not have permission to view information for any of the hosts yourequested...

If you believe this is an error, check the HTTP serverauthentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

解決:

第一種:

配置cgi.cfg

78 use_authentication=1默認值爲1,改成0,即取消帳號驗證

第二種:一樣也是配置cgi.cfg中的參數,

在末行模式下執行 %s/nagiosadmin/username/g

username是你在htpasswd生成的自定義驗證用戶


開啓認證認證的用戶必須是 cgi.cfg 配置文件裏有的默認是 nagiosadmin
  若是你新建的其餘用戶須要添加進去多用戶用逗號分開
   authorized_for_system_information=nagiosadmin
   authorized_for_configuration_information=nagiosadmin
   authorized_for_system_commands=nagiosadmin
   authorized_for_all_services=nagiosadmin
   authorized_for_all_hosts=nagiosadmin
   authorized_for_all_service_commands=nagiosadmin
   authorized_for_all_host_commands=nagiosadmin
  若是不是 nagiosadmin 須要到後面添加
  例子 authorized_for_system_information=nagiosadmin,username


願積極跟貼,共建nagios故障解決手冊。。。。

相關文章
相關標籤/搜索