nagios 安装问题解析

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

邮箱:     seven_ginna@foxmail.com

转载于:https://www.cnblogs.com/seven-dba/archive/2012/12/18/4354942.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值