|
The CSO feature is to utilize information available in Information_Schema (as well as Performance_Schema of MySQL 5.5+) that are not exposed in the basic SHOW statements we have been using till now in the monitors/advisors. In addition to the Performance_Schema SELECT queries any query which returns a result set can be monitored.
CSOs not only lets you monitor server metrics but also lets you monitor server data.
A CSC is based on any user-defined SQL query returning a result set. The array returned by MySQL from the SQL query populates a MONyog Object (a ”Custom SQL Object” (CSO) in this case). This is exposed as a javascript array that may be referenced in MONyog counter definitions like any MONyog object.
Enabling pre-defined CSCs and CSOs:
In order to monitor CSOs you would need to create a Custom SQL Counter(CSC). MONyog comes shipped with a bunch of pre-defined CSCs with their respective CSOs. By default all pre-defined CSOs and CSCs are disabled. To enable some of these samples follow these steps-
1) Go to Customize-> Manage Changes -> Choose Add/Edit Custom SQL Objects from the dropdown. You will see the 13 pre-defined CSOs display in the left menu. As an example select the ‘DiskInfo’ item. The User Defined SQL-query displays in the ‘SQL’ box. Sample interval and retention timeframe specific for this CSO may be changed as per your preference and you may specify for which MySQL server(s) this particular CSO should be collected. Also note that one or more ‘Key columns’ are defined. This/they must be a column or a set of columns returning (a) unique (set of) value(s) (similar to a UNIQUE KEY in MySQL). Without defining a Key Column, the result monitors might now show proper values.
2) Go to go to Customize-> Manage Monitor Groups and enable the ‘Disk Info’ Group. This pre-defined group contains pre-defined CSC’s using the CSO’s you enabled in step 1).
3) Now go to Monitors page, select the ‘Disk Info’ group that now displays at the bottom. You will see 5 new counters in that group that in various ways reference the CSO’s that we just enabled (click the counter name and next ‘Customize’ as usually to see the javascript code). You may customize those further as you would do with any counter in MONyog.
|