locks-deadlocks issues with check_MSSQL_health plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

Hi All,

I have some issues working with locks-deadlocks with the status information critical - unable to aquire lock info. Does anyone have set it up before?

It looks like all other SQL monitoring services are good except for all the locks. Any help will be appreciated.

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by scottwilkerson »

Can you post the command definition you are running that is producing the problem?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

Thanks for the quick reply.

The Nagios3 core is running under Ubuntu 14.04 trying to monitor the MS SQL 2008 server. the command line that I use is as follow:

define command{
command_name check_mssql_health
command_line $USER1/check_mssql_health -username $USER3$ - password $USER4$ -server $HOSTNAME$ -mode $ARG1$ - name $ARG2$ -commit
}

in cfg file I have tried:

check_command check_mssql_health!locks-deadlocks
and
check_command check_mssql_health!locks-deadlocks!DBNAME

still doesn't work. I also try to use both windows and SQL authentication with sysadmin privilege but they don't work either.

Let me know if you need more info.

Thanks!
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

it looks like when I run like this it will give me the result

./check_mssql_health -password PWD -username USERNAME - server 192.168.1.x -mode locks-deadlocks

but not on the web interface, I only get the message "CRITICAL - unable to aquire lock info"
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by scottwilkerson »

The problem is that you command you have defined will add additional items to the command, as you see

Code: Select all

command_line $USER1/check_mssql_health -username $USER3$ - password $USER4$ -server $HOSTNAME$ -mode $ARG1$ - name $ARG2$ -commit
Will get translated to something like

Code: Select all

./check_mssql_health -username USERNAME - password PASSWORD -server 192.168.1.x -mode locks-deadlocks - name -commit
this leaves an extraneous

Code: Select all

 - name -commit
at the end.

I would suggest breaking this into multiple commands to meet your needs
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

does it have to do with the space? sorry I accidentally add the space in the post. with the command in the cfg file actually there is no space.

And also, do you have any suggestions how to break this into multiple commands?

Thanks!
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

scottwilkerson wrote:The problem is that you command you have defined will add additional items to the command, as you see

Code: Select all

command_line $USER1/check_mssql_health -username $USER3$ - password $USER4$ -server $HOSTNAME$ -mode $ARG1$ - name $ARG2$ -commit
Will get translated to something like

Code: Select all

./check_mssql_health -username USERNAME - password PASSWORD -server 192.168.1.x -mode locks-deadlocks - name -commit
this leaves an extraneous

Code: Select all

 - name -commit
at the end.

I would suggest breaking this into multiple commands to meet your needs
I took out the -name from the command line and it is working now.

Thanks!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by sreinhardt »

Fantastic, nice job! Do you want us to lock this one up and call it closed?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
pkam
Posts: 10
Joined: Mon Dec 15, 2014 1:20 pm

Re: locks-deadlocks issues with check_MSSQL_health plugin

Post by pkam »

sreinhardt wrote:Fantastic, nice job! Do you want us to lock this one up and call it closed?
Yes please. I am good with this issue now.

Thanks!
Locked