Proforming MS-SQL Querys

Andreas Ericsson ae at op5.se
Wed Apr 27 17:04:13 CEST 2005


Thomas Earl wrote:
> Greetings to all, 
> 
> I'm trying to find the best way to write a module to do a couple of
> MS-SQL querys and then compare the results... i.e.
> 
> $a = SELECT from CALLERS where are_logged_in
> $b = SELECT from CALLERS where on_calls
> 
> If $a = $b
>   report to nagios 
> [else]
>   exit
> 
> Of course the syntax of the above example is no where near what it needs
> to be, but you get the idea... 
> 
> I was reading something about sqsh, but I'm not running sybase so I
> don't know that is the right way... So I default to the experts... 
> 

MS-SQL == Sybase (more or less, anyway). They both speak the Tabular 
Data Stream protocol and thus can use the same client.

The plugin check_mssql.pl in contrib should point you in the right 
direction. It requires DBD::Sybase (go figure). To compile it, you'll 
needl need freetds or the proprietary Sybase libraries.

http://www.freetds.org
http://search.cpan.org/dist/DBD-Sybase

If memory serves me right, freetds comes with a client, a library, some 
headerfiles and a couple of examples so you can pick whichever one of C, 
shell and perl to hack up the script in (or python, ruby, tcl, expect 
too, but that wouldn't feel quite genuine, if you get my meaning).

> Any ideas would be great!
> 

Cheers. Let me know if you cook something up and want to share it.

> Thanks, 
> 
> Tom
> --
> Thomas Earl
> Network Engineer & Designer
> Communication Access Center
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
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