Database Check (Generic) using ActiveXperts Network Monitor
Introduction
ActiveXperts Network Monitor uses ADO (ActiveX Data Objects, a set of Microsoft objects for accessing data sources) to check availability of OLE DB compliant databases. OLE DB (sometimes written as OLEDB or OLE-DB) is an API for accessing different types of data stores in a uniform manner, including: MS SQL, MS Access, Oracle, MySQL and more.
The ActiveXperts database check performs a database query, and matches the query output against a value. If the value is matched, the check is considered 'successful'. If the value not matched, or if the database cannot be accessed, the check is considered 'failed'.
The ActiveXperts Database Query check requires the following parameters:
- OLE DB (ADO) Connection String - The OLE DB connection string, to connect to the database.
The connection string format depends on the type of database.
For more information, see: www.connectionstrings.com.
Sample connection string (1): DRIVER=Microsoft Access Driver(*.mdb);DBQ=\\SERVER03\Public\Northwind.mdb
Sample connection string (2): DRIVER={SQL Server}; Server=pluto; Database=customers; UID=sa; PWD=sa1
NOTE: You can use a password in this connections string. To hide the password, you can use the <%PASSWORD%> placeholder. When using this placeholder, ActiveXperts will automatically substitute this placeholder with the 'Password' field described below; - Password - This is the password string (shown as asterisks) that will substitute the <%PASSWORD%> field described above;
- Database Query - The database query. The total result of the check is determined by the query output has been analyzed;
- Database Field - The field that will be matched to determine the result of the check;
- Database Field Type - Type of field to be checked;
- Field must be Equal To / Not Equal To - Operator used to determine the result of the check;
You can use an AND/OR operator to create an advanced condition.
More on ADO (ActiveX Data Objects)
The ActiveX Data Objects (ADO) interfaces represent the best of the existing Microsoft data access programming models. If you are familiar with Data Access Objects (DAO) or Remote Data Objects (RDO), you will recognize the interfaces and will be able to work with them very quickly. You will also notice considerable improvements in the model, and tasks that were awkward in previous models have either been fixed or eliminated from the ADO model.
The ADO objects provide you with the fastest, easiest and most productive means for accessing all kinds of data sources. The ADO model strives to expose everything that the underlying data provider can do, while still adding value by giving you shortcuts for common operations.
ADO is Microsoft's strategic, high-level interface to all kinds of data. ADO provides consistent, high-performance access to data, whether you're creating a front-end database client or middle-tier business object using an application, tool, language, or even an Internet browser. ADO is the single data interface you need to know for 1- to n-tier client/server and Web-based data-driven solution development. ADO is designed as an easy-to-use application level interface to Microsoft's newest and most powerful data access paradigm, OLE DB. OLE DB provides high-performance access to any data source, including relational and non-relational databases, email and file systems, text and graphics, custom business objects, and more. ADO is implemented with a small footprint, minimal network traffic in key Internet scenarios, and a minimal number of layers between the front-end and data source-all to provide a lightweight, high-performance interface. ADO is easy to use because it is called using a familiar metaphor - the OLE Automation interface, available from just about any tool and language on the market today. And since ADO was designed to combine the best features of, and eventually replace RDO and DAO, it uses similar conventions with simplified semantics to make it easy to learn for today's developers.
ADO Connection Strings
ActiveXperts Network Monitor uses ADO (ActiveX Data Objects, a set of Microsoft objects for accessing data sources) to check availability of OLE DB compliant databases. In Network Monitor, you must use an ADO connection string to connect to an OLE DB compliant database.
Because of its wide acceptance, its universal interface and its performance, ActiveXperts selected ADO as its primary protocol to monitor a variety of databases. You can run multiple database checks simultaneously. You can either use the built-in 'Database Query(Generic)' check to perform basic availability checks, or use advanced custom VBScript routines to perform advanced database checks.
MS Access
MS Access connection strings require the following format:
DRIVER=Microsoft Access Driver (*.mdb);DBQ=<filename>
Sample MS Access connection string:
DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\Database Files\Customers.mdb
MS SQL
MS SQL connection strings require the following format (UID and PWD are optional):
DRIVER={SQL Server};Server=<host>;Database=<db-name>;UID=<login>;PWD=<password>
Sample MS SQL connection string:
DRIVER={SQL Server}; Server=pluto; Database=customers; UID=sa; PWD=mypassword
To hide a password in the 'connection string' field, enter the password in the Password field and use it in the 'connection string' like this:
Driver={SQL Server}; Server=server_name; Database=database_name; UID=user_name; PWD=<%PASSWORD%>
MySQL
MySQL connection strings require the following format (Uid and Password are optional):
Driver={MySQL ODBC 3.51 Driver};Server=<host>;Database=<db-name>;Uid=<login>;Password=<password>
Sample MySQL connection string:
Driver={MySQL ODBC 3.51 Driver};Server=pluto;Database=CRM;Uid=admin;Password=welcome
To hide a password in the 'connection string' field, enter the password in the Password field and use it in the 'connection string' like this:
Driver={MySQL ODBC 3.51 Driver};Server=MyServer;Database=MyDatabase;Uid=sa;Password=<%PASSWORD%>;IMPORTANT: For more information about connection strings, please check the following web site: www.connectionstrings.com.
Tracing
ActiveXperts provides a trace log for all ADO/OLE DB database operations. To turn on tracing, assign a valid filename to the following registry value:
HKLM\Software\ActiveXperts\Network Monitor\Trace\AdoCheck
NOTE: You need to restart the service after the registry change.
Advanced database checks
The built-in database checks only checks if it can query server. If the query is successful, the database turns out to be up and running. However, you may need to do more in-depth checking of a database. Read our VBScript Guidelines for more information about VBScript checks. This page also contains advanced VBScript database samples.