Page 2 of 2

Re: Cannot see imported services

Posted: Fri Feb 05, 2016 2:14 pm
by lmiltchev
Error: Failed to expand host list 'localhost' for service 'Internet Access - Reaching google.com' (/usr/local/nagios/etc/services/_multiple_hosts.cfg:796) in the Verify applying
What do you see on line 796 in the "/usr/local/nagios/etc/services/_multiple_hosts.cfg"?

You probably didn't show us the whole file as I don't find any "localhost" or "Internet Access..." entries in the "_multiple_hosts.cfg"...

Re: Cannot see imported services

Posted: Sun Feb 07, 2016 9:35 am
by sutenag
On line 796, i have also attached the file for you

define service {
host_name localhost,_
service_description Internet Access - Reaching google.com
use xiwizard_website_http_service
check_command check_xi_service_http! -f ok -I 216.58.220.100 -u "/" -p 80!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts alejman,lmaczurad
_xiwizard websiteurl
register 1
}

Re: Cannot see imported services

Posted: Sun Feb 07, 2016 2:24 pm
by tmcdonald
Try editing the file to change this:

Code: Select all

define service {
	host_name			localhost,_
into this:

Code: Select all

define service {
	host_name			localhost
and try again.

Re: Cannot see imported services

Posted: Sun Feb 07, 2016 3:53 pm
by sutenag
i guess you mean file _multtiple_hosts under /usr/local/nagios/etc/services/?, and where is localhost,_ should i rename it to localhost_ or just locahost?
After that import the file Solaris Base 10 infrastructure?

Re: Cannot see imported services

Posted: Mon Feb 08, 2016 9:53 am
by lmiltchev
You should modify your config as tmcdonald suggested, and re-import the "_multtiple_hosts" config. You shouldn't import the "Solaris Base 10 infrastructure" as it is empty. The "_multtiple_hosts" config contains everything that you had in the original "Solaris Base 10 infrastructure" file after you ran the config import prep tool.

Code: Select all

define service {
   host_name         localhost
You may have a service added to multiple hosts, for example:

Code: Select all

define service {
	host_name			host1,host2,host3
	service_description		MyService
	...
	}
Here's an example of a service added to two hosts:

Code: Select all

define service {
	host_name			localhost,CentOS6-NRPE
	service_description		PING
	...
	}
If this config, the "PING" service is added to the "localhost" and "CentOS6-NRPE" hosts.

In your config you have:

Code: Select all

define service {
	host_name			localhost,_
	service_description		Internet Access - Reaching google.com
	...
	}
which means that the "Internet Access - Reaching google.com" service is added to two hosts - "localhost" and "_". Do you have a host named "_"? If you don't, you need to remove it from the config. I hope this makes sense.

Re: Cannot see imported services

Posted: Mon Feb 08, 2016 10:22 am
by sutenag
OK, then i think the ,_ should be there, i have hosts that have "_" in the name.

Re: Cannot see imported services

Posted: Mon Feb 08, 2016 11:35 am
by rkennedy
Do you have a specific host named "_" though? It's not looking for a wild card. If you don't have a host named exactly "_" then you will receive an error.

Try removing the ,_ and let us know the result.