Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
lout_tie
Posts: 14 Joined: Wed Jan 18, 2017 5:28 am
Post
by lout_tie » Thu Feb 23, 2017 3:59 am
ok I changed something without reinstall. But something seems really odd.
After I fixed something in nagios.cfg
preflight looks clean now.
Code: Select all
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/nagios3/objects'...
Processing object config directory '/etc/nagios3/objects/templates'...
Processing object config file '/etc/nagios3/objects/templates/generic-host.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-host-linux.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-service.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-contact.cfg'...
Processing object config directory '/etc/nagios3/objects/commands'...
Processing object config file '/etc/nagios3/objects/commands/check_http.cfg'...
Processing object config file '/etc/nagios3/objects/commands/commands.cfg'...
Processing object config directory '/etc/nagios3/objects/services'...
Processing object config file '/etc/nagios3/objects/services/services.cfg'...
Processing object config directory '/etc/nagios3/objects/hosts'...
Processing object config file '/etc/nagios3/objects/hosts/host_pi.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/localhost.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/host_test.cfg'...
Processing object config file '/etc/nagios3/objects/contacts.cfg'...
Processing object config file '/etc/nagios3/objects/timeperiods.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 3 services.
Checking hosts...
Checked 3 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 5 commands.
Checking time periods...
Checked 4 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
But on nagios web surface I cannot see any changes... I attached a picture.
Attachments
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Feb 23, 2017 4:27 pm
The following 2 lines in your nagios.cfg file says to only look in those 2 folders for any configuration files. If found in those folders, it should load them.
Code: Select all
cfg_dir=/etc/nagios3/objects/commands
cfg_dir=/etc/nagios3/objects
You said that you changes something but the Web interface didn't show it.
What were the changes that you did and what are you trying to get running in the system?
Also, can you run the following command as root on the Nagios server and post the output?
Be sure to check out our
Knowledgebase for helpful articles and solutions!
lout_tie
Posts: 14 Joined: Wed Jan 18, 2017 5:28 am
Post
by lout_tie » Fri Feb 24, 2017 2:39 am
I add 2 more hosts besides of localhost and I commented out other plugins and services besides of check_http.
So SSh shouldnt be showing right and also it should show me at least the other hosts.
But it didnt.
Output of ls -lR /etc/nagios3/
Code: Select all
-rw-r--r-- 1 root root 2109 Okt 5 2014 apache2.conf
-rwxrwxr-- 1 root root 12472 Jan 31 09:06 cgi.cfg
-rw-r--r-- 1 root root 2443 Mär 15 2016 commands.cfg
drwxr-xr-x 3 root root 4096 Jan 31 10:05 conf.d
-rw-r--r-- 1 root root 50 Jan 23 15:07 htpasswd.users
-rw-r--r-- 1 root root 44746 Feb 23 10:00 nagios.cfg
drwxrwxrwx 6 root root 4096 Feb 23 09:40 objects
-rw-r--r-- 1 root nagios 1293 Jul 29 2011 resource.cfg
drwxr-xr-x 2 root root 4096 Jan 4 12:01 stylesheets
/etc/nagios3/conf.d:
insgesamt 8
-rw-r--r-- 1 root root 410 Jan 31 09:58 extinfo.cfg
drwxr-xr-x 2 root root 4096 Feb 1 09:56 ORIG
/etc/nagios3/conf.d/ORIG:
insgesamt 0
/etc/nagios3/objects:
insgesamt 24
drwxrwxrwx 2 root root 4096 Feb 23 10:40 commands
-rwxrwxrwx 1 root root 855 Feb 23 09:40 contacts.cfg
drwxrwxrwx 2 root root 4096 Feb 23 09:01 hosts
drwxrwxrwx 2 root root 4096 Feb 23 10:41 services
drwxrwxrwx 2 root root 4096 Feb 23 09:44 templates
-rwxrwxrwx 1 root root 1609 Jan 31 10:00 timeperiods.cfg
/etc/nagios3/objects/commands:
insgesamt 12
-rw-rw-r-- 1 gunf gunf 191 Feb 16 14:03 check_host_alive.cfg.ex
-rw-rw-r-- 1 gunf gunf 202 Feb 23 09:47 check_http.cfg
-rw-r--r-- 1 fung fung 2443 Feb 23 10:02 commands.cfg
/etc/nagios3/objects/hosts:
insgesamt 12
-rwxrwxrwx 1 root root 103 Feb 16 09:34 host_pi.cfg
-rwxrwxrwx 1 root root 105 Feb 16 09:33 host_test.cfg
-rwxrwxrwx 1 root root 1932 Feb 23 08:37 localhost.cfg
/etc/nagios3/objects/services:
insgesamt 4
-rwxrwxrwx 1 root root 712 Feb 23 09:08 services.cfg
/etc/nagios3/objects/templates:
insgesamt 16
-rw-rw-r-- 1 gunf gunf 2481 Feb 23 09:43 generic-contact.cfg
-rw-rw-r-- 1 gunf gunf 1300 Feb 16 09:31 generic-host.cfg
-rw-rw-r-- 1 gunf gunf 1455 Feb 23 09:04 generic-host-linux.cfg
-rw-rw-r-- 1 gunf gunf 2761 Feb 16 13:38 generic-service.cfg
/etc/nagios3/stylesheets:
insgesamt 92
-rw-r--r-- 1 root root 1913 Mär 15 2016 avail.css
-rw-r--r-- 1 root root 1261 Mär 15 2016 checksanity.css
-rw-r--r-- 1 root root 959 Mär 15 2016 cmd.css
-rw-r--r-- 1 root root 9562 Mär 15 2016 common.css
-rw-r--r-- 1 root root 586 Mär 15 2016 config.css
-rw-r--r-- 1 root root 5626 Mär 15 2016 extinfo.css
-rw-r--r-- 1 root root 560 Mär 15 2016 histogram.css
-rw-r--r-- 1 root root 482 Mär 15 2016 history.css
-rw-r--r-- 1 root root 4422 Mär 15 2016 ministatus.css
-rw-r--r-- 1 root root 2081 Mär 15 2016 notifications.css
-rw-r--r-- 1 root root 743 Mär 15 2016 outages.css
-rw-r--r-- 1 root root 482 Mär 15 2016 showlog.css
-rw-r--r-- 1 root root 7283 Mär 15 2016 status.css
-rw-r--r-- 1 root root 710 Mär 15 2016 statusmap.css
-rw-r--r-- 1 root root 1748 Mär 15 2016 summary.css
-rw-r--r-- 1 root root 5472 Mär 15 2016 tac.css
-rw-r--r-- 1 root root 481 Mär 15 2016 trends.css
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Fri Feb 24, 2017 1:03 pm
After you edited the config files and added the 2 new hosts, did you restart the nagios daemon?
If not, the nagios daemon will not load the changes that were made.
Can you run the following commands and post the output? This will show which files are getting loaded and which file the SSH service is defined..
Code: Select all
nagios3 -vv /etc/nagios3/nagios.cfg
grep -R SSH /etc/nagios3/objects/*
Also, post the fines from the /etc/nagios3/objects/hosts and /etc/nagios3/objects/services files so we can view them.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
lout_tie
Posts: 14 Joined: Wed Jan 18, 2017 5:28 am
Post
by lout_tie » Thu Mar 02, 2017 3:56 am
Hello
I did recheck the configuration . I add hostgroup to generic-host template.. Bad idea. So I deleted that and make an extra file for hostgroup. In that file I added the 3 host.
$ nagios3 -vv /etc/nagios3/nagios.cfg
Code: Select all
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/nagios3/objects'...
Processing object config directory '/etc/nagios3/objects/templates'...
Processing object config file '/etc/nagios3/objects/templates/generic-host.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-host-linux.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-service.cfg'...
Processing object config file '/etc/nagios3/objects/templates/generic-contact.cfg'...
Processing object config directory '/etc/nagios3/objects/commands'...
Processing object config file '/etc/nagios3/objects/commands/check_http.cfg'...
Processing object config file '/etc/nagios3/objects/commands/commands.cfg'...
Processing object config directory '/etc/nagios3/objects/hostgroup'...
Processing object config file '/etc/nagios3/objects/hostgroup/hostgroup.cfg'...
Processing object config directory '/etc/nagios3/objects/services'...
Processing object config file '/etc/nagios3/objects/services/services.cfg'...
Processing object config directory '/etc/nagios3/objects/hosts'...
Processing object config file '/etc/nagios3/objects/hosts/host_pi.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/localhost.cfg'...
Processing object config file '/etc/nagios3/objects/hosts/host_test.cfg'...
Processing object config file '/etc/nagios3/objects/contacts.cfg'...
Processing object config file '/etc/nagios3/objects/timeperiods.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 3 services.
Checking hosts...
Checked 3 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 5 commands.
Checking time periods...
Checked 4 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
now the hosts i changed some of the names because of privat reason.
Code: Select all
define host {
use linuxhost
host_name raspberrypi
alias rasperry_pi
address 192.168.1.22
}
define host{
use linuxhost
host_name pywork
alias pywork
address 192.168.1.23
}
define host{
use linuxhost ; Name of host template to use
host_name localhost
alias localhost
address 127.0.0.1
contact_groups test_admins
}
Service in objects. I set all of them in comments besides of check_http.. but it seems there are 3 services. I restart nagios after all changes and I even used init.d stop and then start again.
Code: Select all
# check that web services are running
define service {
use generic-service
hostgroup_name testmachine
service_description HTTP
check_command check_http
notification_interval 0 ; set > 0 if you want to be renotified
contact_groups test_admins
}
# check that ssh services are running
#define service {
# hostgroup_name ssh-servers
# service_description SSH
# check_command check_ssh
# use generic-service
# notification_interval 0 ; set > 0 if you want to be renotified
#}
Code: Select all
define hostgroup{
hostgroup_name testmachine
alias test
members raspberrypi, pywork, localhost
}
grep -R SSH /etc/nagios3/objects/*
Code: Select all
/etc/nagios3/objects/services/services.cfg:# service_description SSH
As you can see I commented out
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Mar 02, 2017 3:10 pm
From the information you have posted, it does look like the SSH service should not be in the GUI anymore.
Try rebooting the system and see if the changes take effect and the SSH service is gone.
Other than that, are you looking at 2 different Nagios systems by mistake?
Be sure to check out our
Knowledgebase for helpful articles and solutions!