running check_mssql_nt.exe on remote server
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
running check_mssql_nt.exe on remote server
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
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
Re: running check_mssql_nt.exe on remote server
try this: check_mssql_health
link: http://exchange.nagios.org/directory/Pl ... th/details
Prerequisites:
- perl-DBD-Sybase
- freetds
link: http://exchange.nagios.org/directory/Pl ... th/details
Prerequisites:
- perl-DBD-Sybase
- freetds
Thanks & Regards,
SHEAN
SHEAN
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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
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
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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
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
Re: running check_mssql_nt.exe on remote server
Is this what you mean?
/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_mssql_nt -t 60
/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_mssql_nt -t 60
Thanks & Regards,
SHEAN
SHEAN
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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:
Is check_nrpe not a part of the nagios-plugins package? Is there another method for installing / acquiring it?
thanks,
mtf
/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
thanks,
mtf
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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:
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:
thanks for any guidance,
mtf
/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
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;
mtf
Re: running check_mssql_nt.exe on remote server
Take a look at the documentation for NSClient++, it might have the answer that you need.
http://nsclient.org/nscp/
http://nsclient.org/nscp/
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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:
from command.cfg on central Nagios server:
in the [external scripts] section of nsc.ini on remote_server_A:
and finally, in an external script file (db_queue_process_time_check.bat) on remote_server_A:
Any ideas?
mtf
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
}
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$'
}
Code: Select all
db_queue_process_time_check=SCRIPTS\db_queue_process_time_check.bat $ARG1$
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
mtf
-
- Posts: 19
- Joined: Tue Apr 12, 2011 6:31 pm
Re: running check_mssql_nt.exe on remote server
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--
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
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'
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