On demand host check not executing

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

On demand host check not executing

Post 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
}
Last edited by tmcdonald on Thu Aug 03, 2017 9:42 am, edited 1 time in total.
Reason: Please use [code][/code] tags around config output
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: On demand host check not executing

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

Re: On demand host check not executing

Post 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.
Attachments
nagios.cfg
(43.82 KiB) Downloaded 492 times
commands.cfg
(7.51 KiB) Downloaded 433 times
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: On demand host check not executing

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

Re: On demand host check not executing

Post by cg28oh »

Files PM'd
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: On demand host check not executing

Post by dwhitfield »

There is no chk_status in your commands.cfg. Is that a replacement command? What command should it be?
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

Re: On demand host check not executing

Post 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
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

Re: On demand host check not executing

Post by cg28oh »

This is defiantly something with release 4.3.5. Release 4.2.4 works properly with the attached files.
Attachments
nagi_cfg.tar.gz
(2.33 KiB) Downloaded 475 times
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: On demand host check not executing

Post 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.
cg28oh
Posts: 31
Joined: Mon Aug 18, 2014 9:38 am

Re: On demand host check not executing

Post 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.
Locked