Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anymore

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anymore

Postby Cujka » Tue Nov 06, 2018 5:30 am

Hello,
I am using Nagios Core 3.5.1 in Ubuntu Ubuntu 14.04.5 LTS.
Suddenly since yesterday, I am facing problem with force checks.

When I execute force check from web gui, its said "Your command request was successfully submitted to Nagios for processing."

I can even see it in nagios3.log "[1541498447] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;host.ext;Network bandwidth;1541498445"

but its actually not fired as process in system background...

When I run testing script:
now=`date +%s`
commandfile='/var/lib/nagios3/rw/nagios.cmd'
/usr/bin/printf "[%lu] ADD_HOST_COMMENT;host.ext;1;Comment;Comment test" > $commandfile
It works! it ads comment to host.

But when I run:
/usr/bin/printf "[%lu] SCHEDULE_HOST_CHECK;host.ext;$NOW" > $commandfile
It doesn work! I can see in log, it was fired. But command to ping host isnt executed...

Any idea?
Thanks lot for help...
Peter.
User avatar
Cujka
 
Posts: 2
Joined: Tue Nov 06, 2018 4:21 am

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Postby scottwilkerson » Tue Nov 06, 2018 4:19 pm

To be clear, are you saying the "Last Check Time" for the service isn't updating along with the check results?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12308
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Postby scottwilkerson » Tue Nov 06, 2018 4:28 pm

looking at your example script you have this
Code: Select all
now=`date +%s`
commandfile='/var/lib/nagios3/rw/nagios.cmd'
/usr/bin/printf "[%lu] ADD_HOST_COMMENT;host.ext;1;Comment;Comment test" > $commandfile


and the command in your second line is calling $NOW which is a different case than $now and the variable wouldn't populate if you had that same this.

Let's also try this:
Code: Select all
now=`date +%s`
commandfile='/var/lib/nagios3/rw/nagios.cmd'
/usr/bin/printf "[%lu] SCHEDULE_HOST_CHECK;host.ext;$now" > $commandfile
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12308
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Postby Cujka » Wed Nov 07, 2018 2:35 am

Hello,
thanks for you reply.

After few hours of leaving server with nagios alone, I just tried it and... It works again - miracle? It fixed itself... I cant reproduce the error ;-(
I hate this situation :-(

Peter
User avatar
Cujka
 
Posts: 2
Joined: Tue Nov 06, 2018 4:21 am

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Postby scottwilkerson » Wed Nov 07, 2018 10:05 am

I'm glad to hear it is working again, but I agree it's not an optimal outcome because you are going to be unable to find the root cause.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12308
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 13 guests