Does manually running check command update the status ?

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
yosh
Posts: 32
Joined: Tue Jan 02, 2018 11:35 pm

Does manually running check command update the status ?

Post by yosh »

Hi Everyone,

In case if I want to run a check before its (scheduled) Next Scheduled Active Check Time, I can execute the command in the command-line with required parameters. Thats all good.
Now my question is, if I execute a check from the command-line before its Next Scheduled Active Check Time with it updates the check status in Nagios system before its scheduled check time ?

Thanks.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Does manually running check command update the status ?

Post by mcapra »

yosh wrote:if I execute a check from the command-line before its Next Scheduled Active Check Time with it updates the check status in Nagios system before its scheduled check time ?
If you submit the check via the external commands file via a command like SCHEDULE_HOST_CHECK or SCHEDULE_SVC_CHECK, yes it will update the status once that check is completed.

If you simply run the check's associated plugin from the command-line, that will not necessarily update any given check's status.
Former Nagios employee
https://www.mcapra.com/
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Does manually running check command update the status ?

Post by npolovenko »

Thanks for the assist, @mcapra!
@yosh, Do you have any other questions for us so far?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
yosh
Posts: 32
Joined: Tue Jan 02, 2018 11:35 pm

Re: Does manually running check command update the status ?

Post by yosh »

Thanks @mcapra

This is what I was exactly looking for.

We are good to close the thread @npolovenko. Thanks..!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Does manually running check command update the status ?

Post by tmcdonald »

We're re-opening this at OP's request - please let us know what else we can help you with!
Former Nagios employee
yosh
Posts: 32
Joined: Tue Jan 02, 2018 11:35 pm

Re: Does manually running check command update the status ?

Post by yosh »

mcapra wrote:
yosh wrote:if I execute a check from the command-line before its Next Scheduled Active Check Time with it updates the check status in Nagios system before its scheduled check time ?
If you submit the check via the external commands file via a command like SCHEDULE_HOST_CHECK or SCHEDULE_SVC_CHECK, yes it will update the status once that check is completed.

If you simply run the check's associated plugin from the command-line, that will not necessarily update any given check's status.
I have checked the SCHEDULE_HOST_CHECK and SCHEDULE_SVC_CHECK as adviced in above response.

There we can see the below code in SCHEDULE_HOST_CHECK script.

Code: Select all

#!/bin/sh
# This is a sample shell script showing how you can submit the SCHEDULE_HOST_CHECK command
# to Nagios.  Adjust variables to fit your environment as necessary.

now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'

/bin/printf "[%lu] SCHEDULE_HOST_CHECK;host1;1110741500\n" $now > $commandfile
Could you please let me know what is represented by the number 1110741500 in the script ? As per its description it should be the new schedule time. But why we need to supply the current date $now as well ?

Thank you..!
yosh
Posts: 32
Joined: Tue Jan 02, 2018 11:35 pm

Re: Does manually running check command update the status ?

Post by yosh »

Hi Everyone,

I found the answer under the sections "Submitting Passive Service Check Results" and "Submitting Passive Host Check Results" in.

https://assets.nagios.com/downloads/nag ... hecks.html

We can close the thread now.
Thank you..!
kyang

Re: Does manually running check command update the status ?

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked