Page 1 of 1

MSSQL service error.

Posted: Mon Jul 20, 2015 8:56 am
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 `''

Re: MSSQL service error.

Posted: Mon Jul 20, 2015 9:18 am
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?

Re: MSSQL service error.

Posted: Mon Jul 20, 2015 9:23 am
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
#
###############################################################################

Re: MSSQL service error.

Posted: Mon Jul 20, 2015 9:57 am
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

Re: MSSQL service error.

Posted: Mon Jul 20, 2015 10:31 am
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.

Re: MSSQL service error.

Posted: Mon Jul 20, 2015 11:24 am
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?