centos(nginx)上的nagios核心正确启动但无法读取任何主机或服务

时间:2017-05-09 03:06:23

标签: nginx centos6 nagios

我已经查看并搜索过了。 yum update在某处更改了权限,但无法找到位置。在centos上的Nagios正确启动我可以查看页面但由于某种原因我没有看到任何主机或服务,只有403禁止在角落里。 香港专业教育学院检查了我的nagios.cfg,没有错误或警告。我已经开始使用Nagios作为守护进程了。还有其他建议吗?

total 160
drwxrwxr-x   5 root root    4096 May  7 18:14 .
drwxr-xr-x. 78 root root    4096 May  8 22:38 ..
-rw-rw-r--   1 root root   11339 Sep 23  2014 cgi.cfg
-rw-rw-r--   1 root root   11658 Aug 30  2013 cgi.cfg.rpmnew
drwxr-x---   5 root nagios  4096 Aug 30  2013 conf.d
-rw-rw-r--   1 root root   43443 Oct  2  2014 nagios.cfg
-rw-rw-r--   1 root root   44533 Aug 30  2013 nagios.cfg.rpmnew
-rw-r--r--   1 root root     960 Jul 24  2016 nrpe.cfg
-rw-r--r--   1 root root     899 Mar 31  2015 nrpe.cfg.rpmsave
-rw-r--r--   1 root root    5332 Feb 24  2015 nsca.cfg
drwxr-x---   2 root nagios  4096 May  7 17:39 objects
-rw-r-----   1 root apache    27 Aug 30  2013 passwd
drwxr-x---   2 root nagios  4096 May  7 18:14 private
-rw-r-----   1 root root    1340 Aug 30  2013 resource.cfg
-rw-r--r--   1 root root    1628 Mar 20  2013 send_nsca.cfg

检查配置:

    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 directory '/etc/nagios/conf.d'...
Processing object config directory '/etc/nagios/conf.d/servicegroups'...
Processing object config file '/etc/nagios/conf.d/servicegroups/jira-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/routers-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/ups-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/backup-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/clone-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/perforce-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/linux-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/servicegroups/web-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/hostgroups.cfg'...
Processing object config directory '/etc/nagios/conf.d/hosts'...
Processing object config file '/etc/nagios/conf.d/hosts/servers.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/test.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/diskstation.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/clone-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/wifi.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/cloud.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/perforce-servers.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/printers.cfg'...
Processing object config file '/etc/nagios/conf.d/hosts/switches.cfg'...
Processing object config file '/etc/nagios/conf.d/contacts.cfg'...
Processing object config directory '/etc/nagios/conf.d/commands'...
Processing object config file '/etc/nagios/conf.d/commands/notifications.cfg'...
Processing object config file '/etc/nagios/conf.d/commands/perfdata.cfg'...
Processing object config file '/etc/nagios/conf.d/commands/checks.cfg'...
Processing object config file '/etc/nagios/conf.d/commands/nrpe.cfg'...
Processing object config file '/etc/nagios/conf.d/templates.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 124 services.
Checking hosts...
        Checked 23 hosts.
Checking host groups...
        Checked 8 host groups.
Checking service groups...
        Checked 8 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 27 commands.
Checking time periods...
        Checked 1 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: 0
Total Errors:   0

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

最后我看到了:

what is see

提前感谢。

1 个答案:

答案 0 :(得分:0)

看起来你的权限都搞砸了!

当你安装它时......来自源头吗?如果是,您是否在--with-nagios-user=期间使用了./configure标记?

在我的一个盒子上,我有一个apache和nagios的组合作为/usr/local/nagios所有者。试试这个:

chown -R nagios:nagios /usr/local/nagios
chown -R apache:nagios /usr/local/nagios/etc
chmod +x -R /usr/local/nagios/bin /usr/local/nagios/libexec

您还需要确保在主配置文件(/usr/local/nagios/etc/nagios.cfg)中设置了nagios用户和组,如下所示:

nagios_user=nagios
nagios_group=nagios

另外,你还记得设置你的htpasswd文件吗?

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

无论如何,希望这有助于您入门!