Page 1 of 2

Local Host Down

Posted: Tue Nov 01, 2011 4:47 am
by praz
Hi all,

I'm a newbie with nagios and I must say 'great thanks to the development team.
I have the version 3.0.5 installed and I'm constantly getting this message every two hours:

Notification Type: PROBLEM
Host: localhost
State: DOWN
Address: 127.0.0.1
Info: (Host Check Timed Out)

I'm pretty sure there's a work-around this but I can't find a solution to this. Would anyone be kind enough to please help me fix this.

Thanks...

Re: Local Host Down

Posted: Tue Nov 01, 2011 1:15 pm
by mguthrie
What's the check_command defined for localhost?

Re: Local Host Down

Posted: Wed Nov 02, 2011 4:14 am
by praz
Thanks for your reply Mguthrie and apologies for the late reply. On the hosts.cfg section I don't have local hosts defined anywhere like I have other network devices. This is the same for the services.cfg. Could this be the reason? do i need to create an entry for the local host of the nagios server itself (127.0.0.1). Please find below my typical entry for the hosts.cfg and services.cfg below:

nano hosts.cfg:

define host{
use generic-host ; Name of host template to use
host_name ast1
alias ast1
address 10.0.4.202
check_command check-host-alive
max_check_attempts 1
notification_interval 1
notification_period 24x7
notification_options d,u,r
contact_groups sysadmins
}


nano services.cfg

define service{
use generic-service ; Name of service te$
host_name ast1
service_description process_asterisk
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups sysadmins
notification_interval 120
notification_options u,c,r
check_command check_remote_procs_name!1,1!1,1!asterisk
}

Thanks and I look forward to ur reply...

Re: Local Host Down

Posted: Wed Nov 02, 2011 5:40 am
by praz
Hey Mguthrie, thanks for that question 'What's the check_command defined for localhost?'... I added the local host as a host with the ip address 127.0.0.1 and it's 2 hours later and I haven't received the message 'local host down'... I think it's sorted now... If there's anyone with this issue, just add an entry to your hosts.cfg for your localhost with the ip address 127.0.0.1 and that should solve the issue... 8-)

Thanks all...

Re: Local Host Down

Posted: Wed Nov 02, 2011 5:44 am
by praz
spoke too soon... the message just popped up again after the delay. Still having the same issue. Need help please... :?

Re: Local Host Down

Posted: Wed Nov 02, 2011 5:03 pm
by jsmurphy
In the config you have provided the hosts IP address is "10.0.4.202" I thought the device you were having problems with was localhost?

Re: Local Host Down

Posted: Thu Nov 03, 2011 11:20 am
by praz
Hi Jsmurphy, that was an example of my config for other hosts. This is the entry I created for the Local-hosts yesterday and this didn't solve the problem as I'm still getting the Local_host down message:

define host{
use generic-host
host_name Local_host
alias Local_host
address 127.0.0.1
check_command check-host-alive
max_check_attempts 1
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups sysadmins
}
Thanks and I look forward to your reply.

Re: Local Host Down

Posted: Thu Nov 03, 2011 5:21 pm
by jsmurphy
Can you check your commands.cfg for the check-host-alive definition and see if it's -H $HOSTNAME$ or -H $HOSTADDRESS$? you have Local_host as the defined host_name... which won't be resolvable unless you have manually added it to your /etc/hosts.cfg. So you can either change Local_host to localhost or change $HOSTNAME$ to $HOSTADDRESS$ in your command definition.

At this stage I can't see any other reason why this would not be resolvable.

Re: Local Host Down

Posted: Fri Nov 04, 2011 4:35 am
by praz
Hi Jsmurphy, thanks for the tip. The check-host-alive is defined with the -H $HostADDRESS$ as shown below:

# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 500$
}
However, to leave no stone untouched, I've changed the 'Local_Host' to 'localhost' and hopefully that should sort it. The only service I'm checking on the localhost is the ping service
(check_command check_ping!300.0,20%!500.0,60%)
Do I need to define a different service for the localhost? Anyway, I'll let you know if I don't get the same mail 2 hours from the last...

Re: Local Host Down

Posted: Fri Nov 04, 2011 12:05 pm
by praz
Still having the issue... i'll try and sort it out... hopefully i'll find a solution