ODBCSQL
From ServersCheck Wiki
Contents |
Description
The ODBCSQL check allows you to connect to a database server with the specified ODBC string connection string and then perform a SQL statement. The returned value is then compared against a threshold value. With this check you can check if database servers have the correct data stored.
Definition
Besides the general settings for each check, which are similar for all checks, there are following specific settings that also need to be established. In the Check Specific Settings, there are following fields you need to supply with parameters:
- Database Templates - If you are unfamiliar with DSN-less ODBC connections, then you can select an ODBC connection template and match it to your configuration.
- ODBC Connection string - The ODBC connection string for validation.
- SQL Statement - The SQL statement to execute.
- Field name - The field of which the value is compared against the threshold.
Sample ODBC Connection Strings
Oracle ODBC driver:
Driver={Oracle ODBC Driver};Dbq=myDBName;Uid=myUsername;Pwd=myPassword
Microsoft Oracle ODBC driver:
Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=myUsername;Pwd=myPassword
Informix 3.30 ODBC driver:
Driver={INFORMIX 3.30 32 BIT};Host=hostname;Server=myserver;Service=service-name;Protocol=olsoctcp;Database=mydb;UID=username;PWD=myPwd
Pervasive ODBC driver:
Driver={Pervasive ODBC Client Interface};ServerName=srvname;dbq=@dbname
Microsoft SQL ODBC driver:
Driver={SQL Server}; Server=(local); Database=myDBName; UID=sa; PWD=;
Microsoft Access ODBC driver:
Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\myDBName.mdb
Microsoft Excel:
Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file; DriverID=278;
Text File:
Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=physical path to .txt file;
Returned Results
This check verifies if the value returned for the field name matches the condition defined against a predefined value.
Graphs
When the graphing option is activated then ServersCheck will produce for this check two graphs: Service Level, Availability.

