Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anymore

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
User avatar
Cujka
Posts: 2
Joined: Tue Nov 06, 2018 4:21 am

Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anymore

Post by Cujka »

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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Post by scottwilkerson »

To be clear, are you saying the "Last Check Time" for the service isn't updating along with the check results?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Post by scottwilkerson »

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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Cujka
Posts: 2
Joined: Tue Nov 06, 2018 4:21 am

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Post by Cujka »

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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core - SCHEDULE_FORCED_SVC_CHECK not working anym

Post by scottwilkerson »

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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked