Re: Monitoring MS SQL
"Tom DE BLENDE" <[email protected]> Wed, 11 Dec 2002 09:51:41 +0100
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Organization | DHL GCC |
| Message-ID | <[email protected]> |
Sure. I've brewed some Bash scripts to monitor things like: is there a DBCC running during office hours? Is there still a backup database process running during office hours? Are there sql processes being blocked and if so: by whom and from what client? Did any of the maintenance plans fail? I've attached the last one as an example to get you started. However, I should give you the standard "Hey, I'm not a programmer"-disclaimer first, so the code might not be 100% politically correct. In my case it's even worse, I'm not a programmer AND I have an MS past :-) For this plugin to work, I assume you have Freetds and sqsh up and running. If this is not the case, this plugin will not work (don't forget to change the path if required). Besides that a GNU date command is required to use the '--date="$interval minutes ago"' switch. If you don't have it, you can 1) install it or 2) recode that part of the script. You then run the script providing as command line arguments the SQL server, the username, the password and how many minutes before the present you want to check for failed maintenance plans. So what I do is: command: command[check_sql_maint]=$USER1$/check_sql_maintenance.sh $HOSTNAME$ $ARG1$ $ARG2$ $ARG3$ service: service[server]=Maintenance;1;24x7;1;30;30;admins;0;24x7;0;1;1;;check_sql_maint!username!password!30 So the service check is launched every 30 minutes and checks whether any maintenance plan has failed during those last 30 minutes. If it is the case, it will send out a critical alert. I works fine. I hope my explanation makes sense to you. If you do have problems or are happy with the plugin, just drop an email. Kind regards, Tom "Burnson, Richard" wrote: > > Do you have any example scripts you could share? > > Regards, > Richard A. Burnson > > > > > -----Original Message----- > From: Tom DE BLENDE [mailto:[email protected]] > Sent: Tuesday, November 26, 2002 7:58 AM > To: Warrick FitzGerald > Cc: [email protected] > Subject: Re: [netsaint] Monitoring MS SQL > > Up until SQL Server 7, Microsoft officially supported Sybase client > software. So you could download the Sybase client, and connect to MS > SQL. With TDS version 8.0 (and legacy support for version 7.0) in SQL > 2000, compatibility with Sybase client was broken. However, you can > use the Freetds libraries instead. > > So here's what I've done to have a way to connect to both SQL 7 and > SQL 2000: > > 1) Download and install freetds from http://www.freetds.org. > 2) Download and install sqsh from http://www.sqsh.org. > 3) export SYBASE=/usr/local/freetds (or where ever your freetds is > installed) > > Now you can use sqsh to connect to your MS SQL: > > sqsh -S servername -U username > > You're now reasy to script your own plugins based on the output you > get from your queries. Works great. > > Warrick FitzGerald wrote: > > > > Hi All, > > > > Can anyone tell me if there is a module for NetSaint that will allow me > > to monitor MS SQL server. I would live to be able to execute a SQL query > > on the Database, via an ODBC driver of some kind and tie this into my > > monitoring system. > > > > Thanks > > Warrick > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Get the new Palm Tungsten T > > handheld. Power & Color in a compact size! > > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > > _______________________________________________ > > Netsaint-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/netsaint-users > > ------------------------------------------------------- > This SF.net email is sponsored by: Get the new Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > _______________________________________________ > Netsaint-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/netsaint-users
check_sql_maintenance.gz
(application/x-gzip, 986 B) - not displayed