Page 1 of 1

NRDP Checks being received, nothing happening

Posted: Fri Dec 20, 2019 12:18 am
by tfines
I've setup NRDP on my server and installed NRDS_Win on a Windows host.

I've gotten to the point where the checks and the .ok files are making it to the server in the checkresults folder. Here's one of the files:

Code: Select all

### NRDP Check ###
start_time=1576800548.0
# Time: Fri, 20 Dec 2019 00:09:08 +0000
host_name=myhost
service_description=nrpe_physical_mem
check_type=1
early_timeout=1
exited_ok=1
return_code=0
output=MEMORY OK - Pagefile usage: 205 MB (5% of 4000 MB)|'memory in use'=205MB; 'memory usage'=5%;80;95; 'memory total'=4000MB;\n
But nothing happens to them. There are now hundreds of them in the checkresults folder.

I've added these lines to my Nagios config

Code: Select all

check_external_commands=1
command_file=/usr/local/nagios/var/rw/nagios.cmd
I've read different documents on the topic, but it is not clear to me what a valid command,service and host config should look like for passive checks sent from NRDP. Or how does submit_check_result (https://github.com/NagiosEnterprises/na ... eck_result) get called?

Here are the commands.cfg, host.cfg and service.cfg I'm trying to use to get to process the above checkresults file.

Code: Select all

define command {
    command_name    nrpe_physical_mem
    command_line    $USER1$/nrpe_physical_mem $ARG1$ $ARG2$ ; I know this isn't right but don't know what to put.
}

Code: Select all

define host {
    host_name               myhost
    alias                   Test System
    check_command           check_ping!100.0,20%!500.0,60% ; what goes here?
    max_check_attempts      5
    check_interval          5
    retry_interval          1
    check_period            24x7
    notification_interval   60
    notification_period     24x7
    notifications_enabled   1
    register                1
}

define service {
  use                           generic-service
  host_name                     myhost
  service_description           Physical Memory
  is_volatile                   1
  max_check_attempts            1
  active_checks_enabled         0
  passive_checks_enabled        1
  check_freshness               0
  freshness_threshold           300
  notification_options          n
  check_command              nrpe_physical_mem   ; what goes here?
}
When I try validating the config I get: Error: No check command provided for service

submit_check_result is to be called I think. But where? How is it invoked?
https://assets.nagios.com/downloads/nag ... and_id=114


I tried again, creating the config files according to https://support.nagios.com/kb/article.php?id=762:

commands.cfg:

Code: Select all

define command {
    command_name    check_dummy
    command_line    $USER1$/check_dummy $ARG1$ $ARG2$
}
templates.cfg:

Code: Select all

define host {
    use                        generic-host
    name                        passive_host
    active_checks_enabled        0
    passive_checks_enabled        1
    flap_detection_enabled        0
    register                    0
    check_period                24x7
    max_check_attempts        1
    check_interval            5
    retry_interval            1
    check_freshness            0
    check_command            check_dummy!0
    notification_interval    60
    notification_period        24x7
    notification_options        d,u,r
}
define service {
    use                        generic-service
    name                        passive_service
    active_checks_enabled        0
    passive_checks_enabled        1
    flap_detection_enabled        0
    register                    0
    check_period                24x7
    max_check_attempts        1
    check_interval            5
    retry_interval            1
    check_freshness            0
    check_command            check_dummy!0
    notification_interval    60
    notification_period        24x7
    notification_options        w,u,c,r
}
hosts.cfg:

Code: Select all

define host {
    use            passive_host
    host_name      myhost
}
services.cfg:

Code: Select all

define service {
    use                    passive_service
    service_description    nrpe_physical_mem
    host_name              myhost
}
But on the Web Interface I only see "Service is not scheduled to be checked..." How do I make that happen?

Thank you!
Ted

Re: NRDP Checks being received, nothing happening

Posted: Fri Dec 20, 2019 12:22 pm
by scottwilkerson
What is set as your check_result_path in nagios.cfg?

Also, what are the values for

Code: Select all

accept_passive_host_checks
accept_passive_service_checks
check_result_reaper_frequency

Re: NRDP Checks being received, nothing happening

Posted: Fri Dec 20, 2019 5:41 pm
by tfines
What is set as your check_result_path in nagios.cfg?
Also, what are the values for
accept_passive_host_checks
accept_passive_service_checks
check_result_reaper_frequency

Code: Select all

/var/spool/nagios/checkresults
accept_passive_host_checks=1
accept_passive_service_checks=1
check_result_reaper_frequency is not specifically set
However, I didn't have check_result_path set to the same value as in my /usr/local/nrdp/server/config.inc.php. I fixed that (thank you), and now the behavior and error have changed.

The checkresults folder doesn't get filled up anymore. Something is processing the files and removing them, so that's progress.

My one check for the host, nrpe_physical_mem, now shows an error of "(Service check timed out after 0.00 seconds)".

When I tail -f nagios.log, I see:
[1576878128] Error: Got check result for service 'nrpe_service' on host 'myhost'. Unable to find service
[1576878128] Error: Got check result for service 'nrpe_memload' on host 'myhost'. Unable to find service
[1576878128] Error: Got check result for service 'nrpe_eventlog' on host 'myhost'. Unable to find service
[1576878128] Error: Got check result for service 'nrpe_diskspace' on host 'myhost'. Unable to find service
[1576878128] Error: Got check result for service 'nrpe_process' on host 'myhost'. Unable to find service
[1576878128] Error: Got check result for service 'nrpe_winprocess' on host 'myhost'. Unable to find service

The "good" news here is that there isn't an Error for the one service I do have defined, nrpe_physical_mem. More good news is that Nagios is aware of all the checks it is receiving. The bad news is I don't have a good services.cfg definition for the services. Here's the service definition:

Code: Select all

define service {
    use                    passive_service
    service_description    nrpe_physical_mem
    host_name              myhost
}

Code: Select all

define host {
    use            passive_host
    host_name      myhost
}
What does a good services.cfg entry look like for this passive check? I found this on stackoverflow: https://stackoverflow.com/questions/148 ... -on-nagios

But if I try to use check_null as he suggests I just get an error.

By the way, here is the check definition for nrpe_physical_mem from the Windows client sending the passive checks (it, like all of the others listed in the log above, are just the default samples that came with ndps_win):

Code: Select all

command[nrpe_physical_mem] = $PLUGIN_DIR$\check_pdm.exe --memory pagefile -w 80 -c 95

Re: NRDP Checks being received, nothing happening

Posted: Mon Dec 23, 2019 7:59 am
by scottwilkerson
Can you share what you have in the template passive_service?