Cnfiguring Database & SQL Query Mnitring With Sentry-g Quick & Plus! mnitrs 3Ds (UK) Limited, Nvember, 2013 http://www.sentry-g.cm Be Practive, Nt Reactive! One f the best ways f ensuring a database is perfrming crrectly, especially fr key prductin systems is t peridically cnnect t it and ptinally run ne r mre queries and cmpare the results with a knwn gd value. With many slutins this wuld invlve the creatin f numerus scripting files and prgramming it yurself. With Sentry-g, such checks are easy t cnfigure & autmate, allwing yu t verify ODBC System DSNs defined n the server as well as cnfigure queries that the Quick Mnitr r Sentry-g Plus! shuld peridically run & check. In this guide System requirements... 2 Recmmended mnitring settings... 2 Mnitring database cnnectivity & SQL queries... 2 Cnfiguring database availability & SQL query mnitring... 3 Scheduling a check... 6 Testing database cnnectivity & SQL... 6 Temprarily ignring a cnfigured check... 6 Cnfiguring an autmatic respnse... 7 Cnfiguring an alert... 7 Mre Infrmatin... 8
System requirements This cmpnent is fully cmpatible with bth Sentry-g Quick Mnitrs v6 and abve, and Sentry-g Plus! v6 mnitrs and abve. Access t the target databases thrugh ODBC System DSNs, and ptinally a valid database user is als required. Recmmended mnitring settings It is recmmended that yur primary databases are peridically checked fr availability and cnnectivity. Yu may als wish t run ne r mre queries against these databases t ensure table access is available r data integrity is being maintained fr example T check a given value r number f rws desn t exceed a threshld figure. T verify that an actin such as an UPDATE r INSERT as perfrmed by ther systems can be run crrectly. Mnitring database cnnectivity & SQL queries T set up mnitring, cnfigure the apprpriate mnitr and select the SQL tab.
By default, run these checks every (minutes) This value specifies hw ften, in minutes, the Quick Mnitr shuld check that the defined database cnnectins and run any assciated queries. Yu can verride this fr a given cnnectin by editing the cnnectin details. Cnfiguring database availability & SQL query mnitring T mnitr a new cnnectin r edit an existing ne, select the Add r Edit ptin frm the main windw. Frm here yu can define which ODBC data surce (cnnectin) the mnitr shuld attempt t use in rder t establish cnnectivity with the database as well as any assciated SQL query t be perfrmed. Refer t this check as This is the name that yu will refer t the check as n bth web reprts and in any alerts generated. It is recmmended that a shrt and accurate descriptin be placed here - e.g. Live Database Cnnectin.
Cnnect using DSN Select the ODBC data surce that represents a cnnectin t the database yu wish t access r check. T add a new entry, click the "New..." buttn. User This value is used t specify the SQL Server User ID that is t be used with the ODBC cnnectin in rder t lgn t the database. T use a Trusted SQL Server Cnnectin, leave this and the passwrd entry blank. Fr mre infrmatin n using trusted cnnectins with Sentry-g, see the Using SQL Server Trusted Cnnectins guide. Passwrd This is the passwrd assciated with the abve SQL Server User ID. Testing SQL Cnnectivity Once defined, click the Test buttn t verify that the cnnectin can be made. See belw fr mre details. After cnnecting, run this SQL Query Select this ptin if yu wish t run a SQL Query against the cnnected database. Sentry-g will then run the SQL query entered belw nce cnnectivity has been established. T check database cnnectivity nly, leave this ptin unchecked. This field belw allws yu t enter the SQL query that yu want t run. This can either be a data retrieval (SELECT) r actin (INSERT, UPDATE etc.) statement. If a SELECT statement is run, yu can check... That the statement executed successfully The value returned in the first clumn, first rw The number f rws returned If an actin statement is run, yu can check... That the statement executed successfully The number f rws affected by the statement Cancel Changes after Query (Rllback) Select this ptin if yu wish t perfrm an SQL rllback after the statement cmpletes successfully. If this ptin is nt selected, the statement (including any changes made) will be cmmitted upn cmpletin. Testing the SQL Query Once defined, click the Test buttn t verify that the cnnectin can be made & the SQL query entered is valid and can be run against the chsen data surce. See belw fr mre details.
Data Type Fr a SELECT statement, this value indicates the type f value being returned (i.e. the data type f clumn 1). It can be set t an integer, lng r character. If character is selected, enter the maximum length f the character data in the length field. Fr ther data types, this field is ignred. Trigger an Alert if... The ptin selected here determines which check shuld be perfrmed after the SQL has been run. In particular, these ptins define under which cnditin an alert shuld be triggered... The query cannt be executed successfully. If this ptin is selected, an alert is triggered if an errr was encuntered while running the query. The query takes mre than X secnds t run. If this ptin is selected, an alert is triggered if the query takes lnger than the time entered t cmplete. The n. rws returned/affected is If this ptin is selected, an alert is triggered if the number f rws affected r returned by the statement is less than, equal t, nt equal t r greater than the value entered. The value entered must be numeric. Returned Data is If this ptin is selected, an alert is triggered if the result frm a SELECT query is less than, equal t, nt equal t r greater than the value entered. T use this ptin, the SQL query must be a SELECT statement. The cmparisn can be either character r numeric - n qutes are required fr character data. If multiple values (clumns r rws) are returned, the value frm the first rw & first clumn is verified. If a "less than" r "greater than" cmparisn is used, the return type must be numeric.
Scheduling a check By default, each check is perfrmed peridically at regular intervals thrughut the day. The frequency f these checks is determined by the value specified at the bttm f the main list. Hwever, there may be times when yu wish t perfrm the check at a different time, maybe at a set time each day, r n certain days etc. T d this, select the Schedule tab. Fr mre infrmatin, please see the Sentry-g Mnitring Schedule guide. Testing database cnnectivity & SQL Befre saving yur settings, yu can ptinally check database cnnectivity and/r the entered SQL query using the defined DSN and user/passwrd by clicking the apprpriate Test buttn. When selected, the Client Cnsle cnnects t the target mnitring server (the server being cnfigured) in rder t run the test, the results f which are then displayed in the resulting web page. In rder t check the cnfiguratin, the target Sentry-g mnitr must be running with web reprts enabled. The mnitring check itself is nt run, nly cnnectivity t the database using the DSN and authenticatin specified is verified at this stage. The parameters, alng with the test results are shwn n the web page. In sme cases, errrs may be bvius and easily crrected; in thers, additinal diagnstic infrmatin may be fund in the Sentry-g lg file, accessible n the server r via the web reprts menu. Fr mre infrmatin n the Sentry-g lg file, please see the Cnfiguring Lgging Optins guide. Temprarily ignring a cnfigured check In sme cases, yu may wish t exclude a check frm mnitring withut remving it permanently. T d this, simply remve the tick r check against the entry yu wish t ignre in the main list.
Cnfiguring an autmatic respnse In the event an errr is detected, Sentry-g can be cnfigured t ptinally respnd autmatically - i.e. t take actin itself. T cnfigure this, select entry frm the list and click Edit. On the resulting windw, select the Respnse tab. Fr mre infrmatin n the ptins available as well as details n hw t cnfigure autmatic respnses, please see the Cnfiguring Autmatic Respnses guide. Cnfiguring an alert In the event an errr is detected and either n autmatic respnse is defined r the respnse desn t reslve the fault, an alert will be triggered. Depending n the mnitr s general settings, yu can either ntify ne r mre cntacts individually, r specify the alert grup yu wish t infrm. T cnfigure these ptins, select the entry frm the list and click Edit. On the resulting windw, select the Alert tab. Fr mre infrmatin, please see the Cnfiguring Sentry-g Alerts guide.
Mre Infrmatin If yu need mre help r infrmatin n this tpic Read all papers/dcuments n-line. Watch demnstratins & walkthrugh vides n-line. Visit http://www.sentry-g.cm. Cntact ur Supprt Team. Sentry-g, 3Ds (UK) Limited, 2000-2013 East Mlesey, Surrey. United Kingdm T. 0208 144 4141 W. http://www.sentry-g.cm