CHECK_MSSQL CRITICAL allways as output when use check_sql for MSSQL checking

Mathew Walker lmw94002 at hotmail.com
Thu Sep 10 18:39:33 CEST 2009


Wow, so little time to follow the list, but I've got through all this so I figure I had to chime in... 

 

Start testing via the command line...

my environment works like...  

[root at server]# ./check_mssql -H mssqlsrvr -p 1433 -t 10 -U user -P password

CHECK_MSSQL OK - SQL Server responded in 0.025192 seconds | time=0.025192s;;

 

NOTES

1) based on your freetds entry... the servername for the check should be "MSSQL"

2) are you using windows or SQL Auth?  if using windows domain users to auth... you may need to do "-U domain\\user" as the username

 

Also tweak the debug logging and check the logs for other helpful bits.



-- 
Mat W. - http://www.techadre.com


 
> Date: Thu, 10 Sep 2009 17:21:50 +0100
> From: jim at jimavery.me.uk
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] CHECK_MSSQL CRITICAL allways as output when use check_sql for MSSQL checking
> 
> 2009/9/9 Arlen Drina <arlytex at gmail.com>:
> > Hi all,
> >
> > I am using check_sql for checking MSSQL server ( or I would like to
> > check MSSQL servers ). I compiled
> > freetds with --with-tdsver=8.0 support on my debian system and all
> > went ok, in /etc/freetds.conf I have
> >
> > [global]
> >        # TDS protocol version
> > #;      tds version = 4.2
> >        tds version = 8.0
> >
> > # A typical Microsoft server
> > [MSSQL]
> >        host = sss.sss.sss.sss
> >        port = 1433
> >        tds version = 8.0
> >
> > and when I run ./check_mssql -H sss.sss.sss.sss -p 1433 -U USER -P PASSWORD
> >
> > I am constantly getting output
> >
> > CHECK_MSSQL CRITICAL
> >
> > Ok, I tried to solve this myself and I found at \
> >
> > http://exchange.nagios.org/directory/Plugins/Databases/Others/check_sql/details
> > that is recommneded to change host-->server in line
> >
> > my $cs = "DBI:$driver:" . ($database ? "database=$database;" : '') .
> > "server=$hostname" . ($port ? ";port=$port" : '');
> >
> > so I changed that, but still I am getting same output for above command.
> >
> > I am just trying to get minimal response from MSSQL server, connection
> > to port 1433 is open and I can connect via
> > telnet sss.sss.sss.sss 1433  and it works.
> >
> > Any hint is welcome, I exhausted all my ideas, and thank you in advance
> 
> 
> I don't use freetds. Instead, I installed php5-sybase (and any
> dependencies if there were any, I can't remember) from the debian
> repositories (I'm using Ubuntu).
> 
> I can run the plugin from the command line like so:
> 
> /usr/local/nagios/libexec/check_mssql -H 10.10.10.123 -U loginid -P mypassword
> OK: Connect time=0.004189 seconds.
> 
> Of course, the user "loginid" must be configured in MSSQL with the
> password "mypassword" to authenticate to the database.
> 
> Some of our MSSQL servers have a specific instance, in which case you
> need to find the port number the instance is listening on, then use
> the following syntax to do the check:
> 
> /usr/local/nagios/libexec/check_mssql -H 10.10.10.123:1375 -u
> loginid -P mypassword
> OK: Connect time=0.045179 seconds.
> 
> (1375 is the port number for this instance but it varies from one to the next)
> 
> I found the check_mssql didn't like the hostname syntax when using IP
> addresses like this, so I changed it a bit by removing both the
> "Validate the hostname" and "Validate the username" sections.
> 
> I also (very sloppily) altered the part where it checks if the
> expected result is emtpy like so:
> 
> 287c205
> < if ($querytype == "query" && !empty($expected_result)) {
> ---
> > if ($querytype == "query" && (!empty($expected_result) ||
> $expected_result == "0")) {
> 
> That was because I wanted to do a check which expected a result "0".
> 
> 
> hth,
> 
> Jim
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090910/8569f563/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list