Page 1 of 1

check_nt returns UNKNOWN - No service/process specified

Posted: Wed Aug 12, 2015 10:32 am
by tduncan
check_nt

Returns the following a warning in the web interface
UNKNOWN No service/process specified



But when ran at the command line it returns OK
check_nt -H 10.1.1.1 -p 12489 -v SERVICESTATE -l MSExchangeRPC
OK: All services are in their appropriate state.



MYSERVER.cfg contains...

define service{
use generic-service
host_name MYSERVER
service_description MSExchangeRPC
check_command check_nt!SERVICESTATE!-p 12489 -d SHOWALL -l MSExchangeRPC
}



Any help is appreciated.

NagiosĀ® Coreā„¢
Version 3.2.3

Re: check_nt returns UNKNOWN - No service/process specified

Posted: Wed Aug 12, 2015 2:56 pm
by jolson
In addition to the service.cfg that you provided, I would like to see your commands.cfg file - typically located at /usr/local/nagios/etc/commands.cfg. The output should look something like this:

Code: Select all

define command {
       command_name                             check_nt
       command_line                             $USER1$/check_nt -H $HOSTADDRESS$ -p $USER7$ -s $USER8$ -v $ARG1$ $ARG2$
}

Re: check_nt returns UNKNOWN - No service/process specified

Posted: Fri Aug 14, 2015 8:01 am
by tduncan
cat /etc/nagios3/commands.cfg

###############################################################################
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS
###############################################################################


################################################################################
# NOTIFICATION COMMANDS
################################################################################


# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Tim
e: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}

# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n
\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}





################################################################################
# HOST CHECK COMMANDS
################################################################################

# On Debian, check-host-alive is being defined from within the
# nagios-plugins-basic package

################################################################################
# PERFORMANCE DATA COMMANDS
################################################################################


# 'process-host-perfdata' command definition
define command{
command_name process-host-perfdata
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios3/host-p
erfdata.out
}


# 'process-service-perfdata' command definition
define command{
command_name process-service-perfdata
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOU
TPUT$\t$SERVICEPERFDATA$\n" >> /var/lib/nagios3/service-perfdata.out
}

Re: check_nt returns UNKNOWN - No service/process specified

Posted: Fri Aug 14, 2015 12:26 pm
by jolson
Your check_nt command must be defined elsewhere. You might need to grep around to find the file that defines the check_nt command - I would like the output of that file.

Code: Select all

grep -A2 -B2 -R command_name.*check_nt /etc/nagios3/