歡迎您光臨本站 註冊首頁

nagios報錯

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

nagios報錯

運行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我基本都定義過了呀,不明白這裡的報錯究竟是哪裡沒有定義,請安裝過的哥們指教。
《解決方案》

***> 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,運行之前最好先檢查一下是否有配置錯誤。具體命令我忘了。。。
《解決方案》

好象是define contactgroup 定義的問題。
《解決方案》

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$
《解決方案》

關注一下!
《解決方案》

我也遇到了這樣的問題!!知道的解答下啊
《解決方案》

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沒有定義啊
《解決方案》

怎麼去定義呢?越高越糊塗了!
《解決方案》

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$
        }
《解決方案》

你admin用戶沒有定義那2個發送方法,定義以下就OK了!

[火星人 ] nagios報錯已經有475次圍觀

http://coctec.com/docs/service/show-post-2961.html