running check_mssql_nt.exe on remote server

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
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

I've been searching on-and-off for several weeks to try to solve this challenge. The documentation is especially scarce on this topic, and I'll be glad to fully document with example how to create this configuration if someone can point me in a positive direction. I'm not even asking for the right direction. Just something in the general area of where I need to go.

I have a linux nagios install watching a dozen windows servers. I am eager to run check_mssql_nt.exe plugin on one or more of the windows servers pointing at the various database servers. I would like the linux server to send a message to the windows server telling it to run the check_mssql_nt.exe command and report back to the linux server the results of the query. I can get check_mssql_nt.exe to work fine from the command line on the windows computers. I cannot for the life of me figure out how to send a message from the linux monitor to the windows server to then execute the check_mssql_nt.exe binary.

I'm running NSclient++ on all the windows computers. Here is the syntax that works on the windows command line:

”C:\Program Files\NSClient++\check_mssql_nt.exe”/U:the_user /P:the_password /H:10.10.10.122 /D:db_bazooka /CHK_CONNECTIONCOUNT -Wv:50 -Cv100

The documentation on check_mssql_nt.exe assumes significant knowledge on the part of the person installing / configuring. For instance, there's not even a mention of where it should be installed or how to edit the commands.cfg file for running it.

Any help appreciated,

mtf
shean71
Posts: 10
Joined: Fri Mar 25, 2011 9:14 am

Re: running check_mssql_nt.exe on remote server

Post by shean71 »

try this: check_mssql_health

link: http://exchange.nagios.org/directory/Pl ... th/details


Prerequisites:
- perl-DBD-Sybase
- freetds
Thanks & Regards,
SHEAN
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

Shean,

Thanks for your thoughtful suggestion. The check_mssql_health package looks good for having a linux server connect to a sqlserver db, but in my case, I am trying to get our production app servers to connect to the DB and report back to the linux monitor their ability to connect. This will alert me to network issues that will affect connectivity between production servers that won't necessarily be revealed if the linux monitor is doing all the polling.

Do I need to use NPRE to send a message instructing the windows servers to run a command line operation that fires off CHECK_MSSQL_NT.EXE?

-- Seth Johnson
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

I'm running around in circles here and would appreciate any amount of guidance.


LINUX SERVER ------> WINDOWS SERVER ----->SQL SERVER DB on REMOTE WINDOWS SERVER

NSCLIENT++ is on all windows servers. How do I get the linux server to send a message to nsclient++ on the windows server to then run CHECK_MSSQL_NT.EXE from the command line?

I installed nagios-nrpe on the linux server, but there doesn't seem to be a check_nrpe command installed anywhere I can find.

What is the architecture of this system? I would like to say this is only the second day I've spent trying to get this properly connected, but it's a lot more than that.

Any guidance appreciated.

mtf
shean71
Posts: 10
Joined: Fri Mar 25, 2011 9:14 am

Re: running check_mssql_nt.exe on remote server

Post by shean71 »

Is this what you mean?
/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_mssql_nt -t 60
Thanks & Regards,
SHEAN
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

After a lot more researching, I think the problem is that on my Fedora 14 install, I do not have check_nrpe.

/usr/local/nagios/libexec/check_nrpe

does not exist. I have used YUM to succesfully (?) install all the plugins as so:

Code: Select all

yum install nagios-plugins-nrpe
Is check_nrpe not a part of the nagios-plugins package? Is there another method for installing / acquiring it?

thanks,

mtf
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

On Fedora 14, the yum installer apparently places the check_nrpe plugin here:

/usr/lib64/nagios/plugins

That is contrary to the other plugin location of:

/usr/local/nagios/libexec

So my next question is, where on the windows nsclient++ side do I configure the command that will run the following syntax:

Code: Select all

”C:\Program Files\NSClient++\check_mssql_nt.exe”/U:username /P:password /H:10.10.10.52 /D:db_bazooka /CHK_CONNECTIONCOUNT -Wv:50 -Cv100
Do I need to edit nsc.ini config file to define a command for running this syntax and then use that command within the check_nrpe syntax on my Linux-hosted Nagios server?

On the linux server, I am able to get this command to contact the windows nsclient++ and receive a response:

Code: Select all

./check_nrpe -H 10.10.10.52 -c checkUpTime -a MinWarn=1d MinWarn=1h
OK all counters within bounds.|'uptime'=16405683000;3600000;0;
thanks for any guidance,

mtf
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: running check_mssql_nt.exe on remote server

Post by mguthrie »

Take a look at the documentation for NSClient++, it might have the answer that you need.
http://nsclient.org/nscp/
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

OK. I got this working to a certain extent. The only problem is that the warning and critical alerts don't bubble up to the Nagios server. Everything is acknowledged as 'OK' as long as Nagios gets any response back from the nrpe client that then runs the query against the database. The status for the service will be an OK even though in the 'Status Information' column the following is displayed:

MSSQL CRITICAL - query value="859" in 0.14 seconds



Here's the relevant settings:

from windows.cfg on our central Nagios server:

Code: Select all

define service{
        use                     generic-service
        host_name               remote_server_A
        service_description     Database Queue Process Time
        check_command           Database_queue_process_time_check!the_db_name
        }
from command.cfg on central Nagios server:

Code: Select all

define command{
        command_name    database_queue_process_time_check
        command_line  /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c 'db_queue_process_time_check!$ARG1$'

        }
in the [external scripts] section of nsc.ini on remote_server_A:

Code: Select all

db_queue_process_time_check=SCRIPTS\db_queue_process_time_check.bat $ARG1$
and finally, in an external script file (db_queue_process_time_check.bat) on remote_server_A:

Code: Select all

@echo off
SET database=%1
"C:\Program Files\NSClient++\check_mssql_nt.exe" /U:username /P:password /H:10.10.11.77 /D:%database% /CHK_QUERY:"select avg(process_time) from db_queue where create_date > DATEADD(hh,-1,getdate())" /Wv:500 /Cv:750
@exit 0
Any ideas?

mtf
mrtexasfreedom
Posts: 19
Joined: Tue Apr 12, 2011 6:31 pm

Re: running check_mssql_nt.exe on remote server

Post by mrtexasfreedom »

Looking more closely, the problem is either with the check_mssql_nt.exe plugin or the nsclient++ app on the remote computer. Here are the incriminating details from the nsclient++ log--

Code: Select all

2011-08-01 18:38:39: debug:NSClient++.cpp:1180: Injected Result: OK 'MSSQL WARNING - query value="1090" in 0.14 seconds'
Should not be 'Injected Result: OK'.

Are people just not really using this check_mssql_nt.exe plugin to run dynamic sql queries? I'd think this would be a pretty glaring problem.

--mtf
Locked