Page 1 of 2

On demand host check not executing

Posted: Wed Aug 02, 2017 2:50 pm
by cg28oh
Using Nagios core 4.3.2 with cfg files from Nagios 4.1.1, the host on demand check is not getting executed when a service underneath the host has failed check. I created a new file from scratch with the same parameters, still the host check will not execute. I'm hoping that I misses some setting from 4.1.1 to 4.3.2 that will make it work correctly. The service returns an unknown status and in 4.1.1 it checks the host.

Code: Select all

define host {
host_name HOST001
alias Host 1
address XX.XX.XX.XX
check_command chk_ping
check_interval 0
retry_interval 1
max_check_attempts 2
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups admins
notification_interval 30
notification_period 24x7
notification_options d,u,r
}

define service {
host_name HOST001
service_description SERVICE1
check_command chk_status
max_check_attempts 2
check_interval 2
retry_interval 1
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
contact_groups admins
}

Re: On demand host check not executing

Posted: Thu Aug 03, 2017 1:02 pm
by cdienger
I tested the on demand checks and was seeing the proper behavior with 4.3.2. Can you provide the actual config files(host and service definitions, nagios.cfg, and command.cfg)? as well as clear description on how you're testing this?

Re: On demand host check not executing

Posted: Fri Aug 04, 2017 9:11 am
by cg28oh
I used the tutorial at http://www.itzgeek.com/how-tos/linux/ub ... 16-04.html and installed it on an Ubuntu Server 16.04 lxc container.

Re: On demand host check not executing

Posted: Fri Aug 04, 2017 2:54 pm
by cdienger
I'd really like to see the config for the host and service. If you're unable to post them here, can you PM them to me? Better yet, create a profile under Admin > System > System Profile and send that along with the name of the host and service.

Re: On demand host check not executing

Posted: Fri Aug 04, 2017 4:53 pm
by cg28oh
Files PM'd

Re: On demand host check not executing

Posted: Mon Aug 07, 2017 3:28 pm
by dwhitfield
There is no chk_status in your commands.cfg. Is that a replacement command? What command should it be?

Re: On demand host check not executing

Posted: Thu Aug 10, 2017 5:00 pm
by cg28oh
Ok, there must be something I'm missing. I complied Nagios 4.3.2 on Fedora 26 server and still have the issue. I have even removed my 4.1.1 configs and create new ones from scratch and the host on demand check isn't executing when the service check alarms. Here is the host config:

Code: Select all

define host {
  host_name             LAB2
  address               10.220.0.9
  check_command         check-host-alive
  active_checks_enabled 1
  check_interval        0
  retry_interval        1
  max_check_attempts    2
  check_period          24x7
  process_perf_data     0
  contact_groups        admins
  notifications_enabled 0
  notification_interval 30
  notification_period   24x7
  notification_options  d,r
}

define service {
  host_name             LAB2
  service_description   Uptime
  check_command         check_uptime
  max_check_attempts    2
  check_interval        2
  retry_interval        1
  check_period          24x7
  notifications_enabled 0
  notification_interval 30
  contact_groups        admins
}
Everything else is stock with exception of this added to commands.cfg

Code: Select all

define command{
        command_name    check_uptime
        command_line    $USER1$/check_snmp -C PUBLIC -H $HOSTADDRESS$ -o sysUpTime.0
        }
Image

Image

Re: On demand host check not executing

Posted: Fri Aug 11, 2017 9:09 am
by cg28oh
This is defiantly something with release 4.3.5. Release 4.2.4 works properly with the attached files.

Re: On demand host check not executing

Posted: Fri Aug 11, 2017 1:54 pm
by dwhitfield
Are you sure they aren't getting executed? Are they just not incrementing?
on-demand host checks triggered by service checks cause attempt number increments (fredericve)
- https://github.com/NagiosEnterprises/na ... /Changelog

That code is available at https://github.com/NagiosEnterprises/na ... ea93371d32

Assuming I am understanding the issue properly, you can either change it back and recompile, or just leave it as the default with a new understanding.

Re: On demand host check not executing

Posted: Fri Aug 11, 2017 2:53 pm
by cg28oh
I am positive that the host check isn't executing. Using tcpdump, I only see the snmp tries and no icmp traffic to the host. the host check is check-host-alive. Changing it back seemed to work to more what we are use to. I'd like to understand how this the change operates so I can perhaps make a config change to produce the desired result.