Page 4 of 9
Re: MSSQL using NSClient++
Posted: Thu Jun 27, 2013 3:52 pm
by ofadl
i do not want to have a check for "check_mssql_health" i want to set it up for "check_mssql_sproc" for stored procedures
Re: MSSQL using NSClient++
Posted: Thu Jun 27, 2013 4:05 pm
by sreinhardt
Well based on the sites documentation, you would need a command similar to:
$USER1$/check_mssql_sproc.pl -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -P $ARG3$ -w $ARG4$ -c $ARG5$
$USER1$ and $HOSTADDRESS$ are provided by default with any check.
$ARG1$ is your stored procedure
$ARG2$ Username
$ARG3$ Password
$ARG4$ warning threshold
$ARG5$ critical threshold
You can also check those values on the command line by replacing their appropriate values and executing it.
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 8:19 am
by ofadl
ok so i modified it to look like what you posted to this:
define service{
use generic-service
host_name vnadat121
service_description Check for Content Received from High Volume Sources
check_command $USER1$/check_mssql_sproc.pl -H $HOSTADDRESS$ -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w $ARG4$ -c $ARG5$
}
but now im getting an error "Error: Service check command '$USER1$/check_mssql_sproc.pl -H $HOSTADDRESS$ -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w $ARG4$ -c $ARG5$' specified in service 'Check for Content Received from High Volume Sources' for host 'vnadat121' not defined anywhere!
Checked 304 services."
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 9:05 am
by slansing
Thats not a check_command....You placed the entire command in the field where you place the shorthand version. You need to place your command, in your commands.cfg file, and then create/edit the service definition like you had before.
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 9:49 am
by ofadl
ok so i made command look like this:
define command{
command_name Check for processes
command_line $USER1$/check_mssql_sproc.pl -H $HOSTADDRESS$ -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "password" -w $ARG4$ -c $ARG5$
}
and service definition to:
define service{
use generic-service ; Name of service template to use
host_name vnadat121
service_description Check MSSQL
check_command check_mssql
check_period 24x7
}
is that correct? sorry for the hassle, im trying to get used to this stuff
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 9:55 am
by slansing
You are going to need to supply the arguments for your command otherwise they will just sit there, and the command will likely not work, you will also need to make the command name valid, and use it in the service. To do this, edit the commands.cfg definition and service's configuration file to look more like this:
Code: Select all
define command{
command_name check_mssql
command_line $USER1$/check_mssql_sproc.pl -H $HOSTADDRESS$ -p "sp_CheckCoreLastDeliveredBusHours" -u sa -P "dusT#Controle" -w $ARG1$ -c $ARG2$
}
Code: Select all
define service{
use generic-service ; Name of service template to use
host_name vnadat121
service_description Check_L
check_command check_mssql!20!30!!
check_period 24x7
}
The "!" denotes a new argument being used, since you have two, I added two, one for the first arg, and one for the second and set their values to a nondescript warning and critical value, feel free to change it.
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 10:09 am
by ofadl
ok i put those two files into my nagios machine, but im getting an error called "service check did not exit properly"
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 10:19 am
by slansing
You mean you saved them right? Or are you creating new service and command definitions each time we change something?? What does the command output if you run it from the command line instead of waiting for checks in the Web UI?
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 10:20 am
by ofadl
i copy and pasted what u supplied with before, into into the commands.cfg file and other into my windows.cfg file and restarted nagios.
Re: MSSQL using NSClient++
Posted: Fri Jun 28, 2013 10:21 am
by slansing
What does the command output if you run it from the command line instead of waiting for checks in the Web UI?