NRDP Passive host and service definitions - check_dummy

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.
Locked
hpzaramk
Posts: 25
Joined: Wed Nov 21, 2018 12:06 am

NRDP Passive host and service definitions - check_dummy

Post by hpzaramk »

Hi,

As per the NRDP passive host and service definitions documentation based on below URL, i have followed the steps and things look ok.

https://support.nagios.com/kb/article/n ... s-762.html

I can see the "check_command" attribute is used as check_dummy on both host and service definition template for passive checks.

Is there any specific reason to use check_dummy. Because it doesnt seem to check the ping monitoring as it shows the host status in console as "OK: Agent_version was ['2.1.9'] "..

1) Does the check_dummy performs ping packet loss monitoring ? If not, Is it ok to change the check_command as "check-host-alive" so the ping packet loss can be monitored ?

2) In the service definitions for passive checks, What is the use of check_command attribute as the agent sends out the passive results without being initiated by nagios core. Will it still work if i remove the check_command from passive service definitions.

Thanks,
Ram.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: NRDP Passive host and service definitions - check_dummy

Post by eloyd »

Passive checks rely on an external process to schedule the check an send the results to Nagios. In your case, using NRDP. The check_dummy command comes in to play when freshness checking is turned on on the Nagios server.

Freshness checking says, "if I haven't received a passive result check in X seconds, then use the command specified to run a local check." So the check_dummy command can be used to indicate that no check data has been received since the freshness timer expired.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: NRDP Passive host and service definitions - check_dummy

Post by mbellerue »

Thanks for jumping in, Eric! Good info, as always.

hpzaramk, did Eric's post answer your question? Is there anything else we can help with?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
hpzaramk
Posts: 25
Joined: Wed Nov 21, 2018 12:06 am

Re: NRDP Passive host and service definitions - check_dummy

Post by hpzaramk »

Hi,

I still need some clarity on this. Here is the service definition that has "check_freshness" set to 0 which means disabled. In this scenario does the check_dummy configured in check_command get executed by any chance ? Techinically, Does it throw any syntax error if i replace check_dummy by check-host-alive on the "Check_command" attribute on the below definition..

define service {
name passive_service
use generic-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
contact_groups admins
check_command check_dummy!0
notification_interval 60
notification_period 24x7
notification_options w,u,c,r
}


Also, in the passive checks, NCPA sends the disk, CPU, memory, etc to NRDP. How does the ICMP ping monitoring occurs ? Is it ok to add multiple commands in the check_command definition. Basically i would like to add ping monitoring in addition to the passive checks for the NCPA host.

Thanks,
Ram.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: NRDP Passive host and service definitions - check_dummy

Post by eloyd »

If freshness is set to 0, the check will always be "fresh." It's only when it is "stale" that the check_command is executed.

So with freshness set to 0, the check_dummy command will never execute and the service will always show the last result it was sent, even if that result was weeks or months ago.

If you want to ping the host, then you should do that as an active ping check, not a passive check. Well, you could do a passive check that returns the results of a ping check to the Nagios host (rather than the Nagios host to the server) but that's somewhat awkward and not intuitive.

You can only have one check command. Your check command can perform multiple functions if you write your own command, though. This is a medium-to-advanced topic and I do not recommend it unless you are very comfortable with how Nagios works.

As written, you have posted a service template (see the "register 0" line). This is a template that would be on the "use" line for another service. By itself, what you have written will never be executed because Nagios does not execute service templates, only services.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
hpzaramk
Posts: 25
Joined: Wed Nov 21, 2018 12:06 am

Re: NRDP Passive host and service definitions - check_dummy

Post by hpzaramk »

Hi Eric,

Thank you so much

1) My host definition for the NCPA node uses the template "passive_host" that has the active_checks_enabled set to 0. Now i wanted to enable the ping monitoring active check. So in my ping monitoring service definition, Is it allowed to use the "generic-service" template that has the active_checks_enabled set to 1. Is it allowed to use different templates for same host for the various service definitions ? Will it create issues as the active checks for the host is already disabled from the host definition ?

define host {
use passive_host
host_name tst003
}

define service {

use local-service ; Name of service template to use
host_name tst003
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}


2) Your explanation on check_dummy is clear. If i enable the check_freshness by setting it as 1, then the check_dummy will get executed if there is no passive checks arrived within the threshold timing. My question is that its defined as "check_dummy!0", i hope it submits 0 which means OK when there is no passive check for the service. Does it required to be defined as "check_dummy!2" to submit a critical status ? And will it change that corresponding service state to critical in Nagios console ?

Thanks,
Ram.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: NRDP Passive host and service definitions - check_dummy

Post by eloyd »

Ram,

I will address your note from the bottom up:
If i enable the check_freshness by setting it as 1, then the check_dummy will get executed if there is no passive checks arrived within the threshold timing.
This is correct.
My question is that its defined as "check_dummy!0", i hope it submits 0 which means OK when there is no passive check for the service. Does it required to be defined as "check_dummy!2" to submit a critical status ?
These are also correct. The check_dummy uses the first parameter as the return code, and the second as text to display. A common use is "check_dummy!1!No passive check results received." This will make it easier to see (a WARNING) that the check result hasn't been received and is now stale.
And will it change that corresponding service state to critical in Nagios console ?
Yes, if you set check_dummy|0 it will be OK, check_dummy!1 it will be WARNING, and check_dummy!2 it will be CRITICAL. You could also use check_dummy!3 for UNKNOWN if you wanted.

1) My host definition for the NCPA node uses the template "passive_host" that has the active_checks_enabled set to 0. Now i wanted to enable the ping monitoring active check. So in my ping monitoring service definition, Is it allowed to use the "generic-service" template that has the active_checks_enabled set to 1. Is it allowed to use different templates for same host for the various service definitions ? Will it create issues as the active checks for the host is already disabled from the host definition ?
The service definition you've posted is just that - a service definition. It's not used for hosts. But, yes, you can have as many active and/or passive service checks as you'd like. But each one needs to be configured as its own service check. You cannot make more than one service check in any given "define service {...}" block.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
hpzaramk
Posts: 25
Joined: Wed Nov 21, 2018 12:06 am

Re: NRDP Passive host and service definitions - check_dummy

Post by hpzaramk »

Perfect! Thanks for your advise by clearing up the things.. Nice response for all queries. :)
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: NRDP Passive host and service definitions - check_dummy

Post by eloyd »

Glad to help.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRDP Passive host and service definitions - check_dummy

Post by scottwilkerson »

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked