Different check-host commands

Hi,

Im having some oddities with my nagios for 3 hosts.
These are beind a firewall blocking ICMP ping commands so i couldn’t check them with standard check-host-alive command.
I can only monitor their services (imap-smtp). The problem is that i don’t want these hosts in “red” in my host detail and tactical overview window.

I used different checking host commands for these hosts (i used check_dummy 0, check_imap, etc etc) but …
nagios seems to check ALSO standard checking host command: the ping!

So my hosts are going from down to up state repeatedly.

in my checkcommands.cfg i have:

define command{
command_name xxx-mail
command_line $USER1$/check_imap -H xxx.xxx.xxx.xxx
}

and in my hosts.cfg:

Server Mail xxx-company

define host{
use generic-host
host_name mail_xxx
alias xxx alias
address xxx.xxx.xxx.xxx
parents router_cdn_xxx
check_command xxx-mail
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options n
contact_groups xxx-contacts
}

Well this configuration will give me an ok state for some secs… but after a pair of refreshes hosts go in down state… after other refreshes it goes up… then go down…

When it’s in down state i have: CRITICAL - Plugin timed out after 10 seconds

Nagios seems to “cache” old checking commands. so these hosts are checked in loop using every check command i used in the past.

Ok, i don’t think i made myself clear but i can’t explain better

Marco

(of course this is not a porn web site :slight_smile:
Edited ]

It sounds to me, that you made a change to hosts.cfg but you didn’t restart nagios, or you must first make sure nagios is dead, before starting.
Stop nagios, then do a ps -ef|grep nagios
if everything is dead, then start it up.

Perfect!

Now it works!!

In every config changes I usually do a /etc/init.d/nagios restart. But it seems the script only deletes the .pid . I didn’t check the script but now i know next i have to restart i have to check more carefully if the process is stopped.

Anyway thank you a lot for the answer: it really helped me :slight_smile: