溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

nagios錯(cuò)誤案例

發(fā)布時(shí)間:2020-07-23 01:18:27 來(lái)源:網(wǎng)絡(luò) 閱讀:1048 作者:mohan87821000 欄目:移動(dòng)開(kāi)發(fā)

前一段時(shí)間應(yīng)公司要求部署nagios監(jiān)控系統(tǒng),一切安裝配置就緒,在啟動(dòng)nagios的過(guò)程中遇到了問(wèn)題,仔細(xì)查看nagios的日志并沒(méi)有發(fā)現(xiàn)具體的問(wèn)題在哪里,使用/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg對(duì)nagios主配置文件的語(yǔ)法做檢查時(shí),看到如下所示的提示信息:

Website: http://www.nagios.org

Reading configuration data...

  Read main config file okay...

Processing object config file '/usr/local/nagios/etc/hosts.cfg'...

Processing object config file '/usr/local/nagios/etc/services.cfg'...

Processing object config file '/usr/local/nagios/etc/commands.cfg'...

Processing object config file '/usr/local/nagios/etc/contacts.cfg'...

Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...

Processing object config file '/usr/local/nagios/etc/templates.cfg'...

Error: Invalid host object directive '    action_url'.

Error: Could not add object property in file '/usr/local/nagios/etc/templates.cfg' on line 193.

  Error processing object config files!



經(jīng)過(guò)仔細(xì)的排除后,找到了導(dǎo)致問(wèn)題出現(xiàn)的原因,由于這個(gè)文件中追加的內(nèi)容有誤所導(dǎo)致

解決方式:

vi /usr/local/nagios/etc/templates.cfg

define host{

       name    hosts-pnp

       register        0

       action_url      /nagios/pnp/index.php?host=$HOSTNAME$

       process_perf_data       1

}

define service{

       name    services-pnp

       register        0

       action_url      /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$

       process_perf_data       1

}


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI