Service & Process check_nt


#1

Cannot find the option to check to make sure a process/service is not running or started. Need to return an OK is the service it not up or running?

Any ideas?


#2

use a normal process check and couple it with negate so the traditional “OK” if service running becomes “CRITICAL”, and “CRITICAL” response when service is not running becomes “OK”

HTH

/S


#3

thanks…what is strange is i have tried the negate plugin on my nagios server and I get the following in the status info field and the STATUS is UNKNOWN…‘no data returned from command’…this is what i have added to commands.cfg and my service definition is below as well…really nt sure why its not receiving the data…gonna keep hammering away on this

-commands.cfg

define command{
command_name check_nt_negate
command_line /usr/local/nagios/libexec/negate “/usr/local/nagios/libexec/check_nt!PROCSTATE!-d SHOWALL -l dbsizer.exe”
}

-windows.cfg

define service{
use generic-service
host_name host.domain.local
service_description dbzier.exe Process Check
check_command check_nt_negate
}


#4

Dont you need -H $HOSTADDRESS$ in your check_nt command object somewhere?


#5

tried to add the $HOSTADDRESS$ as well with no luck, used hostname and tried explicit IP as well…still getting a status of ‘UNKNOWN’ and ‘no data returned from command’.

Going to try some other services to make sure it not the service…

###################SJH COMMANDS###################################
define command{
command_name check_nt_negate
command_line /usr/local/nagios/libexec/negate “/usr/local/nagios/libexec/check_nt!PROCSTATE! -H $HOSTADDRESS$ -d SHOWALL -l dbsizer.exe”
}

#####################SJH SERVICE DEFs###############################

define service{
use generic-service
host_name xxxx.domain.local
service_description ADP Process Check
check_command check_nt_negate
}


#6

RESOLVED…FYI…Here is what needs to be done

must pass PROCSTAT as a option and not a variable and may have to include the specific port as well depending on your config

You can replace hostaddress with the actual IP if it doesnt resolve and that works as well.

###################SJH COMMANDS.CFG###################################
define command{
command_name check_nt_negate
command_line ./negate “/usr/local/nagios/libexec/check_nt -H $HOSTADDRESS$ -v PROCSTATE -p 12489 -l dbsizer.exe -d SHOWALL”
}

#####################SJH WINDOWS.DEF###############################

define service{
use generic-service
host_name xxxx.domain.local
service_description ADP Process Check
check_command check_nt_negate
}


#7

hello,

when i try this solution, i have this error :

(Return code of 127 is out of bounds - plugin may be missing)

###################SJH COMMANDS.CFG###################################

‘check_nt_inverse_exp’ command definition

define command{
command_name check_nt_inverse_exp
command_line /usr/local/nagios/libexec/negate $USER1$/check_nt -H $HOSTADDRESS$ -v PROCSTATE -p 12489 -s 12489 -d SHOWALL -l exp.exe
}
#####################SJH WINDOWS.DEF###############################
define service{
use generic-service
hostgroup EXP
service_description Export en cours
check_command check_nt_inverse_exp
check_period matin-semaine
}


#8

it’s now OK with chown nagios:nagios where there are the plugins