Navigation:  Configurable Sensors > Standard Sensors >

Database Sensor

Previous pageReturn to chapter overviewNext page

With the sensor_database_16 Database Sensor it is possible to connect to a ADO database to frequently perform queries on a table or to execute a stored procedure.

A note on the ConnectionString, for OleDb Providers, it is best to use the Dialog that's shown if you click on the ".." button. The sensor is also capable
of performing an ADO.Net connection. For this, prepend the name of the Dll-File of the Net/Connector and the datatype to the regular connection string:

MySql.Data.dll;MySql.Data.MySqlClient.MySqlConnection;Server=SERVER;Database=DB;Uid=USER;Pwd=PASSWORD;

Above, the MySql Connector is used. The Library "MySql.Data.dll" needs to be placed into the "bin" folder of ServerSentinel, the Datatype in that case is "MySql.Data.MySqlClient.MySqlConnection", after that the connection string is appended (see e.g. connectionstrings.com).

Since version 1.3 of ServerSentinel, connection strings to ODBC-Drivers are also supported, this feature has been tested to work with Microsoft Access Databases. Here is a possible connection string:

Provider=MSDASQL; Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\path\filename.mdb;

For further details, see below.

 

db_sensor_sidepanel

Side Panel

Sensor Tasks

start24Test Sensor

Tests the current sensor settings

task_helpsensor24Get Help

Opens the ServerSentinel online help

Basic Settings

Display Name

Defines the name of the sensor

Active

Toggles the sensor ON/OFF

Check Interval

Interval between two sensor polls

Only check if this sensor didn't fail

This sensor will only be checked, if the sensor in the drop down list didn't fail

Further Information

Comment

May contain a free comment

Database

Connection String

String command for connecting to database

SQL Statement

SQL query string

Isolation level

Please refer to:

http://msdn.microsoft.com/en-us/library/system.data.isolationlevel.aspx

 

db_sensor_mainpanel

Main  Panel

Setting

uses value

Records affected

Integer

Rows selected

Integer

Result

String

Check Time

Date

Response Time (ms)

Integer

Status Flag

Enum

 

Notes on the ODBC Connection Drivers

To access excel files:

Provider=MSDASQL; Driver={Microsoft Excel Driver (*.xls)}; DBQ=C:\path\filename.xls;

Files containing comma separated values:

Provider=MSDASQL; Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=C:\path\;

 

There is a bug in older versions of the OLE DB Provider for ODBC. This would fail:

Provider=MSDASQL; Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\path\filename.mdb;

without the space before 'Driver=' this works:

Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\path\filename.mdb;