MSSQL service error.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

MSSQL service error.

Post by gdolidze »

I ran the MSSQL Monitoring wizard and got this error for all the services.

(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: MSSQL service error.

Post by tgriep »

Could you go in to Core Config Manager, Services and click on the Floppy Icon to get the configuration information for the failing services and post that here?
Be sure to check out our Knowledgebase for helpful articles and solutions!
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: MSSQL service error.

Post by gdolidze »

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.3.3
# Date: 2015-07-20 10:23:30
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name libraryservices.cjh.org
service_description CPU Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!CPULOAD!-l 5,80,90
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description Drive C: Disk Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!USEDDISKSPACE!-l C -w 80 -c 95
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description IIS Web Server
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!SERVICESTATE!-l W3SVC -d SHOWALL
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description Memory Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!MEMUSE!-w 80 -c 90
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description MSSQL Average Wait Time
use xiwizard_mssqlserver_service
check_command check_xi_mssql_server!-U 'sa' -P '<password>' -I 'LIBRARYSERVICES' --averagewait --warning 20 --critical 30
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mssqlserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description Ping
use xiwizard_windowsserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description SQL Server
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!SERVICESTATE!-l MSSQLSERVER -d SHOWALL
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description Uptime
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!<password>!UPTIME
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard windowsserver
register 1
}

define service {
host_name libraryservices.cjh.org
service_description _ URL Status
use xiwizard_website_http_service
check_command check_xi_service_http! -f ok -I 67.111.179.132 -u '/' -p 80
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard websiteurl
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL service error.

Post by lmiltchev »

Have you tried removing the special characters from the password? Does the check work this way or you are still getting (No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''?

I suspect you will need to escape the special characters in the password. You can also place the password in the "resource.cfg" file. To learn how, read the following document:

https://assets.nagios.com/downloads/nag ... Macros.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: MSSQL service error.

Post by gdolidze »

Its not the password. I tried to use basic passwords and other MSSQL password to see if it would work but when I tried them this is the error I get.

Connection to the database failed for an unknown reason.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL service error.

Post by lmiltchev »

Can you connect to the MSSQL server from the command line?

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.py -H <ip address> -U 'sa' -P '<password>' -I 'LIBRARYSERVICES'
Can you zip up the "/usr/local/nagios/libexec/check_mssql_server.py" file and upload it on the forum?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked