1、安装时检查文件配置的正确性:#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
如出现以下错误:
Error: Service notification command ‘notify-by-email’ specified for contact ‘sery’ is not defined anywhere!
Error: Host notification command ‘host-notify-by-email’ specified for contact ‘sery’ is not defined anywhere!
请在commands.cfg中加入如下内容:
# ‘notify-host-by-email’ command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
}
# ’service_notification_commands’ command definition
define command{
command_name service-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$” | /bin/mail -s “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}
2、如果提示“You don't have permission to access /nagios on this server”
有可能是没有配置好php
#yum install -y php
3、The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.52 (CentOS) Server at mail1.chinabank.com.cn Port 80
可能是apache打开了suexec功能,将其关闭:#setenforce 0
4、如果提示“Whoops! Error: Could not read host and service status information”,有可能是权限问题,
解决办法是,将整个nagios目录权限分配给nagios用户:
#chown -R nagios:nagcmd nagios/
5、如果提示“Whoops! Error: Could not read object configuration data! ”,这是因为没有启动nagios后台进程,执行以下命令
#/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
--------------------------------------------------------------------------------------------
版权所有,转载请注明作者及原文链接,否则追究法律责任!
QQ: 584307876
作者: Seven
原文链接: http://blog.csdn.net/sunjiapeng/article/details/8315356
邮箱:
[email protected]