schedule_svc_check should be schedule_forced_svc_check


#1

Hello, I have been searching all over the place for an answer to this, and have come to the forums as a last resort. I just installed the latest nagios v3.0.5 on a suse 11.0 system. This is to replace a v2.x server that was running. I have successfully reconfigured and added all services. Of course a few failed, and this presents the problem. I go to reschedule the process through the web link (selected force). Everything looks fine when I commit the change. But it never runs again, only at its intended rescheduled time/date. I start looking at error logs and turning on debug modes and what not. NO errors occur at all. The problem seems to be even with the force check box marked its still sending a regular svc check reschedule not a forced one. This is the only problem I can see in the logs. Does any one know why it would be doing this? Or could my problem be elsewhere? nagios.cfg is enabled to check the commands and is set to do it every 10s (for testing purposes). All our other nagios (v2.:evil: are running fine.

ANY help would be greatly appreciated.
Thanks in advance


#2

Forcing a check through the CGI appears to essentially result in the submittion of an ‘external command’. Check the following:
[blockquote]
Format: check_external_commands=<0/1>
Example: check_external_commands=1

This option determines whether or not Nagios will check the command file for commands that should be executed. This option must be enabled if you plan on using the command CGI to issue commands via the web interface. More information on external commands can be found here.

0 = Don’t check external commands
1 = Check external commands (default) [/blockquote] nagios.sourceforge.net/docs/3_0/ … l_commands

[blockquote]External Command File

Format: command_file=<file_name>
Example: command_file=/usr/local/nagios/var/rw/nagios.cmd

This is the file that Nagios will check for external commands to process. The command CGI writes commands to this file. The external command file is implemented as a named pipe (FIFO), which is created when Nagios starts and removed when it shuts down. If the file exists when Nagios starts, the Nagios process will terminate with an error message. More information on external commands can be found here. [/blockquote] nagios.sourceforge.net/docs/3_0/ … mmand_file

[blockquote]External Command Check Interval

Format: command_check_interval=[s]
Example: command_check_interval=1

If you specify a number with an “s” appended to it (i.e. 30s), this is the number of seconds to wait between external command checks. If you leave off the “s”, this is the number of “time units” to wait between external command checks. Unless you’ve changed the interval_length value (as defined below) from the default value of 60, this number will mean minutes.

Note: By setting this value to -1, Nagios will check for external commands as often as possible. Each time Nagios checks for external commands it will read and process all commands present in the command file before continuing on with its other duties. More information on external commands can be found here. [/blockquote] nagios.sourceforge.net/docs/3_0/ … k_interval

Check permissions on the command file (eg nagios.cmd) are correct.
Check the timestamp is updated when the command is submitted.

Lastly, and I can’t find any reference to this at this precise moment due to the limited search functionallity, but IIRC a regular poster by the name of “Loose” reguarly posted on the fact that he believes the 10s to be the absolute minimum interval between check times… maybe that is a sticking point also…

HTH

/S


#3

I deffinently checked all that everything was fine and I increased my interval to 30 seconds. Increasing the interval does nothing in my case. I deffinently found the problem when i run script to insert the external command from the cli it works just fine, and everything i need reruns when i submit it through cli. But when i try to do it through the web interface and submit a reschedule it just does a regular reschedule not a forced even with the check box marked. is this a possible bug with the web interface or do I have to enable a feature for the web interface to be able to submit forced svc checks

Thanks for your reply

EDIT
This is what allows me to submit a forced check by command line
now=date +%s
commandfile=’/usr/local/nagios/var/rw/nagios.cmd’

/usr/bin/printf “%lu] SCHEDULE_FORCED_SVC_CHECK;ike;307B-OFFICE_DNS;1110741500\n” $now > $commandfile


#4

I agree. I believe it’s likely a bug. I’ve recently upgraded from Nagios 3.0.3 to Nagios 3.0.5 and experience the same symptoms. Had no issues prior to that and I’m using the same exact configs. The problem only applies to some services in Nagios, the reschedule check will not work regardless if force is checked off or not. There’s no errors and nagios takes in the request with no complains.


#5

So I found some info that they recently fixed a bug that messed up the way service commands where entered. So i decided to upgrade to the latest snapshot repository. This unfortunately did not fix this issue we are having. This must be a bug and I will send and email out to the nagios-devel group to see what can be done. It seems like an easy fix.


#6

So I found the problem and I have a fix for it aswell. Apparently they changed around the code between 3.0.4 and 3.0.5 and it almost looks as though they forgot some things.

to fix:
go to your nagios src directory/cgi vi cmd.c
look for
case CMD_SCHEDULE_SVC_CHECK:
case CMD_SCHEDULE_FORCED_SVC_CHECK:
result = cmd_submitf(cmd,"%s;%s;%lu",host_name,service_desc,start_time);
break;

This should be:

case CMD_SCHEDULE_SVC_CHECK:
case CMD_SCHEDULE_FORCED_SVC_CHECK:
if (force_check == TRUE){
cmd = CMD_SCHEDULE_FORCED_SVC_CHECK;
}
result = cmd_submitf(cmd,"%s;%s;%lu",host_name,service_desc,start_time);
break;

or at least in my opinion from the looks of the rest of the commands.

Do this at your own risk or test first to make sure everything is fine on your systems
From here make clean , make all , make install , restart your nagios service.