Ubuntu

如何設置nagios外掛路徑

  • June 4, 2020

當我檢查 nagios 設置時。

我遇到了這個錯誤。

$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.4.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-08-20
License: GPL

Website: https://www.nagios.org
Reading configuration data...
  Read main config file okay...
Error: check_period '24x7                                                                                                          |' for service 'check_snmp' on host 'localhost' not found!
Error: Could not register service (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 226)
  Error processing object config files!

好的,我猜是因為系統找不到check_snmp

我在check_snmp這裡找到了。

$ sudo find / -name check_snmp
/usr/lib/nagios/plugins/check_snmp

另一方面,check_http存在於這些目錄中。

sudo find / -name check_http
/usr/local/nagios/libexec/check_http
/usr/lib/nagios/plugins/check_http
/opt/nagios-plugins-2.2.1/plugins/check_http

所以,我猜Nagios外掛路徑僅設置為/usr/local/nagios/libexec/??

如果是這樣,我該如何解決這個問題???

在我看來,localhost 更有可能有一個服務定義 check_snmp ,/usr/local/nagios/etc/objects/localhost.cfg它指的是一個名為:

24x7                                                                                                          |

(有很多尾隨空格和管道字元)作為實際時間段的複制/粘貼錯字24x7

引用自:https://unix.stackexchange.com/questions/590856