<< 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.
For OleDB provider it is best to use the dialog which is reachable over the button next to the connection string.
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;
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.
|
||||||||
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.
|
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 |
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.