Page 1 of 1
Does manually running check command update the status ?
Posted: Mon Feb 26, 2018 9:06 pm
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.
Re: Does manually running check command update the status ?
Posted: Tue Feb 27, 2018 3:10 pm
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.
Re: Does manually running check command update the status ?
Posted: Tue Feb 27, 2018 3:52 pm
by npolovenko
Thanks for the assist,
@mcapra!
@yosh, Do you have any other questions for us so far?
Re: Does manually running check command update the status ?
Posted: Tue Feb 27, 2018 8:47 pm
by yosh
Thanks
@mcapra
This is what I was exactly looking for.
We are good to close the thread
@npolovenko. Thanks..!
Re: Does manually running check command update the status ?
Posted: Fri Mar 02, 2018 12:53 pm
by tmcdonald
We're re-opening this at OP's request - please let us know what else we can help you with!
Re: Does manually running check command update the status ?
Posted: Sun Mar 04, 2018 6:46 pm
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..!
Re: Does manually running check command update the status ?
Posted: Sun Mar 04, 2018 9:16 pm
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..!
Re: Does manually running check command update the status ?
Posted: Mon Mar 05, 2018 2:47 pm
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!