免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5525 | 回复: 9
打印 上一主题 下一主题

nagios报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-27 10:40 |只看该作者 |倒序浏览
运行nagios -v后,报以下错误:
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 06-25-2008
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
        Checked 1 services.
Checking hosts...
        Checked 1 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
Error: Service notification command 'notify-by-email' specified for contact 'admin' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'admin' is not defined anywhere!
        Checked 1 contacts.
Checking contact groups...
        Checked 2 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 24 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   2

***> One or more problems was encountered while running the pre-flight check...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

用户admin我基本都定义过了呀,不明白这里的报错究竟是哪里没有定义,请安装过的哥们指教。

论坛徽章:
0
2 [报告]
发表于 2009-05-27 11:08 |只看该作者
***> One or more problems was encountered while running the pre-flight check...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

它不给你说了吗?另外,改动NAGIOS,运行之前最好先检查一下是否有配置错误。具体命令我忘了。。。

论坛徽章:
0
3 [报告]
发表于 2009-05-27 11:25 |只看该作者
好象是define contactgroup 定义的问题。

论坛徽章:
0
4 [报告]
发表于 2009-06-02 13:23 |只看该作者
Error: Service notification command 'notify-by-email' specified for contact 'admin' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'admin' is not defined anywhere!

你看一下commands.cfg
# 'notify-host-by-email' command definition
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOS
TADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAI
L$
        }

# 'notify-service-by-email' command definition
define command{
        command_name    notify-service-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddres
s: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service
Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

论坛徽章:
0
5 [报告]
发表于 2009-06-03 07:41 |只看该作者
关注一下!

论坛徽章:
0
6 [报告]
发表于 2009-10-23 12:32 |只看该作者
我也遇到了这样的问题!!知道的解答下啊

论坛徽章:
0
7 [报告]
发表于 2009-10-23 15:07 |只看该作者
Error: Service notification command 'notify-by-email' specified for contact 'admin' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'admin' is not defined anywhere!

说的很清楚啊,admin这个contact没有定义啊

论坛徽章:
0
8 [报告]
发表于 2009-10-23 22:25 |只看该作者
怎么去定义呢?越高越糊涂了!

论坛徽章:
0
9 [报告]
发表于 2009-10-23 22:57 |只看该作者
4楼说的很清楚了啊
Error: Service notification command 'notify-by-email' specified for contact 'admin' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'admin' is not defined anywhere!

这个错误表示你定义了服务的通知命令——notify-by-email和主机状态的通知命令——host-notify-by-email,但是没有在配置文件中找到这两个命令

你必须按照4楼给出的格式去定义这样的两个命令,这两个命令的功能主要是做主机状态报告的
define command{
        #命令的名字
        command_name    notify-host-by-email
        #命令实际上执行的操作,这个操作就是将打印出来的信息通过管道方式传递给mail命令,然后发送给联系人
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOS
TADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAI
L$
        }

论坛徽章:
0
10 [报告]
发表于 2009-12-14 14:40 |只看该作者
你admin用户没有定义那2个发送方法,定义以下就OK了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP