Database Sensor

<< Click to Display Table of Contents >>

Navigation:  Sensors > Misc Sensors >

Database Sensor

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

Note about OleDB

For OleDB provider it is best to use the dialog which is reachable over the button next to the connection string.

Note about ODBC

The connection strings for ODBC connections can be for example:

To access a Microsoft Access database:

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

To access a Microsoft Excel table:

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

Files with comma separated values (CSV):

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

There is a bug in older versions of the OleDB provider for ODBC. The following connection string would fail because of the whitespace before "Driver":

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

Without the whitespace before "Driver" this works:

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

Note aboud ADO.Net

To establish a connection using ADO.Net, it is necessary to prefix the connection string with the name of the DLL library and the concrete connection data type. The DLL library itself must be placed in the "bin" directory of ServerSentinel. A connection string MySQL could for example look like:

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

 

Sensor Tasks

Test Sensor

Tests the current sensor settings.

Get Help

Opens the ServerSentinel online help for the current sensor.

Basic Settings

Name

The name of the sensor (max. 100 characters). Choose a meaningful name to clearly identify the sensor.

Sensor is Active

Toggles the sensor ON/OFF.

Check Interval

The interval or times at which which the sensor should perform its checks.

Simple

The sensor performs its checks every x time units, e.g. every 10 minutes.

Daily

The sensor performs its checks daily at one or more (max. 4) fixed times, e.g. daily at 0 and 12 o'clock.

Weekly

The sensor performs its checks at certain days of the weeks at one or more (max. 4) fixed times, e.g. monday to friday at 12 o'clock.

Monthly

The sensor performs its checks at certain days of the month at one or more (max. 4) fixed times, e.g. every 1st of the month at 12 o'clock.

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

Short additional information to the sensor (max. 255 characters).

Database Options

Connection String

Connection string for the database connection (max. 1024 characters).

Command Timeout (s)

The timespan in seconds after which a timeout should occur during the execution of the SQL statement.

SQL Statement

SQL statement which is executed on sensor check (max. 1024 characters).

Isolationlevel

Specifies the transaction locking behavior for the connection.

Chaos

The pending changes from more highly isolated transactions cannot be overwritten.

Read Committed

Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.

Read Uncommitted

A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.

Repeatable Read

Locks are placed on all data that is used in a query, preventing other users from updating the data. Prevents non-repeatable reads but phantom rows are still possible.

Serializable

A range lock is placed on the DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.

Snapshot

Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.

Unspecified

A different isolation level than the one specified is being used, but the level cannot be determined.

When using ODBC transaction, if you do not set Isolationlevel or you set Isolationlevel to Unspecified, the transaction executes according to the isolation level that is determined by the driver that is being used.

 

Meta Data Values

Data Value

Data Type

Description

Checktime

Date

The time the dataset has been created.

Exception Message

String

The message of the error if any occurred.

Response Time

Integer

The response time needed to perform the check.

Status

String

A status string that may contain arbitrary information that was collected by the sensor (max. 255 characters). Per default this value is empty.

Status Flag

Enum

The status of the sensor after the check has been performed.

Data Values

Data Value

Data Type

Description

Records affected

Integer

Contains the number of records that were affected by the query.

Result

String

The result set that is returned by the query.

Rows selected

Integer

Contains the number of rows that were selected by the query.

Apart from the above data values additionally each column of the result is displaced.