Nagios 调试

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nagios 调试相关的知识,希望对你有一定的参考价值。

如下,默认情况下,我们去检查 Nagios 语法的时候,如果语法错误,只会提示语法错误而不会提示详细的错误信息,因此我们有必要修改 Nagios 的启动配置脚本,使得执行 checkconfig 的时候能够出现详细的错误信息

[[email protected] ~]# /etc/init.d/nagios checkconfig
Running configuration check... CONFIG ERROR!  Check your Nagios configuration.

配置 Nagios 启动脚本:

[[email protected] ~]# vim /etc/init.d/nagios +178
            checkconfig)
                printf "Running configuration check..."
                $NagiosBin -v $NagiosCfgFile;
[[email protected] ~]# /etc/init.d/nagios checkconfig
Running configuration check...
Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-30-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file ‘/usr/local/nagios/etc/objects/commands.cfg‘...
Processing object config file ‘/usr/local/nagios/etc/objects/contacts.cfg‘...
Processing object config file ‘/usr/local/nagios/etc/objects/timeperiods.cfg‘...
Processing object config file ‘/usr/local/nagios/etc/objects/templates.cfg‘...
Processing object config file ‘/usr/local/nagios/etc/objects/hosts.cfg‘...
Processing object config file ‘/usr/local/nagios/etc/objects/services.cfg‘...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
    Checked 9 services.
Checking hosts...
Warning: Host ‘web02‘ has no services associated with it!
    Checked 2 hosts.
Checking host groups...
    Checked 1 host groups.
Checking service groups...
    Checked 0 service groups.
Checking contacts...
    Checked 1 contacts.
Checking contact groups...
    Checked 1 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 25 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: 1
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
 OK.

 

 

 

 

    

以上是关于Nagios 调试的主要内容,如果未能解决你的问题,请参考以下文章

PHP代码-psysh调试代码片段工具

方便调试使用的代码片段

运行/调试你的PHP代码

Linux 监控

eclipse 断点调试

在 intellij 上调试评估表达式