Page 1 of 2
Help with MSSQL
Posted: Thu Jul 11, 2013 1:09 pm
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
Re: Help with MSSQL
Posted: Thu Jul 11, 2013 1:44 pm
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
Re: Help with MSSQL
Posted: Thu Aug 01, 2013 3:15 pm
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
Re: Help with MSSQL
Posted: Thu Aug 01, 2013 3:20 pm
by abrist
Have you created a handler for the command in your nsclient config?
Re: Help with MSSQL
Posted: Thu Aug 01, 2013 3:44 pm
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$
Re: Help with MSSQL
Posted: Thu Aug 01, 2013 4:40 pm
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
Re: Help with MSSQL
Posted: Fri Aug 02, 2013 8:55 am
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.
Re: Help with MSSQL
Posted: Fri Aug 02, 2013 10:14 am
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
Re: Help with MSSQL
Posted: Fri Aug 02, 2013 10:43 am
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
Re: Help with MSSQL
Posted: Fri Aug 02, 2013 12:20 pm
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