New service check config is not picking up host IP

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

New service check config is not picking up host IP

Post by awilson »

Hi. I have a host that is configured with its IP address but when it is added as the host for a service check the IP does not appear to register. If I try the run check command option, the localhost address is in the host address window.

Is the answer "delete and recreate the host?" Any ideas on how this happens?

Thanks!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: New service check config is not picking up host IP

Post by npolovenko »

Hello, @awilson. Have you tried saving the service check, applying the config and seeing if the service works properly on the home page?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: New service check config is not picking up host IP

Post by awilson »

It still lists 127.0.0.1 in the host address window.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New service check config is not picking up host IP

Post by lmiltchev »

Can you show us the host and the service configs?

Go to the CCM > Hosts > <your host>, and click on the View Config actions button
Go to the CCM > Services > <your service>, and click on the View Config actions button
Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: New service check config is not picking up host IP

Post by awilson »

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date:	      2018-11-27 18:12:50
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	use				xiwizard_linuxserver_host
	address				xxx.xxx.xxx.xxx
	max_check_attempts		16
	check_interval			5
	retry_interval			2
	check_period			xi_timeperiod_24x7
	contacts			24x7,snowdev,unixdl
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	first_notification_delay	0
	notifications_enabled		1
	icon_image			aix.png
	statusmap_image			aix.png
	_xiwizard			aix
	register			1
	}	

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date:	      2018-11-27 18:15:26
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA_Silver_Virtual_NA
	service_description		/ Disk Usage
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_disk!-a '-w 20% -c 10% -p /'!!!!!!
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,snowprod,unixdl
	_xiwizard			aix
	register			1
	}	

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	service_description		CPU Stats
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_cpu_stats!-a '-w 70,40,30 -c 90,60,40'!!!!!!
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,unixdl
	_xiwizard			aix
	register			1
	}	

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	service_description		Cron Scheduler
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_services!-a 'cron'!!!!!!
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,unixdl
	_xiwizard			aix
	register			1
	}	

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	service_description		Load
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'!!!!!!
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,unixdl
	_xiwizard			aix
	register			1
	}	

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	service_description		Ping
	use				xiwizard_linuxserver_ping_service
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,unixdl
	_xiwizard			aix
	register			1
	}	

define service {
	host_name			xxx.xxx.xxx.xxx_Silver_Virtual_NA
	service_description		Swap Usage
	use				xiwizard_nrpe_service
	check_command			check_nrpe!check_swap!-a '-w 50 -c 20'!!!!!!
	max_check_attempts		16
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		480
	notification_period		xi_timeperiod_24x7
	contacts			24x7,unixdl
	_xiwizard			aix
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New service check config is not picking up host IP

Post by lmiltchev »

Are you having an issue with the "/ Disk Usage" service? According to your host config, the hostname is "xxx.xxx.xxx.xxx_Silver_Virtual_NA", however the "/ Disk Usage" service is added to "xxx.xxx.xxx.xxx_Silver_Virtual_NA_Silver_Virtual_NA". Is this a typo?
Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: New service check config is not picking up host IP

Post by awilson »

That was a typo from my attempt to obscure the server name and IP. // :oops:
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New service check config is not picking up host IP

Post by lmiltchev »

Can you PM me your profile, along with the name of the host & service in question?

Admin > System Config > System Profile > Download Profile
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New service check config is not picking up host IP

Post by lmiltchev »

I sent you a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: New service check config is not picking up host IP

Post by tgriep »

In the original profile you PM'ed to lmiltchev even though it is not the profile from the server in question, I found that there are duplicate Nagios processes running on the server and that needs to be fixed.
Run the following as root to stop the duplicates and restart Nagios.

Code: Select all

service nagios stop
killall -9 nagios
service nagios start
With as many Hosts and Services on that server, you need to increase the wait timer for when Nagios restarts.
The following link has instructions for doing that.
https://support.nagios.com/kb/article/n ... r-172.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked