Help with MSSQL

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.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Help with MSSQL

Post by ofadl »

Hey guys,

I am continuing from the other thread and starting at the first page, where it get more complex and confusing. I copied over the service template, and service defintion. Reset nagios, and now am getting a "CHECK_NRPE: Socket timeout after 10 seconds" on the nagios website. Help is greatly appreciated
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Help with MSSQL

Post by lmiltchev »

This error can indicate several things:

– The command that the NRPE daemon was asked to run took longer than 10 seconds to execute. This is the
most likely cause if the error message was "CHECK_NRPE: Socket timeout after 10 seconds". Use the -t
command line option to specify a longer timeout for the check_nrpe plugin. The following example will
increase the timeout to 30 seconds:
/usr/local/nagios/check_nrpe -H localhost -c somecommand -t 30

– The NRPE daemon is not installed or running on the remote host. Verify that the NRPE daemon is running as
a standalone daemon or under inetd/xinetd with one of the following commands:
ps axuw | grep nrpe
netstat -at | grep nrpe

– There is a firewall that is blocking the communication between the monitoring host (which runs the check_nrpe
plugin) and the remote host (which runs the NRPE daemon). Verify that the firewall rules (e.g. iptables) that
are running on the remote host allow for communication and make sure there isn't a physical firewall that is
located between the monitoring host and the remote host.
For more information on troubleshooting NRPE, please, refer to the NRPE Documentation here:

http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Help with MSSQL

Post by ofadl »

ok, so im resuming on this problem since i solved my others. Here is the service definition i am trying to get to work :

Code: Select all

define service{
        use generic-service     ; Name of service template to use
        host_name vnadat121
        service_description Check for Content Received from High Volume Sources
        check_command check_nrpe!run_mssql_sproc!vnadat121!database!user!pass!sp_CheckCoreLastDeliveredBusHours
        }


but im getting a unknown error on nagios with the description as " No handler for that command"

Any help is appreciated
Last edited by ofadl on Fri Aug 02, 2013 2:52 pm, edited 1 time in total.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Help with MSSQL

Post by abrist »

Have you created a handler for the command in your nsclient config?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Help with MSSQL

Post by ofadl »

i have not, and i am not sure how to go about creating one

i have found the command definition on the older nagios :

command[run_mssql_sproc]=cscript.exe //NoLogo //T:300 c:\nrpe_nt\run_mssql_sproc.wsf /s:$ARG1$ /d:$ARG2$ /u:$ARG3$ /p:$ARG4$ $ARG5$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Help with MSSQL

Post by lmiltchev »

Do you have a script named "run_mssql_sproc.wsf" in the "c:\nrpe_nt\" directory? Can you run the script locally from the DOS Command Prompt?

Code: Select all

cscript.exe //NoLogo //T:300 c:\nrpe_nt\run_mssql_sproc.wsf /s:vnadat121 /d:$Equinox /u:user /p:pass sp_CheckCoreLastDeliveredBusHours
Be sure to check out our Knowledgebase for helpful articles and solutions!
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Help with MSSQL

Post by ofadl »

yes, i moved the script named "run_mssql_sproc.wsf" into the scripts folder of NSClient++ folder. I am not entirely sure how to run it from command prompt locally.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Help with MSSQL

Post by yancy »

to run it localy, open a command prompt, and type

Code: Select all

cscript.exe //NoLogo c:\nrpe_nt\run_mssql_sproc.wsf /s:vnadat121 /d:$Equinox /u:user /p:pass sp_CheckCoreLastDeliveredBusHours
-Yancy
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: Help with MSSQL

Post by ofadl »

yes, it is running fine locally.

Code: Select all

CRITICAL. Query result is: More than 20 minute gap found in high volume sources:
 INW

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

Re: Help with MSSQL

Post by scottwilkerson »

Then add the following to [External Scripts] section of your nsclient.ini

Code: Select all

[External Scripts]
run_mssql_sproc=cscript.exe //NoLogo c:\nrpe_nt\run_mssql_sproc.wsf /s:vnadat121 /d:$Equinox /u:user /p:pass sp_CheckCoreLastDeliveredBusHours
restart NSClient++


Then call from Nagios server with

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <HOST_ADDRESS> -c run_mssql_sproc
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked