我刚刚在 centos 7 环境中安装了 nagios。它运行良好,但我遇到了一个小问题。
我的所有系统都显示为在线,但这些系统上的某些服务显示为未运行,但当我查看系统时,它们正在运行。见下文。
windows.cfg 文件的代码 窗口配置文件
谢谢您的帮助。如果您还有其他需要,请告诉我。
编辑:
输出/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 50 services.
Checked 5 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 5 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@localhost ~]#
nsclient.ini
:ns客户端
看起来所有内容都未被注释。
答案1
看来,服务的配置方式不起作用。nsclient 无法找到配置的服务(按名称)。
例如,在您windows.cfg
检查 DNS 服务可用性时,以下部分无法找到名为 的服务DNS
。
#monitor DNS alert if not running
define service{
use generic-service
host_name IYS-ROA-AD01
service_description DNS
check_command check_nt!PROCSTATE!-d SHOWALL -l DNS
}
尝试更改DNS
为 dns.exe 并重新启动 nagios。
您可以尝试更改EXPLORER
为explorer.exe
。对于其他进程,您需要找出确切的服务名称(您可以使用tasklist | find -i "string"
)。
最后但并非最不重要的一点是,尝试从check_nt
基础检查转向check_nrpe
更新、更好的检查。