These are my configurations for both servers (server2 and working server):
Working Server:
submit_service_check
Code: Select all
#!/bin/sh
# Arguments:
# $1 = host_name (Short name of host that the service is
# associated with)
# $2 = svc_description (Description of the service)
# $3 = return_code (An integer that determines the state
# of the service check, 0=OK, 1=WARNING, 2=CRITICAL,
# 3=UNKNOWN).
# $4 = plugin_output (A text string that should be used
# as the plugin output for the service check)
#
# $5 = $LONGSERVICEOUTPUT$
# $6 = $SERVICESTATETYPE$ (= SOFT ou HARD)
# $7 = $SERVICEPERFDATA$
# Convert the state string to the corresponding return code
return_code=-1
myfirst=`expr substr "$4" 1 1`
case "$3" in
OK)
return_code=0
;;
WARNING)
return_code=1
;;
CRITICAL)
return_code=2
;;
UNKNOWN)
return_code=-1
;;
esac
# pipe the service check info into the send_nsca program, which
# in turn transmits the data to the nsca daemon on the central
# monitoring ser
case "$6" in
HARD)
printf "%s\t%s\t%s\t%s\n%s\n" "$1" "$2" "$return_code" "$4|$7" | /usr/local/nagios/bin/send_nsca IP_ADDRESS_SERVER1 -c /etc/send_nsca.cfg
;;
*)
esac
echocmd="/bin/echo"
CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`
# create the command line to add to the command file
cmdline="[$datetime] PROCESS_SERVICE_CHECK_RESULT;$1;$2;$3;$4"
# append the command to the end of the command file
`$echocmd $cmdline >> $CommandFile`Code: Select all
define command{
command_name submit_service_check
command_line /usr/local/nagios/etc/TMS/submit_service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATE$ '$SERVICEOUTPUT$' '$LONGSERVICEOUTPUT$' '$SERVICESTATETYPE$' '$SERVICEPERFDATA$'
}Code: Select all
#!/bin/sh
# Arguments:
# $1 = host_name (Short name of host that the service is
# associated with)
# $2 = svc_description (Description of the service)
# $3 = return_code (An integer that determines the state
# of the service check, 0=OK, 1=WARNING, 2=CRITICAL,
# 3=UNKNOWN).
# $4 = plugin_output (A text string that should be used
# as the plugin output for the service check)
#
# $5 = $LONGSERVICEOUTPUT$
# $6 = $SERVICESTATETYPE
# Convert the state string to the corresponding return code
return_code=-1
myfirst=`expr substr "$4" 1 1`
case "$3" in
OK)
return_code=0
;;
WARNING)
return_code=1
;;
CRITICAL)
return_code=2
;;
UNKNOWN)
return_code=-1
;;
esac
# pipe the service check info into the send_nsca program, which
# in turn transmits the data to the nsca daemon on the central
# monitoring ser
case "$6" in
HARD)
printf "%s\t%s\t%s\t%s\n%s\n" "$1" "$2" "$return_code" "$4|$7" | /usr/sbin/send_nsca IP_ADDRESS_SERVER1 -c /usr/local/nagios/etc/send_nsca.cfg
;;
*)
esac
echocmd="/bin/echo"
CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`
# create the command line to add to the command file
cmdline="[$datetime] PROCESS_SERVICE_CHECK_RESULT;$1;$2;$3;$4"
# append the command to the end of the command file
`$echocmd $cmdline >> $CommandFile`
#printf "%s: %s %s %s %s\n" "`date`" "$1" "$2" "$return_code :: $3 | $4" "$5" >> /bash/ocsp_command.log
Code: Select all
define command{
command_name submit_service_check
command_line /usr/local/nagios/etc/TMS/submit_service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATE$ '$SERVICEOUTPUT$' '$LONGSERVICEOUTPUT$' '$SERVICESTATETYPE$' '$SERVICEPERFDATA$'
}Do you see any difference because I can't. I know I'm missing something but I am completely lost in here.
EDIT: I realized just now that the versions of the check_nrpe is different in both servers. Do you think that this might be the reason why the plugin_output is filled with all information in one server and in the other is not?
Thank you