歡迎您光臨本站 註冊首頁

安裝nagios 檢查配置文件nagios.cfg,出現錯誤。。

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

安裝nagios 檢查配置文件nagios.cfg,出現錯誤。。

# ./bin/nagios -v ./etc/nagios.cfg

Nagios 2.9
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 04-10-2007
License: GPL

Reading configuration data...

Error: Could not find any contact matching 'test'
Error: Could not expand member contacts specified in contactgroup (config file '/usr/local/nagios/etc/contactgroups.cfg', starting on line 1)

***> One or more problems was encountered while processing the config files...

     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.cfg,出現Could not find any contact matching 'test' ?
我檢查所有有關配置檔,沒有檢查出那地方設置有誤。。。鬱悶呀。。help..help...
《解決方案》

配置文件有點多,仔細檢查一下,肯定是那個地方的contact寫錯了。
《解決方案》

commands.cfg 配置有錯誤提示,不知為何?

執行配置檢查時,提示報警配置文件 commands.cfg 配置有錯誤。。。?那位能幫幫忙看看,到底是那出錯。。

# ../bin/nagios -v ./nagios.cfg
Nagios 2.9
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 04-10-2007
License: GPL

Reading configuration data...

Error: Invalid command object directive '$CONTACTPAGER$'.
Error: Could not add object property in file '/usr/local/nagios/etc/commands.cfg' on line 260.

具體報警配置如下:
    256 ###### host-notify-by-sms command definition
    257 define command {
    258     command_name        host-notify-by-sms
    259     command_line      /usr/local/bin/sms.pl
    260    $CONTACTPAGER$    "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$"
    261 }
    262
    263 ###### service-notify-by-sms command definition
    264 define command {
    265     command_name        service-notify-by-sms
    266     command_line        /usr/local/bin/sms.pl
    267   $CONTACTPAGER$      "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$"
    268 }
《解決方案》

# '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: $HOSTA
DDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $
NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
        }

# '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$\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$
        }


這個是我的 可以參考下,你的和我的完全不同,呵呵 你的是用腳本來實現的,你要看下腳本名後面提供的參數了,我用的是nagios3.0.5的

[ 本帖最後由 wiliiwin 於 2009-9-11 17:30 編輯 ]
《解決方案》

是我command.cfg的變數,搞錯了。。。呵呵。。。多謝幫忙。。呵呵
《解決方案》

config file '/usr/local/nagios/etc/contactgroups.cfg', starting on line 1
已經提示了
《解決方案》

回復 #1 zhmysh 的帖子

/usr/local/nagios/etc/contactgroups.cfg 這個文件的聯繫人信息是錯誤的呀

[火星人 ] 安裝nagios 檢查配置文件nagios.cfg,出現錯誤。。已經有650次圍觀

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